SyniAgent class

Orchestrates an installed, persona-bound Syni: install lifecycle, model management, and chat over the local runtime worker isolate.

Layering: this is Syni's orchestration layer. It is HSI-agnostic — it takes the conditioning context as a plain Map<String, dynamic>? (hsiContext) and never imports a host-SDK type. The host SDK (synheart_core) wraps this with its four-authority gate and its HSI context builder; see Synheart.syni.

Constructors

SyniAgent({SyniInstaller? installer, SyniCloudConfig? cloudConfig})

Properties

currentState SyniInstallState
Current installation state.
no setter
hasCloud bool
Whether a cloud client is configured (i.e. cloud chat is reachable).
no setter
hashCode int
The hash code for this object.
no setterinherited
installState Stream<SyniInstallState>
Stream of installation lifecycle events.
no setter
isInstalled bool
True iff currentState is SyniInstalled.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

chat(String message, {Map<String, dynamic>? hsiContext, int seed = 0, SyniExecutionMode mode = SyniExecutionMode.localFirst}) Future<SyniChatResponse>
Run a single chat turn. hsiContext is the conditioning payload built by the host SDK (or null). mode picks local vs cloud — see SyniExecutionMode.
chatStream(String message, {Map<String, dynamic>? hsiContext, int seed = 0, SyniExecutionMode mode = SyniExecutionMode.localFirst}) Stream<SyniChatEvent>
Streaming counterpart to chat. Emits SyniChatDeltas as tokens arrive, then exactly one SyniChatFinal.
dispose() Future<void>
For testing / shutdown. Closes the state stream and disposes the underlying runtime.
install({required SyniPersona persona, required SyniModelSpec model}) Future<void>
Install Syni: download + verify the model, load the engine, bind persona. Emits lifecycle events on installState; throws on failure (after emitting SyniInstallFailed).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restoreInstallIfReady({required SyniPersona persona, required SyniModelSpec model}) Future<bool>
Cold-start restore: if the model + tokenizer are already on disk for model, bind persona and load the engine — no download. Otherwise leaves state as SyniNotInstalled and returns false.
toString() String
A string representation of this object.
inherited
uninstall() Future<void>
Free the engine + worker isolate. Keeps the downloaded model on disk — re-installing reuses it.

Operators

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