TextGenerationOptions
class TextGenerationOptions
Properties
| array<int, object|string> | $middleware |
Methods
Create text generation options.
Get the provider-specific options for the given provider.
Create a copy using a different maximum token count.
Create a copy using different provider options.
Create a copy using the given runtime middleware.
Create a copy with the given property overrides.
Resolve the options for the given step, releasing a forced tool choice after the first step so the model can answer.
Details
at line 32
__construct(int|null $maxSteps = null, int|null $maxTokens = null, float|null $temperature = null, Agent|null $agent = null, float|null $topP = null, ToolChoice|null $toolChoice = null, CacheInstructions|null $cacheInstructions = null, CacheToolDefinitions|null $cacheToolDefinitions = null, array|null $providerOptions = null, array $middleware = [])
Create text generation options.
at line 58
array|null
providerOptions(Lab|string $provider)
Get the provider-specific options for the given provider.
at line 76
TextGenerationOptions
withToolChoice(ToolChoice|null $toolChoice)
Create a copy using a different tool choice.
at line 84
TextGenerationOptions
withMaxTokens(int|null $maxTokens)
Create a copy using a different maximum token count.
at line 94
TextGenerationOptions
withProviderOptions(array|null $providerOptions)
Create a copy using different provider options.
at line 104
TextGenerationOptions
withMiddleware(array $middleware)
Create a copy using the given runtime middleware.
at line 114
protected TextGenerationOptions
with(array $overrides)
Create a copy with the given property overrides.
at line 122
TextGenerationOptions
forStep(int $stepNumber)
Resolve the options for the given step, releasing a forced tool choice after the first step so the model can answer.
at line 138
static TextGenerationOptions
forAgent(Agent $agent)
Create a new TextGenerationOptions instance for the given agent.