CompletionOptions
Represents options for a completion request.
Value parameters
- budgetTokens
-
Optional explicit budget for thinking tokens (Anthropic Claude). If set, overrides the default budget from reasoning effort level.
- frequencyPenalty
-
Penalizes new tokens based on their existing frequency in the text so far, discouraging repetition.
- maxTokens
-
Optional maximum number of tokens to generate in the completion.
- presencePenalty
-
Penalizes new tokens based on whether they appear in the text so far, encouraging new topics.
- reasoning
-
Optional reasoning effort level for models that support extended thinking (o1/o3, Claude). For non-reasoning models, this setting is silently ignored.
- temperature
-
Controls the randomness of the output. Higher values make the output more random. Note: Reasoning models (o1/o3) ignore this setting.
- tools
-
Optional sequence of tool function definitions that can be requested by the LLM during a completion.
- topP
-
Controls the diversity of the output. Lower values make the output more focused.
Attributes
- Example
-
import org.llm4s.llmconnect.model._ // Enable high reasoning for complex tasks val options = CompletionOptions() .withReasoning(ReasoningEffort.High) .copy(maxTokens = Some(4096)) // For Anthropic, set explicit thinking budget val anthropicOptions = CompletionOptions() .withBudgetTokens(16000) - Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any