Skip to content

@chinmaymk/aikit v0.0.40


@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?

optional model: 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

ProviderOptions.model


maxOutputTokens?

optional maxOutputTokens: 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?

optional temperature: 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

ProviderOptions.temperature


topP?

optional topP: 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

ProviderOptions.topP


stopSequences?

optional stopSequences: string[]

Defined in: types.ts:325

A list of sequences that will stop the generation. A safe word, if you will.

Inherited from

ProviderOptions.stopSequences


tools?

optional tools: Tool[]

Defined in: types.ts:327

The list of tools you're making available to the model.

Inherited from

ProviderOptions.tools


toolChoice?

optional toolChoice: { 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

ProviderOptions.toolChoice


apiKey?

optional apiKey: string

Defined in: types.ts:344

API key for authentication with the provider.

Inherited from

ProviderOptions.apiKey


baseURL?

optional baseURL: string

Defined in: types.ts:346

Custom base URL for the API endpoint.

Inherited from

ProviderOptions.baseURL


timeout?

optional timeout: number

Defined in: types.ts:348

Request timeout in milliseconds.

Inherited from

ProviderOptions.timeout


maxRetries?

optional maxRetries: number

Defined in: types.ts:350

Maximum number of retry attempts for failed requests.

Inherited from

ProviderOptions.maxRetries


mutateHeaders()?

optional mutateHeaders: (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

ProviderOptions.mutateHeaders


topK?

optional topK: number

Defined in: types.ts:603

Top-k sampling. See GenerationOptions for the details. It's here because Google supports it.

Overrides

ProviderOptions.topK


candidateCount?

optional candidateCount: number

Defined in: types.ts:605

How many different responses to generate. More candidates, more problems.


presencePenalty?

optional presencePenalty: 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?

optional frequencyPenalty: 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?

optional responseMimeType: "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?

optional responseSchema: 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?

optional seed: 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?

optional responseLogprobs: 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?

optional logprobs: 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?

optional audioTimestamp: boolean

Defined in: types.ts:646

Whether to include audio timestamp information in the response. Only applicable for audio generation models.


safetySettings?

optional safetySettings: 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

Released under the MIT License.