Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(responseType): added response type and response schema #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Data/GenerationConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -39,6 +43,8 @@ public function toArray(): array
'temperature' => $this->temperature,
'topP' => $this->topP,
'topK' => $this->topK,
'responseMimeType' => $this->responseMimeType,
'responseSchema' => $this->responseSchema,
];
}
}