@langchain/google 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/chat_models/{api-types.d.ts → api_types/generate_content.d.cts} +198 -200
  3. package/dist/chat_models/{api-types.d.cts → api_types/generate_content.d.ts} +198 -200
  4. package/dist/chat_models/api_types/interactions.d.cts +1423 -0
  5. package/dist/chat_models/api_types/interactions.d.ts +1423 -0
  6. package/dist/chat_models/base.cjs +60 -403
  7. package/dist/chat_models/base.cjs.map +1 -1
  8. package/dist/chat_models/base.d.cts +13 -200
  9. package/dist/chat_models/base.d.ts +15 -202
  10. package/dist/chat_models/base.js +61 -402
  11. package/dist/chat_models/base.js.map +1 -1
  12. package/dist/chat_models/handlers/base.cjs +62 -0
  13. package/dist/chat_models/handlers/base.cjs.map +1 -0
  14. package/dist/chat_models/handlers/base.d.cts +46 -0
  15. package/dist/chat_models/handlers/base.d.ts +46 -0
  16. package/dist/chat_models/handlers/base.js +62 -0
  17. package/dist/chat_models/handlers/base.js.map +1 -0
  18. package/dist/chat_models/handlers/generate_content.cjs +344 -0
  19. package/dist/chat_models/handlers/generate_content.cjs.map +1 -0
  20. package/dist/chat_models/handlers/generate_content.d.cts +32 -0
  21. package/dist/chat_models/handlers/generate_content.d.ts +32 -0
  22. package/dist/chat_models/handlers/generate_content.js +344 -0
  23. package/dist/chat_models/handlers/generate_content.js.map +1 -0
  24. package/dist/chat_models/handlers/index.cjs +6 -0
  25. package/dist/chat_models/handlers/index.d.cts +4 -0
  26. package/dist/chat_models/handlers/index.d.ts +4 -0
  27. package/dist/chat_models/handlers/index.js +4 -0
  28. package/dist/chat_models/handlers/interactions.cjs +303 -0
  29. package/dist/chat_models/handlers/interactions.cjs.map +1 -0
  30. package/dist/chat_models/handlers/interactions.d.cts +33 -0
  31. package/dist/chat_models/handlers/interactions.d.ts +33 -0
  32. package/dist/chat_models/handlers/interactions.js +303 -0
  33. package/dist/chat_models/handlers/interactions.js.map +1 -0
  34. package/dist/chat_models/index.cjs +14 -6
  35. package/dist/chat_models/index.cjs.map +1 -1
  36. package/dist/chat_models/index.d.cts +7 -3
  37. package/dist/chat_models/index.d.ts +7 -3
  38. package/dist/chat_models/index.js +8 -4
  39. package/dist/chat_models/index.js.map +1 -1
  40. package/dist/chat_models/node.cjs +4 -5
  41. package/dist/chat_models/node.cjs.map +1 -1
  42. package/dist/chat_models/node.d.cts +1 -3
  43. package/dist/chat_models/node.d.ts +1 -3
  44. package/dist/chat_models/node.js +3 -4
  45. package/dist/chat_models/node.js.map +1 -1
  46. package/dist/chat_models/profiles.cjs +1 -2
  47. package/dist/chat_models/profiles.js +1 -2
  48. package/dist/chat_models/types.cjs +1 -2
  49. package/dist/chat_models/types.cjs.map +1 -1
  50. package/dist/chat_models/types.d.cts +776 -88
  51. package/dist/chat_models/types.d.ts +776 -88
  52. package/dist/chat_models/types.js +1 -2
  53. package/dist/chat_models/types.js.map +1 -1
  54. package/dist/clients/index.cjs +3 -4
  55. package/dist/clients/index.d.cts +0 -2
  56. package/dist/clients/index.d.ts +0 -2
  57. package/dist/clients/index.js +3 -4
  58. package/dist/clients/node.cjs +4 -5
  59. package/dist/clients/node.d.cts +0 -2
  60. package/dist/clients/node.d.ts +0 -2
  61. package/dist/clients/node.js +4 -5
  62. package/dist/const.cjs +1 -2
  63. package/dist/const.js +1 -2
  64. package/dist/converters/{messages.cjs → generate_content/messages.cjs} +4 -5
  65. package/dist/converters/generate_content/messages.cjs.map +1 -0
  66. package/dist/converters/{messages.js → generate_content/messages.js} +4 -5
  67. package/dist/converters/generate_content/messages.js.map +1 -0
  68. package/dist/converters/generate_content/params.cjs +135 -0
  69. package/dist/converters/generate_content/params.cjs.map +1 -0
  70. package/dist/converters/generate_content/params.js +131 -0
  71. package/dist/converters/generate_content/params.js.map +1 -0
  72. package/dist/{utils → converters/generate_content}/stream_events.cjs +2 -3
  73. package/dist/converters/generate_content/stream_events.cjs.map +1 -0
  74. package/dist/{utils → converters/generate_content}/stream_events.js +2 -3
  75. package/dist/converters/generate_content/stream_events.js.map +1 -0
  76. package/dist/converters/{tools.cjs → generate_content/tools.cjs} +4 -5
  77. package/dist/converters/generate_content/tools.cjs.map +1 -0
  78. package/dist/converters/{tools.js → generate_content/tools.js} +4 -5
  79. package/dist/converters/generate_content/tools.js.map +1 -0
  80. package/dist/converters/interactions/messages.cjs +766 -0
  81. package/dist/converters/interactions/messages.cjs.map +1 -0
  82. package/dist/converters/interactions/messages.js +759 -0
  83. package/dist/converters/interactions/messages.js.map +1 -0
  84. package/dist/converters/interactions/params.cjs +244 -0
  85. package/dist/converters/interactions/params.cjs.map +1 -0
  86. package/dist/converters/interactions/params.js +237 -0
  87. package/dist/converters/interactions/params.js.map +1 -0
  88. package/dist/converters/interactions/stream_events.cjs +769 -0
  89. package/dist/converters/interactions/stream_events.cjs.map +1 -0
  90. package/dist/converters/interactions/stream_events.js +768 -0
  91. package/dist/converters/interactions/stream_events.js.map +1 -0
  92. package/dist/converters/interactions/tools.cjs +229 -0
  93. package/dist/converters/interactions/tools.cjs.map +1 -0
  94. package/dist/converters/interactions/tools.js +228 -0
  95. package/dist/converters/interactions/tools.js.map +1 -0
  96. package/dist/converters/{params.cjs → shared/params.cjs} +8 -94
  97. package/dist/converters/shared/params.cjs.map +1 -0
  98. package/dist/converters/{params.js → shared/params.js} +8 -92
  99. package/dist/converters/shared/params.js.map +1 -0
  100. package/dist/index.cjs +8 -0
  101. package/dist/index.d.cts +6 -1
  102. package/dist/index.d.ts +6 -1
  103. package/dist/index.js +5 -1
  104. package/dist/node.cjs +1 -1
  105. package/dist/node.d.cts +1 -1
  106. package/dist/node.d.ts +1 -1
  107. package/dist/node.js +1 -1
  108. package/dist/utils/errors.cjs +1 -2
  109. package/dist/utils/errors.js +1 -2
  110. package/dist/utils/gcp-auth.cjs +3 -4
  111. package/dist/utils/gcp-auth.d.cts +0 -2
  112. package/dist/utils/gcp-auth.d.ts +0 -2
  113. package/dist/utils/gcp-auth.js +3 -4
  114. package/dist/utils/handler.cjs +1 -2
  115. package/dist/utils/handler.d.cts +0 -2
  116. package/dist/utils/handler.d.ts +0 -2
  117. package/dist/utils/handler.js +1 -2
  118. package/dist/utils/metadata.cjs +9 -2
  119. package/dist/utils/metadata.cjs.map +1 -1
  120. package/dist/utils/metadata.js +9 -3
  121. package/dist/utils/metadata.js.map +1 -1
  122. package/dist/utils/misc.cjs +1 -2
  123. package/dist/utils/misc.cjs.map +1 -1
  124. package/dist/utils/misc.d.cts +2 -3
  125. package/dist/utils/misc.d.ts +2 -3
  126. package/dist/utils/misc.js +1 -2
  127. package/dist/utils/misc.js.map +1 -1
  128. package/dist/utils/stream.cjs +1 -2
  129. package/dist/utils/stream.js +1 -2
  130. package/package.json +12 -10
  131. package/dist/converters/messages.cjs.map +0 -1
  132. package/dist/converters/messages.js.map +0 -1
  133. package/dist/converters/params.cjs.map +0 -1
  134. package/dist/converters/params.js.map +0 -1
  135. package/dist/converters/tools.cjs.map +0 -1
  136. package/dist/converters/tools.js.map +0 -1
  137. package/dist/utils/stream_events.cjs.map +0 -1
  138. package/dist/utils/stream_events.js.map +0 -1
@@ -1,9 +1,13 @@
1
+ import { ApiClient } from "../clients/index.js";
2
+ import { GenContent } from "./api_types/generate_content.js";
3
+ import { Interactions } from "./api_types/interactions.js";
1
4
  import { LowercaseLiteral, Prettify } from "../utils/misc.js";
2
- import { Gemini } from "./api-types.js";
3
- import { BindToolsInput } from "@langchain/core/language_models/chat_models";
5
+ import { GoogleChatApiHandler } from "./handlers/base.js";
6
+ import { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from "@langchain/core/language_models/chat_models";
4
7
  import { InteropZodType } from "@langchain/core/utils/types";
5
- //#region src/chat_models/types.d.ts
6
- export interface ChatGoogleFields {
8
+ import { SerializableSchema } from "@langchain/core/utils/standard_schema";
9
+ import { AsyncCaller } from "@langchain/core/utils/async_caller";
10
+ export interface BaseChatGoogleFields {
7
11
  /**
8
12
  * The temperature is used for sampling during response generation, which
9
13
  * occurs when topP and topK are applied. Temperature controls the degree of
@@ -65,155 +69,235 @@ export interface ChatGoogleFields {
65
69
  */
66
70
  seed?: number;
67
71
  /**
68
- * If true, returns the log probabilities of the tokens that were chosen by
69
- * the model at each step. By default, this parameter is set to false.
72
+ * A list of tools the model may use to generate the next response.
73
+ * Can be LangChain tools, OpenAI tools, or Gemini function declarations.
70
74
  */
71
- responseLogprobs?: boolean;
75
+ tools?: BindToolsInput[];
72
76
  /**
73
- * Returns the log probabilities of the top candidate tokens at each generation
74
- * step. The model's chosen token might not be the same as the top candidate
75
- * token at each step. Specify the number of candidates to return by using an
76
- * integer value in the range of 1-20.
77
+ * OpenAI-compatible alias for media input detail level.
78
+ *
79
+ * This is mapped to `generationConfig.mediaResolution`:
80
+ * - `"auto"` => default Gemini behavior (`mediaResolution` omitted)
81
+ * - `"low"` => `"MEDIA_RESOLUTION_LOW"`
82
+ * - `"high"` => `"MEDIA_RESOLUTION_HIGH"`
83
+ *
84
+ * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.
77
85
  */
78
- logprobs?: number;
86
+ detail?: "auto" | "low" | "high";
87
+ /**
88
+ * The number of reasoning tokens that the model should generate.
89
+ * If explicitly set, then the reasoning blocks will be returned.
90
+ */
91
+ maxReasoningTokens?: number;
92
+ /**
93
+ * An alias for `maxReasoningTokens` for compatibility.
94
+ */
95
+ thinkingBudget?: number;
96
+ /**
97
+ * An alias for `maxReasoningTokens` under Gemini 2.5 or
98
+ * the primary thinking/reasoning setting for Gemini 3.
99
+ * If explicitly set, then the reasoning blocks will be returned.
100
+ */
101
+ reasoningEffort?: Gemini.Shared.ThinkingLevel;
102
+ /**
103
+ * An alias for `reasoningEffort` for compatibility.
104
+ */
105
+ thinkingLevel?: Gemini.Shared.ThinkingLevel;
106
+ /**
107
+ * Custom / additional headers to include with every request to the API.
108
+ * When set on both constructor params and per-invocation call options,
109
+ * per-invocation headers take precidence for matching keys.
110
+ */
111
+ customHeaders?: Record<string, string>;
79
112
  /**
80
113
  * Per request settings for blocking unsafe content
81
114
  */
82
- safetySettings?: Prettify<Gemini.SafetySetting>[];
115
+ safetySettings?: Prettify<Gemini.Shared.SafetySetting>[];
83
116
  /**
84
- * Configuration for the model's thinking process
117
+ * Media resolution for input media processing.
118
+ *
119
+ * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like
120
+ * string value in the Gemini API.
85
121
  */
86
- thinkingConfig?: Prettify<Gemini.ThinkingConfig>;
122
+ mediaResolution?: Gemini.Shared.MediaResolution;
87
123
  /**
88
124
  * The schema that the generated response should match.
89
125
  * Can be a Zod schema or a JSON Schema object.
90
126
  * When set, the response will be structured according to this schema
91
127
  * and `responseMimeType` will automatically be set to "application/json".
92
128
  */
93
- responseSchema?: InteropZodType | Record<string, unknown>;
129
+ responseSchema?: InteropZodType | SerializableSchema | Record<string, unknown>;
94
130
  /**
95
- * A list of tools the model may use to generate the next response.
96
- * Can be LangChain tools, OpenAI tools, or Gemini function declarations.
131
+ * Desired MIME type of the generated candidate content.
97
132
  */
98
- tools?: BindToolsInput[];
133
+ responseMimeType?: string;
99
134
  /**
100
135
  * The requested modalities of the response.
101
136
  * Represents the set of modalities that the model can return.
102
137
  * An empty list is equivalent to requesting only text.
103
138
  */
104
- responseModalities?: Prettify<Gemini.GenerativeLanguageModality>[];
139
+ responseModalities?: Prettify<GenContent.GenerativeLanguageModality>[];
105
140
  /**
106
- * If true, enables enhanced civic answers feature.
141
+ * Configuration for the model's thinking process
107
142
  */
108
- enableEnhancedCivicAnswers?: boolean;
143
+ thinkingConfig?: Prettify<GenContent.ThinkingConfig>;
109
144
  /**
110
145
  * Speech generation configuration.
111
146
  * You can use either Google's definition of the speech configuration,
112
147
  * or a simplified version we've defined (which can be as simple
113
148
  * as the name of a pre-defined voice).
114
149
  */
115
- speechConfig?: Prettify<Gemini.SpeechConfig> | SimplifiedSpeechConfig;
150
+ speechConfig?: Prettify<GenContent.SpeechConfig> | SimplifiedSpeechConfig;
116
151
  /**
117
152
  * Configuration for image generation.
118
153
  */
119
- imageConfig?: Prettify<Gemini.ImageConfig>;
154
+ imageConfig?: Prettify<GenContent.ImageConfig>;
120
155
  /**
121
- * Media resolution for input media processing.
122
- *
123
- * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like
124
- * string value in the Gemini API.
156
+ * Inference service tiers.
157
+ * "priority" offers highest reliability for higher rates.
158
+ * "flex" offers a discount for preemptable processing.
159
+ * Other values are treated as the standard service tier.
125
160
  */
126
- mediaResolution?: Gemini.GenerationConfig["mediaResolution"];
161
+ serviceTier?: GenContent.ServiceTier;
162
+ }
163
+ export interface GenerateContentSpecificFields {
127
164
  /**
128
- * OpenAI-compatible alias for media input detail level.
129
- *
130
- * This is mapped to `generationConfig.mediaResolution`:
131
- * - `"auto"` => default Gemini behavior (`mediaResolution` omitted)
132
- * - `"low"` => `"MEDIA_RESOLUTION_LOW"`
133
- * - `"high"` => `"MEDIA_RESOLUTION_HIGH"`
134
- *
135
- * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.
165
+ * If true, returns the log probabilities of the tokens that were chosen by
166
+ * the model at each step. By default, this parameter is set to false.
136
167
  */
137
- detail?: "auto" | "low" | "high";
168
+ responseLogprobs?: boolean;
138
169
  /**
139
- * The number of reasoning tokens that the model should generate.
140
- * If explicitly set, then the reasoning blocks will be returned.
170
+ * Returns the log probabilities of the top candidate tokens at each generation
171
+ * step. The model's chosen token might not be the same as the top candidate
172
+ * token at each step. Specify the number of candidates to return by using an
173
+ * integer value in the range of 1-20.
141
174
  */
142
- maxReasoningTokens?: number;
175
+ logprobs?: number;
143
176
  /**
144
- * An alias for `maxReasoningTokens` for compatibility.
177
+ * If true, enables enhanced civic answers feature.
145
178
  */
146
- thinkingBudget?: number;
179
+ enableEnhancedCivicAnswers?: boolean;
180
+ }
181
+ export interface InteractionsSpecificFields {
147
182
  /**
148
- * An alias for `maxReasoningTokens` under Gemini 2.5 or
149
- * the primary thinking/reasoning setting for Gemini 3.
150
- * If explicitly set, then the reasoning blocks will be returned.
183
+ * Native Interactions API `response_format` configuration (JSON Schema or media response format).
184
+ * Note: `responseSchema`, `responseModalities`, `responseMimeType`, and `imageConfig` are also
185
+ * automatically translated into `response_format` when using the Interactions API.
151
186
  */
152
- reasoningEffort?: Gemini.ThinkingLevel;
187
+ responseFormat?: Gemini.Interactions.CreateInteractionParameters["response_format"];
153
188
  /**
154
- * An alias for `reasoningEffort` for compatibility.
189
+ * The ID of a previous interaction to continue a stateful server-side conversation.
155
190
  */
156
- thinkingLevel?: Gemini.ThinkingLevel;
191
+ previousInteractionId?: string;
157
192
  /**
158
- * Inference service tiers.
159
- * "priority" offers highest reliability for higher rates.
160
- * "flex" offers a discount for preemptable processing.
161
- * Other values are treated as the standard service tier.
193
+ * Whether to store the interaction on the server.
162
194
  */
163
- serviceTier?: Gemini.ServiceTier;
195
+ store?: boolean;
164
196
  /**
165
- * Custom / additional headers to include with every request to the API.
166
- * When set on both constructor params and per-invocation call options,
167
- * per-invocation headers take precidence for matching keys.
197
+ * Whether to execute the interaction in the background (primarily for agents).
168
198
  */
199
+ background?: boolean;
200
+ /**
201
+ * The name of the agent to use for the interaction (mutually exclusive with `model` in the raw API,
202
+ * or used when invoking an agent endpoint).
203
+ */
204
+ agent?: string;
205
+ /**
206
+ * Configuration parameters for the specified agent.
207
+ */
208
+ agentConfig?: Gemini.Interactions.AgentConfig;
209
+ /**
210
+ * Optional webhook configuration for receiving asynchronous interaction events.
211
+ */
212
+ webhookConfig?: Gemini.Interactions.WebhookConfig;
213
+ }
214
+ export interface GenerateContentFields extends BaseChatGoogleFields, GenerateContentSpecificFields {}
215
+ export interface InteractionsFields extends BaseChatGoogleFields, InteractionsSpecificFields {}
216
+ export interface ChatGoogleFields extends BaseChatGoogleFields, Partial<GenerateContentSpecificFields>, Partial<InteractionsSpecificFields> {}
217
+ export type GooglePlatformType = "gai" | "gcp";
218
+ export interface BaseChatGoogleParams extends BaseChatModelParams, ChatGoogleFields {
219
+ model: string;
220
+ apiClient?: ApiClient;
221
+ endpoint?: string;
222
+ location?: string;
223
+ apiVersion?: string;
224
+ platformType?: GooglePlatformType;
225
+ vertexai?: boolean;
226
+ streaming?: boolean;
227
+ streamUsage?: boolean;
228
+ apiHandler?: GoogleChatApiHandlerConfig;
229
+ }
230
+ export interface BaseChatGoogleCallOptions extends BaseChatModelCallOptions, ChatGoogleFields {
231
+ streamUsage?: boolean;
232
+ }
233
+ export interface GoogleChatApiHandlerParams extends BaseChatModelParams, BaseChatGoogleFields {
234
+ apiClient: ApiClient;
235
+ caller: AsyncCaller;
236
+ model: string;
237
+ platform: GooglePlatformType;
238
+ endpoint: string;
239
+ location: string;
240
+ apiVersion: string;
241
+ isVertexExpress: boolean;
242
+ publisher: string;
243
+ streaming: boolean;
244
+ streamUsage: boolean;
169
245
  customHeaders?: Record<string, string>;
170
246
  }
171
- declare module "./api-types.js" {
172
- namespace Gemini {
247
+ export interface GenerateContentApiHandlerParams extends GoogleChatApiHandlerParams, GenerateContentSpecificFields {}
248
+ export interface InteractionsApiHandlerParams extends GoogleChatApiHandlerParams, InteractionsSpecificFields {}
249
+ export type GoogleChatApiHandlerFactory = (params: GoogleChatApiHandlerParams) => GoogleChatApiHandler;
250
+ export type GoogleChatApiHandlerConfig = "generateContent" | "interactions" | GoogleChatApiHandlerFactory;
251
+ export type GenerateContentInvocationParams = Partial<Omit<GenContent.GenerateContentRequest, "contents">> & {
252
+ serviceTier?: GenContent.ServiceTier;
253
+ };
254
+ export type InteractionsInvocationParams = Partial<Omit<Gemini.Interactions.CreateInteractionParameters, "input">>;
255
+ declare module "./api_types/generate_content.js" {
256
+ namespace GenContent {
173
257
  namespace Part {
174
- type CodeExecutionResult = Pick<Gemini.Part, "codeExecutionResult">;
175
- type ExecutableCode = Pick<Gemini.Part, "executableCode">;
176
- type FileData = Pick<Gemini.Part, "fileData" | "videoMetadata">;
177
- type FunctionCall = Required<Pick<Gemini.Part, "functionCall">> & Pick<Gemini.Part, "thoughtSignature">;
178
- type FunctionResponse = Pick<Gemini.Part, "functionResponse">;
179
- type InlineData = Pick<Gemini.Part, "inlineData" | "videoMetadata">;
180
- type MediaResolution = Pick<Gemini.Part, "mediaResolution">;
181
- type PartMetadata = Pick<Gemini.Part, "partMetadata">;
182
- type Text = Pick<Gemini.Part, "text">;
183
- type Thought = Pick<Gemini.Part, "thought">;
184
- type ThoughtSignature = Pick<Gemini.Part, "thoughtSignature">;
258
+ type CodeExecutionResult = Pick<GenContent.Part, "codeExecutionResult">;
259
+ type ExecutableCode = Pick<GenContent.Part, "executableCode">;
260
+ type FileData = Pick<GenContent.Part, "fileData" | "videoMetadata">;
261
+ type FunctionCall = Required<Pick<GenContent.Part, "functionCall">> & Pick<GenContent.Part, "thoughtSignature">;
262
+ type FunctionResponse = Pick<GenContent.Part, "functionResponse">;
263
+ type InlineData = Pick<GenContent.Part, "inlineData" | "videoMetadata">;
264
+ type MediaResolution = Pick<GenContent.Part, "mediaResolution">;
265
+ type PartMetadata = Pick<GenContent.Part, "partMetadata">;
266
+ type Text = Pick<GenContent.Part, "text">;
267
+ type Thought = Pick<GenContent.Part, "thought">;
268
+ type ThoughtSignature = Pick<GenContent.Part, "thoughtSignature">;
185
269
  }
186
270
  namespace PrebuiltVoiceConfig {
187
271
  /**
188
272
  * The name of a prebuilt voice that can be used for speech synthesis.
189
273
  *
190
- * Extracted as a non-nullable type from the GeminiBase.PrebuiltVoiceConfig["voiceName"] property.
274
+ * Extracted as a non-nullable type from the PrebuiltVoiceConfig["voiceName"] property.
191
275
  */
192
- type VoiceName = NonNullable<Gemini.PrebuiltVoiceConfig["voiceName"]>;
276
+ type VoiceName = NonNullable<GenContent.PrebuiltVoiceConfig["voiceName"]>;
193
277
  }
194
278
  namespace SpeakerVoiceConfig {
195
279
  /**
196
280
  * The speaker identifier for a custom or multi-speaker TTS configuration.
197
281
  *
198
- * Extracted as a non-nullable type from the GeminiBase.SpeakerVoiceConfig["speaker"] property.
282
+ * Extracted as a non-nullable type from the SpeakerVoiceConfig["speaker"] property.
199
283
  */
200
- type Speaker = NonNullable<Gemini.SpeakerVoiceConfig["speaker"]>;
284
+ type Speaker = NonNullable<GenContent.SpeakerVoiceConfig["speaker"]>;
201
285
  }
202
286
  namespace SpeechConfig {
203
287
  /**
204
288
  * The BCP-47 language code for speech synthesis (e.g., "en-US").
205
289
  *
206
- * Extracted as a non-nullable type from the GeminiBase.SpeechConfig["languageCode"] property.
290
+ * Extracted as a non-nullable type from the SpeechConfig["languageCode"] property.
207
291
  */
208
- type LanguageCode = NonNullable<Gemini.SpeechConfig["languageCode"]>;
292
+ type LanguageCode = NonNullable<GenContent.SpeechConfig["languageCode"]>;
209
293
  }
210
294
  /**
211
295
  * The level of "thinking" or reasoning configured for the model.
212
296
  *
213
- * Extends GeminiBase.ThinkingConfig["thinkingLevel"] to also accept
297
+ * Extends ThinkingConfig["thinkingLevel"] to also accept
214
298
  * lowercase variants (e.g. "high" in addition to "HIGH").
215
299
  */
216
- type ThinkingLevel = Gemini.ThinkingConfig["thinkingLevel"] | LowercaseLiteral<Gemini.ThinkingConfig["thinkingLevel"]>;
300
+ type ThinkingLevel = GenContent.ThinkingConfig["thinkingLevel"] | LowercaseLiteral<GenContent.ThinkingConfig["thinkingLevel"]>;
217
301
  /**
218
302
  * The role of a content message. The spec types this as `string`, but
219
303
  * the API only accepts these specific values.
@@ -222,24 +306,24 @@ declare module "./api-types.js" {
222
306
  /**
223
307
  * Alias for the unwieldy generated grounding support type name.
224
308
  */
225
- type GroundingSupport = Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport;
309
+ type GroundingSupport = GenContent.GoogleAiGenerativelanguageV1betaGroundingSupport;
226
310
  /**
227
311
  * Alias for the unwieldy generated segment type name.
228
312
  */
229
- type Segment = Gemini.GoogleAiGenerativelanguageV1betaSegment;
313
+ type Segment = GenContent.GoogleAiGenerativelanguageV1betaSegment;
230
314
  namespace Tools {
231
315
  /**
232
316
  * The mode for function calling configuration, extracted from the
233
317
  * FunctionCallingConfig interface.
234
318
  */
235
- type FunctionCallingConfigMode = Gemini.Tools.FunctionCallingConfig["mode"];
319
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfig["mode"];
236
320
  }
237
321
  /**
238
322
  * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).
239
323
  * Not in the current OpenAPI spec but still returned by the API.
240
324
  */
241
325
  interface UrlRetrievalMetadata {
242
- urlRetrievalContexts?: Array<Gemini.UrlMetadata>;
326
+ urlRetrievalContexts?: Array<GenContent.UrlMetadata>;
243
327
  }
244
328
  interface Candidate {
245
329
  /** @deprecated Use urlContextMetadata instead. */
@@ -247,30 +331,634 @@ declare module "./api-types.js" {
247
331
  }
248
332
  }
249
333
  }
334
+ export declare namespace Gemini {
335
+ namespace Shared {
336
+ type HarmCategory = GenContent.HarmCategory;
337
+ type SafetySetting = GenContent.SafetySetting;
338
+ type MediaResolution = GenContent.GenerationConfig["mediaResolution"];
339
+ type ThinkingLevel = GenContent.ThinkingLevel;
340
+ }
341
+ namespace GenContent {
342
+ type Content = GenContent.Content;
343
+ type Candidate = GenContent.Candidate;
344
+ type GenerateContentRequest = GenContent.GenerateContentRequest;
345
+ type GenerateContentResponse = GenContent.GenerateContentResponse;
346
+ type GenerationConfig = GenContent.GenerationConfig;
347
+ type SafetyRating = GenContent.SafetyRating;
348
+ type SafetySetting = GenContent.SafetySetting;
349
+ type PromptFeedback = GenContent.PromptFeedback;
350
+ type Tool = GenContent.Tool;
351
+ type ThinkingConfig = GenContent.ThinkingConfig;
352
+ type ThinkingLevel = GenContent.ThinkingLevel;
353
+ type SpeechConfig = GenContent.SpeechConfig;
354
+ namespace SpeechConfig {
355
+ type LanguageCode = GenContent.SpeechConfig.LanguageCode;
356
+ }
357
+ type PrebuiltVoiceConfig = GenContent.PrebuiltVoiceConfig;
358
+ namespace PrebuiltVoiceConfig {
359
+ type VoiceName = GenContent.PrebuiltVoiceConfig.VoiceName;
360
+ }
361
+ type SpeakerVoiceConfig = GenContent.SpeakerVoiceConfig;
362
+ namespace SpeakerVoiceConfig {
363
+ type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
364
+ }
365
+ type ServiceTier = GenContent.ServiceTier;
366
+ type ImageConfig = GenContent.ImageConfig;
367
+ type Role = GenContent.Role;
368
+ type GroundingSupport = GenContent.GroundingSupport;
369
+ type GroundingMetadata = GenContent.GroundingMetadata;
370
+ type CitationMetadata = GenContent.CitationMetadata;
371
+ type UsageMetadata = GenContent.UsageMetadata;
372
+ type ModalityTokenCount = GenContent.ModalityTokenCount;
373
+ type Part = GenContent.Part;
374
+ namespace Part {
375
+ type CodeExecutionResult = GenContent.Part.CodeExecutionResult;
376
+ type ExecutableCode = GenContent.Part.ExecutableCode;
377
+ type FileData = GenContent.Part.FileData;
378
+ type FunctionCall = GenContent.Part.FunctionCall;
379
+ type FunctionResponse = GenContent.Part.FunctionResponse;
380
+ type InlineData = GenContent.Part.InlineData;
381
+ type MediaResolution = GenContent.Part.MediaResolution;
382
+ type PartMetadata = GenContent.Part.PartMetadata;
383
+ type Text = GenContent.Part.Text;
384
+ type Thought = GenContent.Part.Thought;
385
+ type ThoughtSignature = GenContent.Part.ThoughtSignature;
386
+ }
387
+ namespace Tools {
388
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfigMode;
389
+ type FunctionDeclaration = GenContent.Tools.FunctionDeclaration;
390
+ type GoogleSearch = GenContent.Tools.GoogleSearch;
391
+ type CodeExecution = GenContent.Tools.CodeExecution;
392
+ type UrlContext = GenContent.Tools.UrlContext;
393
+ type GoogleMaps = GenContent.Tools.GoogleMaps;
394
+ type FileSearch = GenContent.Tools.FileSearch;
395
+ type ComputerUse = GenContent.Tools.ComputerUse;
396
+ type FunctionCallingConfig = GenContent.Tools.FunctionCallingConfig;
397
+ type RetrievalConfig = GenContent.Tools.RetrievalConfig;
398
+ type ToolConfig = GenContent.Tools.ToolConfig;
399
+ type Schema = GenContent.Tools.Schema;
400
+ type LatLng = GenContent.Tools.LatLng;
401
+ type Interval = GenContent.Tools.Interval;
402
+ type SearchTypes = GenContent.Tools.SearchTypes;
403
+ type Type = GenContent.Tools.Type;
404
+ type WebSearch = GenContent.Tools.WebSearch;
405
+ type ImageSearch = GenContent.Tools.ImageSearch;
406
+ }
407
+ }
408
+ type Content = GenContent.Content;
409
+ type Candidate = GenContent.Candidate;
410
+ type GenerateContentRequest = GenContent.GenerateContentRequest;
411
+ type GenerateContentResponse = GenContent.GenerateContentResponse;
412
+ type GenerationConfig = GenContent.GenerationConfig;
413
+ type SafetyRating = GenContent.SafetyRating;
414
+ type SafetySetting = GenContent.SafetySetting;
415
+ type PromptFeedback = GenContent.PromptFeedback;
416
+ type Tool = GenContent.Tool;
417
+ type ThinkingConfig = GenContent.ThinkingConfig;
418
+ type ThinkingLevel = GenContent.ThinkingLevel;
419
+ type SpeechConfig = GenContent.SpeechConfig;
420
+ namespace SpeechConfig {
421
+ type LanguageCode = GenContent.SpeechConfig.LanguageCode;
422
+ }
423
+ type PrebuiltVoiceConfig = GenContent.PrebuiltVoiceConfig;
424
+ namespace PrebuiltVoiceConfig {
425
+ type VoiceName = GenContent.PrebuiltVoiceConfig.VoiceName;
426
+ }
427
+ type SpeakerVoiceConfig = GenContent.SpeakerVoiceConfig;
428
+ namespace SpeakerVoiceConfig {
429
+ type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
430
+ }
431
+ type ServiceTier = GenContent.ServiceTier;
432
+ type ImageConfig = GenContent.ImageConfig;
433
+ type Role = GenContent.Role;
434
+ type GroundingSupport = GenContent.GroundingSupport;
435
+ type GroundingMetadata = GenContent.GroundingMetadata;
436
+ type CitationMetadata = GenContent.CitationMetadata;
437
+ type UsageMetadata = GenContent.UsageMetadata;
438
+ type ModalityTokenCount = GenContent.ModalityTokenCount;
439
+ type Part = GenContent.Part;
440
+ namespace Part {
441
+ type CodeExecutionResult = GenContent.Part.CodeExecutionResult;
442
+ type ExecutableCode = GenContent.Part.ExecutableCode;
443
+ type FileData = GenContent.Part.FileData;
444
+ type FunctionCall = GenContent.Part.FunctionCall;
445
+ type FunctionResponse = GenContent.Part.FunctionResponse;
446
+ type InlineData = GenContent.Part.InlineData;
447
+ type MediaResolution = GenContent.Part.MediaResolution;
448
+ type PartMetadata = GenContent.Part.PartMetadata;
449
+ type Text = GenContent.Part.Text;
450
+ type Thought = GenContent.Part.Thought;
451
+ type ThoughtSignature = GenContent.Part.ThoughtSignature;
452
+ }
453
+ namespace Tools {
454
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfigMode;
455
+ type FunctionDeclaration = GenContent.Tools.FunctionDeclaration;
456
+ type GoogleSearch = GenContent.Tools.GoogleSearch;
457
+ type CodeExecution = GenContent.Tools.CodeExecution;
458
+ type UrlContext = GenContent.Tools.UrlContext;
459
+ type GoogleMaps = GenContent.Tools.GoogleMaps;
460
+ type FileSearch = GenContent.Tools.FileSearch;
461
+ type ComputerUse = GenContent.Tools.ComputerUse;
462
+ type FunctionCallingConfig = GenContent.Tools.FunctionCallingConfig;
463
+ type RetrievalConfig = GenContent.Tools.RetrievalConfig;
464
+ type ToolConfig = GenContent.Tools.ToolConfig;
465
+ type Schema = GenContent.Tools.Schema;
466
+ type LatLng = GenContent.Tools.LatLng;
467
+ type Interval = GenContent.Tools.Interval;
468
+ type SearchTypes = GenContent.Tools.SearchTypes;
469
+ type Type = GenContent.Tools.Type;
470
+ type WebSearch = GenContent.Tools.WebSearch;
471
+ type ImageSearch = GenContent.Tools.ImageSearch;
472
+ }
473
+ namespace Interactions {
474
+ type StaticMediaProcessing = Omit<Interactions.StaticMediaProcessing, "type"> & {
475
+ type: "static";
476
+ };
477
+ type MediaProcessing = StaticMediaProcessing;
478
+ type UrlCitation = Omit<Interactions.UrlCitation, "type"> & {
479
+ type: "url_citation";
480
+ };
481
+ type FileCitation = Omit<Interactions.FileCitation, "type"> & {
482
+ type: "file_citation";
483
+ };
484
+ type PlaceCitation = Omit<Interactions.PlaceCitation, "type"> & {
485
+ type: "place_citation";
486
+ };
487
+ type SpeechAnnotation = Omit<Interactions.SpeechAnnotation, "type"> & {
488
+ type: "speech_metadata";
489
+ };
490
+ type WordInfo = Omit<Interactions.WordInfo, "type"> & {
491
+ type: "word_info";
492
+ };
493
+ type Annotation = UrlCitation | FileCitation | PlaceCitation | SpeechAnnotation | WordInfo;
494
+ type TextContent = Omit<Interactions.TextContent, "type" | "annotations"> & {
495
+ type: "text";
496
+ annotations?: Array<Annotation>;
497
+ };
498
+ type ImageContent = Omit<Interactions.ImageContent, "type"> & {
499
+ type: "image";
500
+ };
501
+ type AudioContent = Omit<Interactions.AudioContent, "type"> & {
502
+ type: "audio";
503
+ };
504
+ type DocumentContent = Omit<Interactions.DocumentContent, "type"> & {
505
+ type: "document";
506
+ };
507
+ type VideoContent = Omit<Interactions.VideoContent, "type" | "processing"> & {
508
+ type: "video";
509
+ processing?: MediaProcessing | "static" | "agentic" | (string & {});
510
+ };
511
+ type Content = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent;
512
+ type UserInputStep = Omit<Interactions.UserInputStep, "type" | "content"> & {
513
+ type: "user_input";
514
+ content?: Array<Content> | string;
515
+ };
516
+ type ModelOutputStep = Omit<Interactions.ModelOutputStep, "type" | "content"> & {
517
+ type: "model_output";
518
+ content?: Array<Content> | string;
519
+ };
520
+ type ThoughtStep = Omit<Interactions.ThoughtStep, "type" | "summary"> & {
521
+ type: "thought";
522
+ summary?: Array<Content>;
523
+ };
524
+ type FunctionCallStep = Omit<Interactions.FunctionCallStep, "type"> & {
525
+ type: "function_call";
526
+ };
527
+ type FunctionResultStep = Omit<Interactions.FunctionResultStep, "type" | "result"> & {
528
+ type: "function_result";
529
+ result: Array<Content> | string | Record<string, unknown>;
530
+ };
531
+ type CodeExecutionCallStep = Omit<Interactions.CodeExecutionCallStep, "type"> & {
532
+ type: "code_execution_call";
533
+ };
534
+ type CodeExecutionResultStep = Omit<Interactions.CodeExecutionResultStep, "type"> & {
535
+ type: "code_execution_result";
536
+ };
537
+ type GoogleSearchCallStep = Omit<Interactions.GoogleSearchCallStep, "type"> & {
538
+ type: "google_search_call";
539
+ };
540
+ type GoogleSearchResultStep = Omit<Interactions.GoogleSearchResultStep, "type"> & {
541
+ type: "google_search_result";
542
+ };
543
+ type UrlContextCallStep = Omit<Interactions.UrlContextCallStep, "type"> & {
544
+ type: "url_context_call";
545
+ };
546
+ type UrlContextResultStep = Omit<Interactions.UrlContextResultStep, "type"> & {
547
+ type: "url_context_result";
548
+ };
549
+ type FileSearchCallStep = Omit<Interactions.FileSearchCallStep, "type"> & {
550
+ type: "file_search_call";
551
+ };
552
+ type FileSearchResultStep = Omit<Interactions.FileSearchResultStep, "type"> & {
553
+ type: "file_search_result";
554
+ result?: Array<FileSearchResultItem>;
555
+ };
556
+ type GoogleMapsCallStep = Omit<Interactions.GoogleMapsCallStep, "type"> & {
557
+ type: "google_maps_call";
558
+ };
559
+ type GoogleMapsResultStep = Omit<Interactions.GoogleMapsResultStep, "type"> & {
560
+ type: "google_maps_result";
561
+ };
562
+ type McpServerToolCallStep = Omit<Interactions.McpServerToolCallStep, "type"> & {
563
+ type: "mcp_server_tool_call";
564
+ };
565
+ type McpServerToolResultStep = Omit<Interactions.McpServerToolResultStep, "type" | "result"> & {
566
+ type: "mcp_server_tool_result";
567
+ result: Array<Content> | string | Record<string, unknown>;
568
+ };
569
+ type ProcessingCallStep = Omit<Interactions.ProcessingCallStep, "type"> & {
570
+ type: "processing_call";
571
+ };
572
+ type ProcessingResultStep = Omit<Interactions.ProcessingResultStep, "type"> & {
573
+ type: "processing_result";
574
+ };
575
+ type RetrievalCallStep = Omit<Interactions.RetrievalCallStep, "type"> & {
576
+ type: "retrieval_call";
577
+ };
578
+ type RetrievalResultStep = Omit<Interactions.RetrievalResultStep, "type"> & {
579
+ type: "retrieval_result";
580
+ };
581
+ type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | FunctionResultStep | CodeExecutionCallStep | CodeExecutionResultStep | GoogleSearchCallStep | GoogleSearchResultStep | UrlContextCallStep | UrlContextResultStep | FileSearchCallStep | FileSearchResultStep | GoogleMapsCallStep | GoogleMapsResultStep | McpServerToolCallStep | McpServerToolResultStep | ProcessingCallStep | ProcessingResultStep | RetrievalCallStep | RetrievalResultStep;
582
+ type Function = Omit<Interactions.Tools.Function, "type"> & {
583
+ type: "function";
584
+ };
585
+ type GoogleSearch = Omit<Interactions.Tools.GoogleSearch, "type"> & {
586
+ type: "google_search";
587
+ time_range_filter?: {
588
+ start_time?: string;
589
+ end_time?: string;
590
+ };
591
+ };
592
+ type CodeExecution = Omit<Interactions.Tools.CodeExecution, "type"> & {
593
+ type: "code_execution";
594
+ };
595
+ type UrlContext = Omit<Interactions.Tools.UrlContext, "type"> & {
596
+ type: "url_context";
597
+ };
598
+ type ComputerUse = Omit<Interactions.Tools.ComputerUse, "type"> & {
599
+ type: "computer_use";
600
+ };
601
+ type FileSearch = Omit<Interactions.Tools.FileSearch, "type"> & {
602
+ type: "file_search";
603
+ };
604
+ type GoogleMaps = Omit<Interactions.Tools.GoogleMaps, "type"> & {
605
+ type: "google_maps";
606
+ };
607
+ type McpServer = Omit<Interactions.Tools.McpServer, "type"> & {
608
+ type: "mcp_server";
609
+ };
610
+ type Retrieval = Omit<Interactions.Tools.Retrieval, "type"> & {
611
+ type: "retrieval";
612
+ };
613
+ type Tool = Function | GoogleSearch | CodeExecution | UrlContext | ComputerUse | FileSearch | GoogleMaps | McpServer | Retrieval;
614
+ namespace Tools {
615
+ type AllowedTools = Interactions.Tools.AllowedTools;
616
+ type CodeExecution = Gemini.Interactions.CodeExecution;
617
+ type ComputerUse = Gemini.Interactions.ComputerUse;
618
+ type FileSearch = Gemini.Interactions.FileSearch;
619
+ type Function = Gemini.Interactions.Function;
620
+ type GoogleMaps = Gemini.Interactions.GoogleMaps;
621
+ type GoogleSearch = Gemini.Interactions.GoogleSearch;
622
+ type McpServer = Gemini.Interactions.McpServer;
623
+ type Retrieval = Gemini.Interactions.Retrieval;
624
+ type Tool = Gemini.Interactions.Tool;
625
+ type UrlContext = Gemini.Interactions.UrlContext;
626
+ type VertexAISearchConfig = Interactions.Tools.VertexAISearchConfig;
627
+ }
628
+ type TextResponseFormat = Omit<Interactions.TextResponseFormat, "type"> & {
629
+ type: "text";
630
+ };
631
+ type ImageResponseFormat = Omit<Interactions.ImageResponseFormat, "type"> & {
632
+ type: "image";
633
+ };
634
+ type AudioResponseFormat = Omit<Interactions.AudioResponseFormat, "type"> & {
635
+ type: "audio";
636
+ };
637
+ type VideoResponseFormat = Omit<Interactions.VideoResponseFormat, "type"> & {
638
+ type: "video";
639
+ mime_type?: string;
640
+ };
641
+ type ResponseFormat = TextResponseFormat | ImageResponseFormat | AudioResponseFormat | VideoResponseFormat;
642
+ type AntigravityAgentConfig = Omit<Interactions.AntigravityAgentConfig, "type"> & {
643
+ type: "antigravity";
644
+ };
645
+ type CodeMenderAgentConfig = Omit<Interactions.CodeMenderAgentConfig, "type"> & {
646
+ type: "code-mender";
647
+ };
648
+ type DeepResearchAgentConfig = Omit<Interactions.DeepResearchAgentConfig, "type"> & {
649
+ type: "deep-research";
650
+ };
651
+ type DynamicAgentConfig = Omit<Interactions.DynamicAgentConfig, "type"> & {
652
+ type: "dynamic";
653
+ };
654
+ type AgentConfig = AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig;
655
+ type CreateInteractionParameters = Omit<Interactions.Interaction, "agent_config" | "created" | "environment_id" | "errors" | "generation_config" | "id" | "input" | "model" | "response_format" | "status" | "steps" | "tools" | "updated" | "usage"> & {
656
+ model?: Interactions.ModelOption;
657
+ agent?: Interactions.AgentOption;
658
+ agent_config?: AgentConfig;
659
+ generation_config?: GenerationConfig;
660
+ input: Array<Content> | Array<Step> | Content | Step | string;
661
+ response_format?: Record<string, unknown> | ResponseFormat | Array<ResponseFormat>;
662
+ tools?: Array<Tool>;
663
+ };
664
+ type Interaction = Omit<Interactions.Interaction, "agent_config" | "generation_config" | "input" | "model" | "response_format" | "steps" | "tools"> & {
665
+ model?: Interactions.ModelOption;
666
+ agent?: Interactions.AgentOption;
667
+ agent_config?: AgentConfig;
668
+ generation_config?: GenerationConfig;
669
+ input?: Array<Content> | Array<Step> | Content | Step | string;
670
+ response_format?: Record<string, unknown> | ResponseFormat | Array<ResponseFormat>;
671
+ role?: string;
672
+ steps?: Array<Step>;
673
+ outputs?: Array<Step | Content>;
674
+ tools?: Array<Tool>;
675
+ };
676
+ type AllowedTools = Interactions.Tools.AllowedTools;
677
+ type CodeExecutionCallStepArguments = Interactions.CodeExecutionCallStepArguments;
678
+ type Error = Interactions.Status;
679
+ type Status = Interactions.Status;
680
+ interface FileSearchResultItem {
681
+ title?: string;
682
+ text?: string;
683
+ file_search_store?: string;
684
+ }
685
+ type GenerationConfig = Omit<Interactions.GenerationConfig, "image_config"> & {
686
+ top_k?: number;
687
+ presence_penalty?: number;
688
+ frequency_penalty?: number;
689
+ response_logprobs?: boolean;
690
+ logprobs?: number;
691
+ image_config?: Interactions.ImageConfig & {
692
+ type?: "image";
693
+ };
694
+ };
695
+ type GoogleMapsCallStepArguments = Interactions.GoogleMapsCallStepArguments;
696
+ type GoogleMapsCallArguments = Interactions.GoogleMapsCallStepArguments;
697
+ type GoogleMapsResultItem = Interactions.GoogleMapsResultItem;
698
+ type GoogleMapsResult = Interactions.GoogleMapsResultItem;
699
+ type GoogleMapsResultPlaces = Interactions.GoogleMapsResultPlaces;
700
+ type GoogleSearchCallStepArguments = Interactions.GoogleSearchCallStepArguments;
701
+ type GoogleSearchResultItem = Interactions.GoogleSearchResultItem;
702
+ type HarmCategory = Interactions.HarmCategory;
703
+ type MediaResolution = Interactions.MediaResolution;
704
+ type ModalityTokens = Interactions.ModalityTokens;
705
+ type Model = Interactions.ModelOption;
706
+ type ModelOption = Interactions.ModelOption;
707
+ type ResponseModality = Interactions.ResponseModality;
708
+ type ReviewSnippet = Interactions.ReviewSnippet;
709
+ type PlaceCitationReviewSnippet = Interactions.ReviewSnippet;
710
+ type RetrievalStepArguments = Interactions.RetrievalStepArguments;
711
+ type RetrievalCallArguments = Interactions.RetrievalStepArguments;
712
+ type SafetySetting = Interactions.SafetySetting;
713
+ type ServiceTier = Interactions.ServiceTier;
714
+ type SpeakerConfig = Interactions.SpeakerConfig;
715
+ type SpeechConfig = Interactions.SpeechConfig;
716
+ type ThinkingLevel = Interactions.ThinkingLevel;
717
+ type ToolChoiceType = "auto" | "any" | "none" | "validated" | (string & {});
718
+ type ToolChoiceConfig = Interactions.ToolChoiceConfig;
719
+ type ToolChoice = ToolChoiceType | ToolChoiceConfig;
720
+ type UrlContextCallStepArguments = Interactions.UrlContextCallArguments;
721
+ type UrlContextCallArguments = Interactions.UrlContextCallArguments;
722
+ type UrlContextResultItem = Interactions.UrlContextResult;
723
+ type UrlContextResult = Interactions.UrlContextResult;
724
+ type Usage = Interactions.Usage;
725
+ type VertexAISearchConfig = Interactions.Tools.VertexAISearchConfig;
726
+ type VertexAiSearchConfig = Interactions.Tools.VertexAISearchConfig;
727
+ type WebhookConfig = Interactions.WebhookConfig;
728
+ type InteractionSseEventInteraction = Omit<Interaction, "steps" | "outputs"> & {
729
+ steps?: Array<Step>;
730
+ outputs?: Array<Step | Content>;
731
+ };
732
+ interface TextDelta {
733
+ type: "text";
734
+ text: string;
735
+ }
736
+ interface TextAnnotationDelta {
737
+ type: "text_annotation_delta" | "text_annotation";
738
+ annotations?: Array<Annotation>;
739
+ }
740
+ interface ImageDelta {
741
+ type: "image";
742
+ data?: string;
743
+ mime_type?: ImageContent["mime_type"];
744
+ resolution?: MediaResolution;
745
+ uri?: string;
746
+ }
747
+ interface AudioDelta {
748
+ type: "audio";
749
+ channels?: number;
750
+ data?: string;
751
+ mime_type?: AudioContent["mime_type"];
752
+ rate?: number;
753
+ sample_rate?: number;
754
+ uri?: string;
755
+ }
756
+ interface DocumentDelta {
757
+ type: "document";
758
+ data?: string;
759
+ mime_type?: DocumentContent["mime_type"];
760
+ uri?: string;
761
+ }
762
+ interface VideoDelta {
763
+ type: "video";
764
+ data?: string;
765
+ mime_type?: VideoContent["mime_type"];
766
+ resolution?: MediaResolution;
767
+ uri?: string;
768
+ }
769
+ interface ThoughtSummaryDelta {
770
+ type: "thought_summary";
771
+ content?: Content;
772
+ }
773
+ interface ThoughtSignatureDelta {
774
+ type: "thought_signature";
775
+ signature?: string;
776
+ }
777
+ interface ArgumentsDelta {
778
+ type: "arguments_delta" | "function_call";
779
+ id?: string;
780
+ name?: string;
781
+ arguments?: string | Record<string, unknown>;
782
+ }
783
+ interface CodeExecutionCallDelta {
784
+ type: "code_execution_call";
785
+ id?: string;
786
+ arguments?: CodeExecutionCallStepArguments;
787
+ signature?: string;
788
+ }
789
+ interface CodeExecutionResultDelta {
790
+ type: "code_execution_result";
791
+ call_id?: string;
792
+ is_error?: boolean;
793
+ result?: string;
794
+ signature?: string;
795
+ }
796
+ interface GoogleSearchCallDelta {
797
+ type: "google_search_call";
798
+ id?: string;
799
+ arguments?: GoogleSearchCallStepArguments;
800
+ signature?: string;
801
+ }
802
+ interface GoogleSearchResultDelta {
803
+ type: "google_search_result";
804
+ call_id?: string;
805
+ is_error?: boolean;
806
+ result?: Array<GoogleSearchResultItem & {
807
+ title?: string;
808
+ url?: string;
809
+ rendered_content?: string;
810
+ }>;
811
+ signature?: string;
812
+ }
813
+ interface UrlContextCallDelta {
814
+ type: "url_context_call";
815
+ id?: string;
816
+ arguments?: UrlContextCallArguments;
817
+ signature?: string;
818
+ }
819
+ interface UrlContextResultDelta {
820
+ type: "url_context_result";
821
+ call_id?: string;
822
+ is_error?: boolean;
823
+ result?: Array<UrlContextResult>;
824
+ signature?: string;
825
+ }
826
+ interface FileSearchCallDelta {
827
+ type: "file_search_call";
828
+ id?: string;
829
+ signature?: string;
830
+ }
831
+ interface FileSearchResultDelta {
832
+ type: "file_search_result";
833
+ call_id?: string;
834
+ result?: Array<FileSearchResultItem>;
835
+ signature?: string;
836
+ }
837
+ interface GoogleMapsCallDelta {
838
+ type: "google_maps_call";
839
+ id?: string;
840
+ arguments?: GoogleMapsCallArguments;
841
+ signature?: string;
842
+ }
843
+ interface GoogleMapsResultDelta {
844
+ type: "google_maps_result";
845
+ call_id?: string;
846
+ result?: Array<GoogleMapsResult>;
847
+ signature?: string;
848
+ }
849
+ interface McpServerToolCallDelta {
850
+ type: "mcp_server_tool_call";
851
+ id?: string;
852
+ name?: string;
853
+ server_name?: string;
854
+ arguments?: string | Record<string, unknown>;
855
+ signature?: string;
856
+ }
857
+ interface McpServerToolResultDelta {
858
+ type: "mcp_server_tool_result";
859
+ call_id?: string;
860
+ name?: string;
861
+ server_name?: string;
862
+ result?: Array<Content> | string | Record<string, unknown>;
863
+ signature?: string;
864
+ }
865
+ interface ProcessingCallDelta {
866
+ type: "processing_call";
867
+ id?: string;
868
+ signature?: string;
869
+ }
870
+ interface ProcessingResultDelta {
871
+ type: "processing_result";
872
+ call_id?: string;
873
+ signature?: string;
874
+ }
875
+ interface RetrievalCallDelta {
876
+ type: "retrieval_call";
877
+ id?: string;
878
+ arguments?: RetrievalCallArguments;
879
+ retrieval_type?: RetrievalCallStep["retrieval_type"];
880
+ signature?: string;
881
+ }
882
+ interface RetrievalResultDelta {
883
+ type: "retrieval_result";
884
+ call_id?: string;
885
+ is_error?: boolean;
886
+ signature?: string;
887
+ }
888
+ type StepDeltaData = TextDelta | TextAnnotationDelta | ImageDelta | AudioDelta | DocumentDelta | VideoDelta | ThoughtSummaryDelta | ThoughtSignatureDelta | ArgumentsDelta | CodeExecutionCallDelta | CodeExecutionResultDelta | GoogleSearchCallDelta | GoogleSearchResultDelta | UrlContextCallDelta | UrlContextResultDelta | FileSearchCallDelta | FileSearchResultDelta | GoogleMapsCallDelta | GoogleMapsResultDelta | McpServerToolCallDelta | McpServerToolResultDelta | ProcessingCallDelta | ProcessingResultDelta | RetrievalCallDelta | RetrievalResultDelta;
889
+ interface InteractionCreatedEvent {
890
+ event_id?: string;
891
+ event_type: "interaction.created" | "interaction.start";
892
+ interaction: InteractionSseEventInteraction;
893
+ }
894
+ interface InteractionCompletedEvent {
895
+ event_id?: string;
896
+ event_type: "interaction.completed" | "interaction.complete";
897
+ interaction: InteractionSseEventInteraction;
898
+ }
899
+ interface InteractionStatusUpdate {
900
+ continuation_token?: string;
901
+ event_id?: string;
902
+ event_type: "interaction.status_update";
903
+ interaction_id: string;
904
+ status: Interaction["status"];
905
+ usage?: Usage;
906
+ }
907
+ interface StepStart {
908
+ event_id?: string;
909
+ event_type: "step.start" | "content.start";
910
+ index: number;
911
+ step?: Step;
912
+ content?: Step | Content;
913
+ }
914
+ interface StepDelta {
915
+ delta: StepDeltaData;
916
+ event_id?: string;
917
+ event_type: "step.delta" | "content.delta";
918
+ index: number;
919
+ metadata?: {
920
+ total_usage?: Usage;
921
+ };
922
+ }
923
+ interface StepStop {
924
+ event_id?: string;
925
+ event_type: "step.stop" | "content.stop";
926
+ index: number;
927
+ step_usage?: Usage;
928
+ usage?: Usage;
929
+ }
930
+ interface ErrorEvent {
931
+ error?: Error;
932
+ event_id?: string;
933
+ event_type: "error";
934
+ }
935
+ type InteractionSseEvent = InteractionCreatedEvent | InteractionCompletedEvent | InteractionStatusUpdate | StepStart | StepDelta | StepStop | ErrorEvent;
936
+ }
937
+ }
250
938
  /**
251
939
  * Simplified speaker/name pair for multi-speaker config.
252
940
  * - `speaker` derived from SpeakerVoiceConfig["speaker"]
253
941
  * - `name` is the prebuilt voice name
254
942
  */
255
943
  export interface SpeechSpeakerName {
256
- speaker: Gemini.SpeakerVoiceConfig.Speaker;
257
- name: Gemini.PrebuiltVoiceConfig.VoiceName;
944
+ speaker: Gemini.GenContent.SpeakerVoiceConfig.Speaker;
945
+ name: Gemini.GenContent.PrebuiltVoiceConfig.VoiceName;
258
946
  }
259
947
  /** A voice can be a prebuilt voice name, a speaker/name pair, or an array of pairs */
260
- export type SpeechVoice = Gemini.PrebuiltVoiceConfig.VoiceName | SpeechSpeakerName | SpeechSpeakerName[];
948
+ export type SpeechVoice = Gemini.GenContent.PrebuiltVoiceConfig.VoiceName | SpeechSpeakerName | SpeechSpeakerName[];
261
949
  /** Voice with language code (derived from SpeechConfig's languageCode) */
262
950
  export interface SpeechVoiceLanguage {
263
951
  voice: SpeechVoice;
264
- languageCode: Gemini.SpeechConfig.LanguageCode;
952
+ languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;
265
953
  }
266
954
  /** Voices with language code */
267
955
  export interface SpeechVoicesLanguage {
268
956
  voices: SpeechVoice;
269
- languageCode: Gemini.SpeechConfig.LanguageCode;
957
+ languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;
270
958
  }
271
959
  /** Simplified language config (with voice or voices) */
272
960
  export type SimplifiedSpeechLanguageConfig = SpeechVoiceLanguage | SpeechVoicesLanguage;
273
961
  /** Top-level simplified config: just a voice, or voice+language */
274
962
  export type SimplifiedSpeechConfig = SpeechVoice | SimplifiedSpeechLanguageConfig;
275
- //#endregion
963
+ export type { GenContent, Interactions };
276
964
  //# sourceMappingURL=types.d.ts.map