LlmApi class
Text generation.
Constructors
- LlmApi()
-
Bind the namespace. Reach it through
RunAnywhere.llm.const
Properties
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
prompttoken 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