BuildsTextRequests
trait BuildsTextRequests
Traits
Methods
string|null
composeInstructions(string|null $instructions, array|null $schema)
Add structured output requirements to the instructions.
array
buildStepBody(TextProvider $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 Ollama Chat API.
array
buildChatRequestBody(Provider $provider, string $model, array $chatMessages, array $tools, array|null $schema, TextGenerationOptions|null $options, bool $stream = false)
Build a request body from pre-mapped chat messages.
array
buildResponseFormat(array $schema)
Build the response format schema 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 26
protected array
buildStepBody(TextProvider $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 42
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 Ollama Chat API.
at line 64
protected array
buildChatRequestBody(Provider $provider, string $model, array $chatMessages, array $tools, array|null $schema, TextGenerationOptions|null $options, bool $stream = false)
Build a request body from pre-mapped chat messages.
at line 126
protected array
buildResponseFormat(array $schema)
Build the response format schema for structured output.