From 8ec75462c8d29dd328a7a0beb7beb3b88b883cd4 Mon Sep 17 00:00:00 2001 From: Ben Bowler Date: Mon, 5 Aug 2024 13:44:53 +0100 Subject: [PATCH] Add responseMimeType to GenerationConfig. --- src/GenerationConfig.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GenerationConfig.php b/src/GenerationConfig.php index 6eeaca5..e6c7c0d 100644 --- a/src/GenerationConfig.php +++ b/src/GenerationConfig.php @@ -19,6 +19,7 @@ class GenerationConfig implements JsonSerializable * temperature?: float, * topP?: float, * topK?: int, + * responseMimeType?: string, * } */ private array $config; @@ -97,6 +98,11 @@ public function withTopK(int $topK): self return $clone; } + public function responseMimeType(string $mimeType): self + { + $clone = clone $this; + $clone->config['responseMimeType'] = $mimeType; + /** * @return array{ * candidateCount?: int, @@ -105,6 +111,7 @@ public function withTopK(int $topK): self * temperature?: float, * topP?: float, * topK?: int, + * responseMimeType?: string, * } */ public function jsonSerialize(): array