From 98547a4394725a953f58656c4dc1800e2274023d Mon Sep 17 00:00:00 2001 From: Tobias Redmann Date: Mon, 13 Jan 2025 19:50:22 +0100 Subject: [PATCH] feat(responseType): added response type and response schema --- src/Data/GenerationConfig.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Data/GenerationConfig.php b/src/Data/GenerationConfig.php index 3032b53..75bd5d2 100644 --- a/src/Data/GenerationConfig.php +++ b/src/Data/GenerationConfig.php @@ -20,6 +20,8 @@ final class GenerationConfig implements Arrayable * @param float|null $temperature Controls the randomness of the output. * @param float|null $topP The maximum cumulative probability of tokens to consider when sampling. * @param int|null $topK The maximum number of tokens to consider when sampling. + * @param string|null $responseMimeType MIME type of the generated candidate text. + * @param object|null $responseSchema Output schema of the generated candidate text. */ public function __construct( public readonly int $candidateCount = 1, @@ -28,6 +30,8 @@ public function __construct( public readonly ?float $temperature = null, public readonly ?float $topP = null, public readonly ?int $topK = null, + public readonly ?string $responseMimeType = null, + public readonly ?object $responseSchema = null, ) {} public function toArray(): array @@ -39,6 +43,8 @@ public function toArray(): array 'temperature' => $this->temperature, 'topP' => $this->topP, 'topK' => $this->topK, + 'responseMimeType' => $this->responseMimeType, + 'responseSchema' => $this->responseSchema, ]; } }