@chinmaymk/aikit / GoogleOptions
Interface: GoogleOptions
Defined in: types.ts:598
Google-specific configuration and generation options. These can be provided at construction time or generation time. Generation time options will override construction time options.
Extends
Properties
model?
optionalmodel:string
Defined in: types.ts:305
The specific model you want to use. e.g., 'gpt-4o' or 'claude-3-5-sonnet-20240620'.
Inherited from
maxOutputTokens?
optionalmaxOutputTokens:number
Defined in: types.ts:307
The maximum number of output tokens to generate. Don't want it to ramble on forever, do you?
Inherited from
ProviderOptions.maxOutputTokens
temperature?
optionaltemperature:number
Defined in: types.ts:313
The sampling temperature. Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more focused and deterministic. A bit like adjusting the chaos knob.
Inherited from
topP?
optionaltopP:number
Defined in: types.ts:318
Top-p sampling. It's a way to control the randomness of the output by only considering the most likely tokens. It's like telling the AI to only pick from the top of the deck.
Inherited from
stopSequences?
optionalstopSequences:string[]
Defined in: types.ts:325
A list of sequences that will stop the generation. A safe word, if you will.
Inherited from
tools?
optionaltools:Tool[]
Defined in: types.ts:327
The list of tools you're making available to the model.
Inherited from
toolChoice?
optionaltoolChoice: {name:string; } |"auto"|"required"|"none"
Defined in: types.ts:335
How the model should choose which tool to use. 'auto': The model decides. 'required': The model must use a tool. 'none': The model can't use any tools. { name: 'my_tool' }: Force the model to use a specific tool.
Inherited from
apiKey?
optionalapiKey:string
Defined in: types.ts:344
API key for authentication with the provider.
Inherited from
baseURL?
optionalbaseURL:string
Defined in: types.ts:346
Custom base URL for the API endpoint.
Inherited from
timeout?
optionaltimeout:number
Defined in: types.ts:348
Request timeout in milliseconds.
Inherited from
maxRetries?
optionalmaxRetries:number
Defined in: types.ts:350
Maximum number of retry attempts for failed requests.
Inherited from
mutateHeaders()?
optionalmutateHeaders: (headers) =>void
Defined in: types.ts:356
A function that allows you to modify the headers before a request is sent. This is useful for adding custom headers or modifying existing ones.
Parameters
headers
Record<string, string>
The original headers object to mutate directly.
Returns
void
Inherited from
topK?
optionaltopK:number
Defined in: types.ts:603
Top-k sampling. See GenerationOptions for the details. It's here because Google supports it.
Overrides
candidateCount?
optionalcandidateCount:number
Defined in: types.ts:605
How many different responses to generate. More candidates, more problems.
presencePenalty?
optionalpresencePenalty:number
Defined in: types.ts:610
Presence penalty. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
frequencyPenalty?
optionalfrequencyPenalty:number
Defined in: types.ts:616
Frequency penalty. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
responseMimeType?
optionalresponseMimeType:"text/plain"|"application/json"
Defined in: types.ts:621
The MIME type of the generated candidate text. Supported values: 'text/plain' (default), 'application/json'
responseSchema?
optionalresponseSchema:Record<string,unknown>
Defined in: types.ts:626
Output schema of the generated candidate text when responseMimeType is set to 'application/json'. Schema must be a subset of the OpenAPI schema and can be objects, primitives or arrays.
seed?
optionalseed:number
Defined in: types.ts:631
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
responseLogprobs?
optionalresponseLogprobs:boolean
Defined in: types.ts:636
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
logprobs?
optionallogprobs:number
Defined in: types.ts:641
An integer between 1 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. responseLogprobs must be set to true if this parameter is used.
audioTimestamp?
optionalaudioTimestamp:boolean
Defined in: types.ts:646
Whether to include audio timestamp information in the response. Only applicable for audio generation models.
safetySettings?
optionalsafetySettings:object[]
Defined in: types.ts:651
Safety settings for content filtering. Configure safety thresholds for different harm categories.
category
category:
"HARM_CATEGORY_HARASSMENT"|"HARM_CATEGORY_HATE_SPEECH"|"HARM_CATEGORY_SEXUALLY_EXPLICIT"|"HARM_CATEGORY_DANGEROUS_CONTENT"|"HARM_CATEGORY_CIVIC_INTEGRITY"
The category of harmful content to filter
threshold
threshold:
"BLOCK_NONE"|"BLOCK_ONLY_HIGH"|"BLOCK_MEDIUM_AND_ABOVE"|"BLOCK_LOW_AND_ABOVE"
The threshold for blocking content