BuildsTextRequests
trait BuildsTextRequests
Constants
| private TOP_LEVEL_INTERACTION_KEYS |
The request keys Gemini expects beside the generation config rather than within it. |
Methods
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 Gemini Interactions API.
array
buildFunctionResultSteps(array $toolResults)
Build function result steps from tool results for the Gemini API.
array
buildResponseSchema(array $schema)
Build the response schema for structured output.
string|array
Details
at line 32
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 48
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 Gemini Interactions API.
at line 141
protected array
buildFunctionResultSteps(array $toolResults)
Build function result steps from tool results for the Gemini API.
at line 154
protected array
buildResponseSchema(array $schema)
Build the response schema for structured output.
at line 162
protected string|array
toolChoiceConfig(ToolChoice $choice)
Map a tool choice to the Gemini tool choice configuration.