BuildsTextRequests
trait BuildsTextRequests
Traits
Methods
string|null
composeInstructions(string|null $instructions, array|null $schema)
Add structured output requirements to the instructions.
array
buildStepBody(Provider $provider, string $model, string|null $instructions, array $messages, array $tools, array|null $schema, TextGenerationOptions|null $options, StepContext $stepContext)
Build the request body for the current text generation step.
array
buildTextRequestBody(Provider $provider, string $model, string|null $instructions, array $messages, array $tools, array|null $schema, TextGenerationOptions|null $options)
Build the request body for the Chat Completions API.
array
buildResponseFormat(array $schema, bool $strict)
Build the response format options for structured output.
Details
in
ComposesSchemaInstructions at line 14
protected string|null
composeInstructions(string|null $instructions, array|null $schema)
Add structured output requirements to the instructions.
at line 23
protected array
buildStepBody(Provider $provider, string $model, string|null $instructions, array $messages, array $tools, array|null $schema, TextGenerationOptions|null $options, StepContext $stepContext)
Build the request body for the current text generation step.
at line 39
protected array
buildTextRequestBody(Provider $provider, string $model, string|null $instructions, array $messages, array $tools, array|null $schema, TextGenerationOptions|null $options)
Build the request body for the Chat Completions API.
at line 96
protected array
buildResponseFormat(array $schema, bool $strict)
Build the response format options for structured output.