Skip to content

Interface: GoogleLLMParams

@providerprotocol/ai


@providerprotocol/ai / google / GoogleLLMParams

Defined in: src/providers/google/types.ts:26

Provider-specific parameters for Google Gemini API requests.

These parameters are passed through to the Google generationConfig field and control model behavior such as output length, randomness, and sampling strategies. All fields are optional and will use Google’s defaults if omitted.

const params: GoogleLLMParams = {
maxOutputTokens: 2048,
temperature: 0.7,
topP: 0.9,
stopSequences: ['\n\n'],
};
const response = await model.complete({
messages: [...],
config: { apiKey: '...' },
params,
});

Google GenerationConfig docs

optional audioTimestamp: boolean

Defined in: src/providers/google/types.ts:95

Whether to include audio timestamps in response


optional cachedContent: string

Defined in: src/providers/google/types.ts:107

Cached content name to use for this request. Format: “cachedContents/{id}” as returned from cache creation. When set, the cached content is prepended to the request.


optional candidateCount: number

Defined in: src/providers/google/types.ts:43

Number of candidates to generate


optional frequencyPenalty: number

Defined in: src/providers/google/types.ts:74

Frequency penalty for repeated tokens Positive values discourage repetition


optional imageConfig: GoogleImageConfig

Defined in: src/providers/google/types.ts:62

Image generation configuration for Gemini image response modalities.


optional logprobs: number

Defined in: src/providers/google/types.ts:90

Number of log probabilities to return (requires responseLogprobs: true)


optional maxOutputTokens: number

Defined in: src/providers/google/types.ts:28

Maximum number of tokens to generate


optional presencePenalty: number

Defined in: src/providers/google/types.ts:68

Presence penalty for new topics Positive values encourage discussing new topics


optional responseLogprobs: boolean

Defined in: src/providers/google/types.ts:85

Whether to return log probabilities in response


optional responseMimeType: "application/json" | "text/plain"

Defined in: src/providers/google/types.ts:46

Response MIME type


optional responseModalities: GoogleResponseModality[]

Defined in: src/providers/google/types.ts:57

Modalities to generate in the response.

Use ['IMAGE'] or ['TEXT', 'IMAGE'] with Gemini image generation models (e.g., gemini-2.5-flash-image aka Nano Banana).


optional responseSchema: Record<string, unknown>

Defined in: src/providers/google/types.ts:49

Response schema for structured output


optional seed: number

Defined in: src/providers/google/types.ts:80

Seed for deterministic sampling Same seed with same parameters should produce same results


optional stopSequences: string[]

Defined in: src/providers/google/types.ts:40

Stop sequences


optional temperature: number

Defined in: src/providers/google/types.ts:31

Temperature for randomness (0.0 - 2.0)


optional thinkingConfig: GoogleThinkingConfig

Defined in: src/providers/google/types.ts:100

Thinking/reasoning configuration for Gemini 3+ models


optional toolConfig: GoogleToolConfig

Defined in: src/providers/google/types.ts:153

Tool configuration for retrieval (e.g., user location for Maps).

const params: GoogleLLMParams = {
tools: [tools.googleMaps()],
toolConfig: {
retrievalConfig: {
latLng: { latitude: 40.758896, longitude: -73.985130 },
},
},
};

optional tools: GoogleBuiltInTool[]

Defined in: src/providers/google/types.ts:136

Built-in tools for server-side execution.

Use the tool helper constructors from the tools namespace:

  • tools.googleSearch() - Google Search grounding
  • tools.codeExecution() - Python code execution
  • tools.urlContext() - URL fetching and analysis
  • tools.googleMaps() - Google Maps grounding
  • tools.fileSearch() - Document RAG search

Note: File Search cannot be combined with other built-in tools.

import { google, tools } from 'provider-protocol/google';
const model = llm({
model: google('gemini-2.5-flash'),
params: {
tools: [
tools.googleSearch(),
tools.codeExecution(),
],
},
});

optional topK: number

Defined in: src/providers/google/types.ts:37

Top-k sampling


optional topP: number

Defined in: src/providers/google/types.ts:34

Top-p (nucleus) sampling