LiteRtLmNativeRuntime class abstract interface

Internal bridge implemented by each LiteRT-LM platform runtime.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelConversation(ConversationHandle conversation) → void
Cancels generation for a native conversation.
createConversation(EngineHandle engine, ConversationConfig config) Future<ConversationHandle>
Creates a native conversation handle.
createEngine(EngineConfig config) EngineHandle
Creates a native engine handle.
deleteConversation(ConversationHandle conversation) → void
Deletes a native conversation handle.
deleteEngine(EngineHandle engine) → void
Deletes a native engine handle.
getTokenCount(ConversationHandle conversation) Future<int>
Gets the number of tokens in the conversation KV Cache.
initializeEngine(EngineHandle engine) Future<void>
Initializes a native engine.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renderMessageIntoString(ConversationHandle conversation, String messageJson) Future<String>
Renders a message using the native prompt template.
sendMessage(ConversationHandle conversation, String messageJson, {String? extraContextJson}) Future<Message>
Sends a message and returns the model response.
sendMessageStream(ConversationHandle conversation, String messageJson, {String? extraContextJson}) Stream<Message>
Sends a message and streams response chunks.
setMinimumLogLevel(LogSeverity severity) → void
Sets the minimum native log severity.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance LiteRtLmNativeRuntime
Runtime implementation for the current platform.
final