Llama class

A class that isolates the Llama implementation to run in a separate isolate.

This class implements the Llama interface and provides methods to interact with the Llama model in an isolated environment.

The Llama constructor initializes the isolate with the provided model, context, and sampling parameters.

The prompt method sends a list of LlamaMessage to the isolate and returns a stream of responses. It waits for the isolate to be initialized before sending the messages.

The stop method sends a signal to the isolate to stop processing. It waits for the isolate to be initialized before sending the signal.

The reload method stops the current operation and reloads the isolate.

Constructors

Llama.new(LlamaController controller)
Constructs an instance of Llama.

Properties

controller LlamaController
A completer that indicates when the isolate has been initialized.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
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
prompt(List<LlamaMessage> messages) Stream<String>
Generates a stream of responses based on the provided list of chat messages.
reload() → void
Reloads the isolate.
stop() → void
Stops the current operation or process.
toString() String
A string representation of this object.
inherited

Operators

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