SyniChatResponse class

A completed Syni response.

Parses the runtime's tagged EngineResponse envelope — {"type":"coach","data":{...}} — into a clean typed surface. Callers use message / suggestions / displayText and never touch raw JSON.

Constructors

SyniChatResponse.fromCloudReply(String reply, {required String personaId, required String runtimeVersion})
Build a response from a cloud reply string.
factory
SyniChatResponse.fromRuntimeJson(String rawJson, {required String personaId, required String runtimeVersion})
Parse the runtime's final EngineResponse JSON string. Tolerant of unexpected shapes — falls back to SyniResponseKind.unknown.
factory

Properties

displayText → String
Best-effort display string — message if present, else the first suggestion, else a neutral placeholder. UI can render this directly.
no setter
fallbackReason → String?
Raw reason behind a fallback (e.g. timeout), else null.
final
hashCode → int
The hash code for this object.
no setterinherited
isFallback → bool
True when the runtime returned a deterministic fallback rather than model output. Defaults to false (a genuine answer, or a cloud reply, or an older runtime that emits no meta). Clients must branch on this rather than matching the fallback's text.
final
kind → SyniResponseKind
Which EngineResponse variant this is.
final
message → String?
Primary reply text. Present for coach and chat; null for a pure suggestions response.
final
personaId → String
The persona that produced this response.
final
rawJson → String
The runtime's raw final JSON — kept for debugging / telemetry. UI code should use message / suggestions / displayText, not this.
final
retryable → bool
Whether the failure behind a fallback was transient. False unless isFallback.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
runtimeVersion → String
Runtime semver reported by libsyni_ffi.
final
suggestions → List<String>
Suggestion texts. Populated for coach and suggestions.
final
underlyingErrorCode → String?
Stable code classifying the failure behind a fallback (INVALID_JSON, SCHEMA, TIMEOUT, …), else null.
final

Methods

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

Operators

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