Conversation class

Represents a conversation with the LiteRT-LM model.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isAlive → bool
Whether the conversation is alive and ready to be used.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() → Future<void>
Cancels the ongoing inference process.
dispose() → Future<void>
Releases the native conversation resources.
getBenchmarkInfo() → Future<BenchmarkInfo>
Gets benchmark information from the conversation.
getTokenCount() → Future<int>
Gets the number of tokens in the conversation KV Cache.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renderMessageIntoString(Message message) → Future<String>
Renders the message into a string according to the template.
renderPreface() → Future<String>
Renders the conversation preface into a string.
sendMessage(Message message, {Map<String, Object?>? extraContext, int? maxOutputTokens}) → Future<Message>
Sends a message to the conversation and returns the response.
sendMessageStream(Message message, {Map<String, Object?>? extraContext, int? maxOutputTokens}) → Stream<Message>
Sends a message to the conversation and streams the response.
sendMessageWithCallback(Message message, MessageCallback callback, {Map<String, Object?>? extraContext, int? maxOutputTokens}) → Future<void>
Sends a message to the conversation and streams chunks to callback.
toString() → String
A string representation of this object.
inherited

Operators

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