PendingStep
class PendingStep
A generation step handed to agent middleware before the model is called.
Methods
Create a generation step for agent middleware.
Determine whether this is the first generation step.
Create a copy using a different model.
Create a copy using different instructions.
Replace the history sent for this step only; the run's history still grows from the original.
Create a copy using the given tools.
Create a copy containing only the named tools.
Create a copy excluding the named tools.
Create a copy using a different tool choice.
Create a copy using a different maximum token count.
Create a copy using the given provider options.
Get the step options, creating an empty set when none were provided.
Create a copy with the given property overrides.
Details
at line 29
__construct(int $number, bool $isFinalStep, string $provider, string $model, string|null $instructions, array $messages, array $tools, array|null $schema, TextGenerationOptions|null $options, array $steps = [], TextUsage $usage = new TextUsage(), int|null $timeout = null, string|null $invocationId = null)
Create a generation step for agent middleware.
at line 49
bool
isFirstStep()
Determine whether this is the first generation step.
at line 57
PendingStep
withModel(string $model)
Create a copy using a different model.
at line 65
PendingStep
withInstructions(string|null $instructions)
Create a copy using different instructions.
at line 75
PendingStep
withMessages(iterable $messages)
Replace the history sent for this step only; the run's history still grows from the original.
at line 85
PendingStep
withTools(iterable $tools)
Create a copy using the given tools.
at line 93
PendingStep
onlyTools(string ...$names)
Create a copy containing only the named tools.
at line 101
PendingStep
withoutTools(string ...$names)
Create a copy excluding the named tools.
at line 111
PendingStep
withToolChoice(ToolChoice|string|array|null $toolChoice)
Create a copy using a different tool choice.
at line 121
PendingStep
withMaxTokens(int|null $maxTokens)
Create a copy using a different maximum token count.
at line 131
PendingStep
withProviderOptions(array $providerOptions)
Create a copy using the given provider options.
at line 141
protected PendingStep
withOptions(TextGenerationOptions $options)
Create a copy using the given options.
at line 149
protected TextGenerationOptions
resolvedOptions()
Get the step options, creating an empty set when none were provided.
at line 159
protected PendingStep
with(array $overrides)
Create a copy with the given property overrides.