AskAnswer class

Constructors

AskAnswer({String? answer, List<Citation> citations = const [], bool? degraded, String? question})
Returns a new AskAnswer instance.

Properties

answer ↔ String?
Answer is the synthesized prose. EMPTY is a real answer here: nothing in the index matched, or synthesis was unavailable — read degraded and citations to tell those apart. It is never written without grounding.
getter/setter pair
citations ↔ List<Citation>
Citations are the exact regions the answer was grounded on, and they are the point: an answer is checkable only because every claim in it can be read back at a file and line. Present even when Answer is empty.
getter/setter pair
degraded ↔ bool?
Degraded is true when retrieval worked but no synthesizer was reachable. The citations are still real code, so a caller can answer from them itself; a caller that treats this like an error throws away a usable result.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
question ↔ String?
Question is the ask, echoed back.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → AskAnswer?
Returns a new AskAnswer instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<AskAnswer>
mapFromJson(dynamic json) → Map<String, AskAnswer>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<AskAnswer>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.