LlmOptions class

Sampling, prompting, reasoning, and tool controls for llm and vlm.

Constructors

LlmOptions({String? model, int? maxOutputTokens, double? temperature, double? topP, int? topK, double? minP, double? frequencyPenalty, double? presencePenalty, double? repetitionPenalty, int? seed, List<String> stopSequences = const <String>[], String? systemPrompt, ReasoningOptions? reasoning, StructuredOutput? structuredOutput, List<ToolDefinition> tools = const <ToolDefinition>[], ToolChoice toolChoice = ToolChoice.auto, int? maxToolCalls, bool autoExecute = true})
Override any subset of the generation defaults.

Properties

autoExecute bool
Whether the SDK runs a requested tool call itself and feeds the result back into the loop. False returns the parsed call to the caller instead of invoking it — the same contract as the direct tool-calling API's autoExecute, reachable from generate/generateStream with inline tools. Mirrors Kotlin LlmOptions.autoExecute.
final
frequencyPenalty double?
OpenAI-style frequency penalty.
final
hashCode int
The hash code for this object.
no setterinherited
maxOutputTokens int
Hard cap on generated tokens.
no setter
maxToolCalls int
Maximum tool-call round trips before the loop stops.
no setter
minP double?
Minimum-probability truncation. Null disables it.
final
model String?
Model slug to generate with. Absent auto-loads, downloading if needed.
final
presencePenalty double?
OpenAI-style presence penalty.
final
reasoning ReasoningOptions?
Thinking-phase control.
final
repetitionPenalty double
Repetition penalty. 1.0 is no penalty.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed int?
Deterministic sampling seed.
final
stopSequences List<String>
Strings that halt generation when emitted.
final
structuredOutput StructuredOutput?
Output schema constraint.
final
systemPrompt String?
System instruction prepended to the conversation.
final
temperature double
Sampling temperature. 0 is greedy decoding.
no setter
toolChoice ToolChoice
How the model may use those tools.
final
tools List<ToolDefinition>
Tools offered for this generation. Empty uses the registry.
final
topK int?
Top-k truncation. Null disables it.
final
topP double
Nucleus-sampling mass.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toProto({List<ToolDefinition> registeredTools = const <ToolDefinition>[]}) LLMGenerationOptions
Build the generated LLM generation options.
toString() String
A string representation of this object.
inherited
toVlmRequest({required String prompt, required List<VLMImage> images, List<ToolDefinition> registeredTools = const <ToolDefinition>[]}) VLMGenerationRequest
Build the generated VLM request envelope for prompt over images.

Operators

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