LlmApi class

Text generation.

Constructors

LlmApi()
Bind the namespace. Reach it through RunAnywhere.llm.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tools ToolsApi
Tool registry backing options.tools and the auto-execute loop.
no setter

Methods

cancel() → void
Cancel the in-flight generation on this namespace, if any.
generate(String prompt, {LlmOptions? options}) Future<GenerationResult>
Generate a completion for prompt.
generateChat(List<ChatMessage> messages, {LlmOptions? options}) Future<GenerationResult>
Generate a completion for a conversation.
generateChatStream(List<ChatMessage> messages, {LlmOptions? options}) Stream<GenerationEvent>
Stream a completion for a conversation token by token.
generateStream(String prompt, {LlmOptions? options}) Stream<GenerationEvent>
Stream a completion for prompt token by token.
generateStructured(String prompt, String schema, {StructuredOutputMode mode = StructuredOutputMode.validationOnly, LlmOptions? options}) Future<StructuredResult>
Generate a completion constrained to schema.
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