@langchain/google 0.2.10 → 0.2.12

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 (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/chat_models/{api-types.d.ts → api_types/generate_content.d.cts} +199 -199
  3. package/dist/chat_models/{api-types.d.cts → api_types/generate_content.d.ts} +199 -199
  4. package/dist/chat_models/base.cjs +53 -383
  5. package/dist/chat_models/base.cjs.map +1 -1
  6. package/dist/chat_models/base.d.cts +13 -198
  7. package/dist/chat_models/base.d.ts +15 -200
  8. package/dist/chat_models/base.js +55 -383
  9. package/dist/chat_models/base.js.map +1 -1
  10. package/dist/chat_models/handlers/base.cjs +63 -0
  11. package/dist/chat_models/handlers/base.cjs.map +1 -0
  12. package/dist/chat_models/handlers/base.d.cts +48 -0
  13. package/dist/chat_models/handlers/base.d.ts +48 -0
  14. package/dist/chat_models/handlers/base.js +63 -0
  15. package/dist/chat_models/handlers/base.js.map +1 -0
  16. package/dist/chat_models/handlers/generate_content.cjs +345 -0
  17. package/dist/chat_models/handlers/generate_content.cjs.map +1 -0
  18. package/dist/chat_models/handlers/generate_content.d.cts +34 -0
  19. package/dist/chat_models/handlers/generate_content.d.ts +34 -0
  20. package/dist/chat_models/handlers/generate_content.js +345 -0
  21. package/dist/chat_models/handlers/generate_content.js.map +1 -0
  22. package/dist/chat_models/handlers/index.cjs +4 -0
  23. package/dist/chat_models/handlers/index.d.cts +3 -0
  24. package/dist/chat_models/handlers/index.d.ts +3 -0
  25. package/dist/chat_models/handlers/index.js +3 -0
  26. package/dist/chat_models/index.cjs +11 -4
  27. package/dist/chat_models/index.cjs.map +1 -1
  28. package/dist/chat_models/index.d.cts +6 -1
  29. package/dist/chat_models/index.d.ts +6 -1
  30. package/dist/chat_models/index.js +6 -2
  31. package/dist/chat_models/index.js.map +1 -1
  32. package/dist/chat_models/node.cjs +2 -2
  33. package/dist/chat_models/node.cjs.map +1 -1
  34. package/dist/chat_models/node.js +2 -2
  35. package/dist/chat_models/node.js.map +1 -1
  36. package/dist/chat_models/profiles.cjs +14 -0
  37. package/dist/chat_models/profiles.cjs.map +1 -1
  38. package/dist/chat_models/profiles.js +14 -0
  39. package/dist/chat_models/profiles.js.map +1 -1
  40. package/dist/chat_models/types.cjs.map +1 -1
  41. package/dist/chat_models/types.d.cts +281 -94
  42. package/dist/chat_models/types.d.ts +281 -94
  43. package/dist/chat_models/types.js.map +1 -1
  44. package/dist/converters/{messages.cjs → generate_content/messages.cjs} +4 -4
  45. package/dist/converters/generate_content/messages.cjs.map +1 -0
  46. package/dist/converters/{messages.js → generate_content/messages.js} +4 -4
  47. package/dist/converters/generate_content/messages.js.map +1 -0
  48. package/dist/converters/generate_content/params.cjs +136 -0
  49. package/dist/converters/generate_content/params.cjs.map +1 -0
  50. package/dist/converters/generate_content/params.js +132 -0
  51. package/dist/converters/generate_content/params.js.map +1 -0
  52. package/dist/{utils → converters/generate_content}/stream_events.cjs +2 -2
  53. package/dist/converters/generate_content/stream_events.cjs.map +1 -0
  54. package/dist/{utils → converters/generate_content}/stream_events.js +2 -2
  55. package/dist/converters/generate_content/stream_events.js.map +1 -0
  56. package/dist/converters/{tools.cjs → generate_content/tools.cjs} +4 -4
  57. package/dist/converters/generate_content/tools.cjs.map +1 -0
  58. package/dist/converters/{tools.js → generate_content/tools.js} +4 -4
  59. package/dist/converters/generate_content/tools.js.map +1 -0
  60. package/dist/converters/{params.cjs → shared/params.cjs} +16 -93
  61. package/dist/converters/shared/params.cjs.map +1 -0
  62. package/dist/converters/{params.js → shared/params.js} +15 -91
  63. package/dist/converters/shared/params.js.map +1 -0
  64. package/dist/index.cjs +6 -0
  65. package/dist/index.d.cts +5 -1
  66. package/dist/index.d.ts +5 -1
  67. package/dist/index.js +4 -1
  68. package/dist/utils/metadata.cjs +8 -0
  69. package/dist/utils/metadata.cjs.map +1 -1
  70. package/dist/utils/metadata.js +8 -1
  71. package/dist/utils/metadata.js.map +1 -1
  72. package/dist/utils/misc.cjs.map +1 -1
  73. package/dist/utils/misc.d.cts +2 -1
  74. package/dist/utils/misc.d.ts +2 -1
  75. package/dist/utils/misc.js.map +1 -1
  76. package/package.json +4 -4
  77. package/dist/converters/messages.cjs.map +0 -1
  78. package/dist/converters/messages.js.map +0 -1
  79. package/dist/converters/params.cjs.map +0 -1
  80. package/dist/converters/params.js.map +0 -1
  81. package/dist/converters/tools.cjs.map +0 -1
  82. package/dist/converters/tools.js.map +0 -1
  83. package/dist/utils/stream_events.cjs.map +0 -1
  84. package/dist/utils/stream_events.js.map +0 -1
@@ -1,9 +1,13 @@
1
+ import { ApiClient } from "../clients/index.cjs";
2
+ import { GenContent } from "./api_types/generate_content.cjs";
1
3
  import { LowercaseLiteral, Prettify } from "../utils/misc.cjs";
2
- import { Gemini } from "./api-types.cjs";
3
- import { BindToolsInput } from "@langchain/core/language_models/chat_models";
4
+ import { GoogleChatApiHandler } from "./handlers/base.cjs";
5
+ import { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from "@langchain/core/language_models/chat_models";
4
6
  import { InteropZodType } from "@langchain/core/utils/types";
7
+ import { SerializableSchema } from "@langchain/core/utils/standard_schema";
8
+ import { AsyncCaller } from "@langchain/core/utils/async_caller";
5
9
  //#region src/chat_models/types.d.ts
6
- export interface ChatGoogleFields {
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,43 +69,92 @@ 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;
123
+ }
124
+ export interface GenerateContentSpecificFields {
87
125
  /**
88
126
  * The schema that the generated response should match.
89
127
  * Can be a Zod schema or a JSON Schema object.
90
128
  * When set, the response will be structured according to this schema
91
129
  * and `responseMimeType` will automatically be set to "application/json".
92
130
  */
93
- responseSchema?: InteropZodType | Record<string, unknown>;
131
+ responseSchema?: InteropZodType | SerializableSchema | Record<string, unknown>;
94
132
  /**
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.
133
+ * Desired MIME type of the generated candidate content.
97
134
  */
98
- tools?: BindToolsInput[];
135
+ responseMimeType?: string;
99
136
  /**
100
137
  * The requested modalities of the response.
101
138
  * Represents the set of modalities that the model can return.
102
139
  * An empty list is equivalent to requesting only text.
103
140
  */
104
- responseModalities?: Prettify<Gemini.GenerativeLanguageModality>[];
141
+ responseModalities?: Prettify<GenContent.GenerativeLanguageModality>[];
142
+ /**
143
+ * If true, returns the log probabilities of the tokens that were chosen by
144
+ * the model at each step. By default, this parameter is set to false.
145
+ */
146
+ responseLogprobs?: boolean;
147
+ /**
148
+ * Returns the log probabilities of the top candidate tokens at each generation
149
+ * step. The model's chosen token might not be the same as the top candidate
150
+ * token at each step. Specify the number of candidates to return by using an
151
+ * integer value in the range of 1-20.
152
+ */
153
+ logprobs?: number;
154
+ /**
155
+ * Configuration for the model's thinking process
156
+ */
157
+ thinkingConfig?: Prettify<GenContent.ThinkingConfig>;
105
158
  /**
106
159
  * If true, enables enhanced civic answers feature.
107
160
  */
@@ -112,108 +165,103 @@ export interface ChatGoogleFields {
112
165
  * or a simplified version we've defined (which can be as simple
113
166
  * as the name of a pre-defined voice).
114
167
  */
115
- speechConfig?: Prettify<Gemini.SpeechConfig> | SimplifiedSpeechConfig;
168
+ speechConfig?: Prettify<GenContent.SpeechConfig> | SimplifiedSpeechConfig;
116
169
  /**
117
170
  * Configuration for image generation.
118
171
  */
119
- imageConfig?: Prettify<Gemini.ImageConfig>;
120
- /**
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.
125
- */
126
- mediaResolution?: Gemini.GenerationConfig["mediaResolution"];
127
- /**
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.
136
- */
137
- detail?: "auto" | "low" | "high";
138
- /**
139
- * The number of reasoning tokens that the model should generate.
140
- * If explicitly set, then the reasoning blocks will be returned.
141
- */
142
- maxReasoningTokens?: number;
143
- /**
144
- * An alias for `maxReasoningTokens` for compatibility.
145
- */
146
- thinkingBudget?: number;
147
- /**
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.
151
- */
152
- reasoningEffort?: Gemini.ThinkingLevel;
153
- /**
154
- * An alias for `reasoningEffort` for compatibility.
155
- */
156
- thinkingLevel?: Gemini.ThinkingLevel;
172
+ imageConfig?: Prettify<GenContent.ImageConfig>;
157
173
  /**
158
174
  * Inference service tiers.
159
175
  * "priority" offers highest reliability for higher rates.
160
176
  * "flex" offers a discount for preemptable processing.
161
177
  * Other values are treated as the standard service tier.
162
178
  */
163
- serviceTier?: Gemini.ServiceTier;
164
- /**
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.
168
- */
179
+ serviceTier?: GenContent.ServiceTier;
180
+ }
181
+ export interface GenerateContentFields extends BaseChatGoogleFields, GenerateContentSpecificFields {}
182
+ export interface ChatGoogleFields extends BaseChatGoogleFields, Partial<GenerateContentSpecificFields> {}
183
+ export type GooglePlatformType = "gai" | "gcp";
184
+ export interface BaseChatGoogleParams extends BaseChatModelParams, ChatGoogleFields {
185
+ model: string;
186
+ apiClient?: ApiClient;
187
+ endpoint?: string;
188
+ location?: string;
189
+ apiVersion?: string;
190
+ platformType?: GooglePlatformType;
191
+ vertexai?: boolean;
192
+ streaming?: boolean;
193
+ streamUsage?: boolean;
194
+ apiHandler?: GoogleChatApiHandlerConfig;
195
+ }
196
+ export interface BaseChatGoogleCallOptions extends BaseChatModelCallOptions, ChatGoogleFields {
197
+ streamUsage?: boolean;
198
+ }
199
+ export interface GoogleChatApiHandlerParams extends BaseChatModelParams, BaseChatGoogleFields {
200
+ apiClient: ApiClient;
201
+ caller: AsyncCaller;
202
+ model: string;
203
+ platform: GooglePlatformType;
204
+ endpoint: string;
205
+ location: string;
206
+ apiVersion: string;
207
+ isVertexExpress: boolean;
208
+ publisher: string;
209
+ streaming: boolean;
210
+ streamUsage: boolean;
169
211
  customHeaders?: Record<string, string>;
170
212
  }
171
- declare module "./api-types.js" {
172
- namespace Gemini {
213
+ export interface GenerateContentApiHandlerParams extends GoogleChatApiHandlerParams, GenerateContentSpecificFields {}
214
+ export type GoogleChatApiHandlerFactory = (params: GoogleChatApiHandlerParams) => GoogleChatApiHandler;
215
+ export type GoogleChatApiHandlerConfig = "generateContent" | GoogleChatApiHandlerFactory;
216
+ export type GenerateContentInvocationParams = Partial<Omit<GenContent.GenerateContentRequest, "contents">> & {
217
+ serviceTier?: GenContent.ServiceTier;
218
+ };
219
+ declare module "./api_types/generate_content.js" {
220
+ namespace GenContent {
173
221
  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">;
222
+ type CodeExecutionResult = Pick<GenContent.Part, "codeExecutionResult">;
223
+ type ExecutableCode = Pick<GenContent.Part, "executableCode">;
224
+ type FileData = Pick<GenContent.Part, "fileData" | "videoMetadata">;
225
+ type FunctionCall = Required<Pick<GenContent.Part, "functionCall">> & Pick<GenContent.Part, "thoughtSignature">;
226
+ type FunctionResponse = Pick<GenContent.Part, "functionResponse">;
227
+ type InlineData = Pick<GenContent.Part, "inlineData" | "videoMetadata">;
228
+ type MediaResolution = Pick<GenContent.Part, "mediaResolution">;
229
+ type PartMetadata = Pick<GenContent.Part, "partMetadata">;
230
+ type Text = Pick<GenContent.Part, "text">;
231
+ type Thought = Pick<GenContent.Part, "thought">;
232
+ type ThoughtSignature = Pick<GenContent.Part, "thoughtSignature">;
185
233
  }
186
234
  namespace PrebuiltVoiceConfig {
187
235
  /**
188
236
  * The name of a prebuilt voice that can be used for speech synthesis.
189
237
  *
190
- * Extracted as a non-nullable type from the GeminiBase.PrebuiltVoiceConfig["voiceName"] property.
238
+ * Extracted as a non-nullable type from the PrebuiltVoiceConfig["voiceName"] property.
191
239
  */
192
- type VoiceName = NonNullable<Gemini.PrebuiltVoiceConfig["voiceName"]>;
240
+ type VoiceName = NonNullable<GenContent.PrebuiltVoiceConfig["voiceName"]>;
193
241
  }
194
242
  namespace SpeakerVoiceConfig {
195
243
  /**
196
244
  * The speaker identifier for a custom or multi-speaker TTS configuration.
197
245
  *
198
- * Extracted as a non-nullable type from the GeminiBase.SpeakerVoiceConfig["speaker"] property.
246
+ * Extracted as a non-nullable type from the SpeakerVoiceConfig["speaker"] property.
199
247
  */
200
- type Speaker = NonNullable<Gemini.SpeakerVoiceConfig["speaker"]>;
248
+ type Speaker = NonNullable<GenContent.SpeakerVoiceConfig["speaker"]>;
201
249
  }
202
250
  namespace SpeechConfig {
203
251
  /**
204
252
  * The BCP-47 language code for speech synthesis (e.g., "en-US").
205
253
  *
206
- * Extracted as a non-nullable type from the GeminiBase.SpeechConfig["languageCode"] property.
254
+ * Extracted as a non-nullable type from the SpeechConfig["languageCode"] property.
207
255
  */
208
- type LanguageCode = NonNullable<Gemini.SpeechConfig["languageCode"]>;
256
+ type LanguageCode = NonNullable<GenContent.SpeechConfig["languageCode"]>;
209
257
  }
210
258
  /**
211
259
  * The level of "thinking" or reasoning configured for the model.
212
260
  *
213
- * Extends GeminiBase.ThinkingConfig["thinkingLevel"] to also accept
261
+ * Extends ThinkingConfig["thinkingLevel"] to also accept
214
262
  * lowercase variants (e.g. "high" in addition to "HIGH").
215
263
  */
216
- type ThinkingLevel = Gemini.ThinkingConfig["thinkingLevel"] | LowercaseLiteral<Gemini.ThinkingConfig["thinkingLevel"]>;
264
+ type ThinkingLevel = GenContent.ThinkingConfig["thinkingLevel"] | LowercaseLiteral<GenContent.ThinkingConfig["thinkingLevel"]>;
217
265
  /**
218
266
  * The role of a content message. The spec types this as `string`, but
219
267
  * the API only accepts these specific values.
@@ -222,24 +270,24 @@ declare module "./api-types.js" {
222
270
  /**
223
271
  * Alias for the unwieldy generated grounding support type name.
224
272
  */
225
- type GroundingSupport = Gemini.GoogleAiGenerativelanguageV1betaGroundingSupport;
273
+ type GroundingSupport = GenContent.GoogleAiGenerativelanguageV1betaGroundingSupport;
226
274
  /**
227
275
  * Alias for the unwieldy generated segment type name.
228
276
  */
229
- type Segment = Gemini.GoogleAiGenerativelanguageV1betaSegment;
277
+ type Segment = GenContent.GoogleAiGenerativelanguageV1betaSegment;
230
278
  namespace Tools {
231
279
  /**
232
280
  * The mode for function calling configuration, extracted from the
233
281
  * FunctionCallingConfig interface.
234
282
  */
235
- type FunctionCallingConfigMode = Gemini.Tools.FunctionCallingConfig["mode"];
283
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfig["mode"];
236
284
  }
237
285
  /**
238
286
  * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).
239
287
  * Not in the current OpenAPI spec but still returned by the API.
240
288
  */
241
289
  interface UrlRetrievalMetadata {
242
- urlRetrievalContexts?: Array<Gemini.UrlMetadata>;
290
+ urlRetrievalContexts?: Array<GenContent.UrlMetadata>;
243
291
  }
244
292
  interface Candidate {
245
293
  /** @deprecated Use urlContextMetadata instead. */
@@ -247,30 +295,169 @@ declare module "./api-types.js" {
247
295
  }
248
296
  }
249
297
  }
298
+ export declare namespace Gemini {
299
+ namespace Shared {
300
+ type HarmCategory = GenContent.HarmCategory;
301
+ type SafetySetting = GenContent.SafetySetting;
302
+ type MediaResolution = GenContent.GenerationConfig["mediaResolution"];
303
+ type ThinkingLevel = GenContent.ThinkingLevel;
304
+ }
305
+ namespace GenContent {
306
+ type Content = GenContent.Content;
307
+ type Candidate = GenContent.Candidate;
308
+ type GenerateContentRequest = GenContent.GenerateContentRequest;
309
+ type GenerateContentResponse = GenContent.GenerateContentResponse;
310
+ type GenerationConfig = GenContent.GenerationConfig;
311
+ type SafetyRating = GenContent.SafetyRating;
312
+ type SafetySetting = GenContent.SafetySetting;
313
+ type PromptFeedback = GenContent.PromptFeedback;
314
+ type Tool = GenContent.Tool;
315
+ type ThinkingConfig = GenContent.ThinkingConfig;
316
+ type ThinkingLevel = GenContent.ThinkingLevel;
317
+ type SpeechConfig = GenContent.SpeechConfig;
318
+ namespace SpeechConfig {
319
+ type LanguageCode = GenContent.SpeechConfig.LanguageCode;
320
+ }
321
+ type PrebuiltVoiceConfig = GenContent.PrebuiltVoiceConfig;
322
+ namespace PrebuiltVoiceConfig {
323
+ type VoiceName = GenContent.PrebuiltVoiceConfig.VoiceName;
324
+ }
325
+ type SpeakerVoiceConfig = GenContent.SpeakerVoiceConfig;
326
+ namespace SpeakerVoiceConfig {
327
+ type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
328
+ }
329
+ type ServiceTier = GenContent.ServiceTier;
330
+ type Role = GenContent.Role;
331
+ type GroundingSupport = GenContent.GroundingSupport;
332
+ type GroundingMetadata = GenContent.GroundingMetadata;
333
+ type CitationMetadata = GenContent.CitationMetadata;
334
+ type UsageMetadata = GenContent.UsageMetadata;
335
+ type ModalityTokenCount = GenContent.ModalityTokenCount;
336
+ type Part = GenContent.Part;
337
+ namespace Part {
338
+ type CodeExecutionResult = GenContent.Part.CodeExecutionResult;
339
+ type ExecutableCode = GenContent.Part.ExecutableCode;
340
+ type FileData = GenContent.Part.FileData;
341
+ type FunctionCall = GenContent.Part.FunctionCall;
342
+ type FunctionResponse = GenContent.Part.FunctionResponse;
343
+ type InlineData = GenContent.Part.InlineData;
344
+ type MediaResolution = GenContent.Part.MediaResolution;
345
+ type PartMetadata = GenContent.Part.PartMetadata;
346
+ type Text = GenContent.Part.Text;
347
+ type Thought = GenContent.Part.Thought;
348
+ type ThoughtSignature = GenContent.Part.ThoughtSignature;
349
+ }
350
+ namespace Tools {
351
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfigMode;
352
+ type FunctionDeclaration = GenContent.Tools.FunctionDeclaration;
353
+ type GoogleSearch = GenContent.Tools.GoogleSearch;
354
+ type CodeExecution = GenContent.Tools.CodeExecution;
355
+ type UrlContext = GenContent.Tools.UrlContext;
356
+ type GoogleMaps = GenContent.Tools.GoogleMaps;
357
+ type FileSearch = GenContent.Tools.FileSearch;
358
+ type ComputerUse = GenContent.Tools.ComputerUse;
359
+ type FunctionCallingConfig = GenContent.Tools.FunctionCallingConfig;
360
+ type RetrievalConfig = GenContent.Tools.RetrievalConfig;
361
+ type ToolConfig = GenContent.Tools.ToolConfig;
362
+ type Schema = GenContent.Tools.Schema;
363
+ type LatLng = GenContent.Tools.LatLng;
364
+ type Interval = GenContent.Tools.Interval;
365
+ type SearchTypes = GenContent.Tools.SearchTypes;
366
+ type Type = GenContent.Tools.Type;
367
+ type WebSearch = GenContent.Tools.WebSearch;
368
+ type ImageSearch = GenContent.Tools.ImageSearch;
369
+ }
370
+ }
371
+ type Content = GenContent.Content;
372
+ type Candidate = GenContent.Candidate;
373
+ type GenerateContentRequest = GenContent.GenerateContentRequest;
374
+ type GenerateContentResponse = GenContent.GenerateContentResponse;
375
+ type GenerationConfig = GenContent.GenerationConfig;
376
+ type SafetyRating = GenContent.SafetyRating;
377
+ type SafetySetting = GenContent.SafetySetting;
378
+ type PromptFeedback = GenContent.PromptFeedback;
379
+ type Tool = GenContent.Tool;
380
+ type ThinkingConfig = GenContent.ThinkingConfig;
381
+ type ThinkingLevel = GenContent.ThinkingLevel;
382
+ type SpeechConfig = GenContent.SpeechConfig;
383
+ namespace SpeechConfig {
384
+ type LanguageCode = GenContent.SpeechConfig.LanguageCode;
385
+ }
386
+ type PrebuiltVoiceConfig = GenContent.PrebuiltVoiceConfig;
387
+ namespace PrebuiltVoiceConfig {
388
+ type VoiceName = GenContent.PrebuiltVoiceConfig.VoiceName;
389
+ }
390
+ type SpeakerVoiceConfig = GenContent.SpeakerVoiceConfig;
391
+ namespace SpeakerVoiceConfig {
392
+ type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
393
+ }
394
+ type ServiceTier = GenContent.ServiceTier;
395
+ type Role = GenContent.Role;
396
+ type GroundingSupport = GenContent.GroundingSupport;
397
+ type GroundingMetadata = GenContent.GroundingMetadata;
398
+ type CitationMetadata = GenContent.CitationMetadata;
399
+ type UsageMetadata = GenContent.UsageMetadata;
400
+ type ModalityTokenCount = GenContent.ModalityTokenCount;
401
+ type Part = GenContent.Part;
402
+ namespace Part {
403
+ type CodeExecutionResult = GenContent.Part.CodeExecutionResult;
404
+ type ExecutableCode = GenContent.Part.ExecutableCode;
405
+ type FileData = GenContent.Part.FileData;
406
+ type FunctionCall = GenContent.Part.FunctionCall;
407
+ type FunctionResponse = GenContent.Part.FunctionResponse;
408
+ type InlineData = GenContent.Part.InlineData;
409
+ type MediaResolution = GenContent.Part.MediaResolution;
410
+ type PartMetadata = GenContent.Part.PartMetadata;
411
+ type Text = GenContent.Part.Text;
412
+ type Thought = GenContent.Part.Thought;
413
+ type ThoughtSignature = GenContent.Part.ThoughtSignature;
414
+ }
415
+ namespace Tools {
416
+ type FunctionCallingConfigMode = GenContent.Tools.FunctionCallingConfigMode;
417
+ type FunctionDeclaration = GenContent.Tools.FunctionDeclaration;
418
+ type GoogleSearch = GenContent.Tools.GoogleSearch;
419
+ type CodeExecution = GenContent.Tools.CodeExecution;
420
+ type UrlContext = GenContent.Tools.UrlContext;
421
+ type GoogleMaps = GenContent.Tools.GoogleMaps;
422
+ type FileSearch = GenContent.Tools.FileSearch;
423
+ type ComputerUse = GenContent.Tools.ComputerUse;
424
+ type FunctionCallingConfig = GenContent.Tools.FunctionCallingConfig;
425
+ type RetrievalConfig = GenContent.Tools.RetrievalConfig;
426
+ type ToolConfig = GenContent.Tools.ToolConfig;
427
+ type Schema = GenContent.Tools.Schema;
428
+ type LatLng = GenContent.Tools.LatLng;
429
+ type Interval = GenContent.Tools.Interval;
430
+ type SearchTypes = GenContent.Tools.SearchTypes;
431
+ type Type = GenContent.Tools.Type;
432
+ type WebSearch = GenContent.Tools.WebSearch;
433
+ type ImageSearch = GenContent.Tools.ImageSearch;
434
+ }
435
+ }
250
436
  /**
251
437
  * Simplified speaker/name pair for multi-speaker config.
252
438
  * - `speaker` derived from SpeakerVoiceConfig["speaker"]
253
439
  * - `name` is the prebuilt voice name
254
440
  */
255
441
  export interface SpeechSpeakerName {
256
- speaker: Gemini.SpeakerVoiceConfig.Speaker;
257
- name: Gemini.PrebuiltVoiceConfig.VoiceName;
442
+ speaker: Gemini.GenContent.SpeakerVoiceConfig.Speaker;
443
+ name: Gemini.GenContent.PrebuiltVoiceConfig.VoiceName;
258
444
  }
259
445
  /** 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[];
446
+ export type SpeechVoice = Gemini.GenContent.PrebuiltVoiceConfig.VoiceName | SpeechSpeakerName | SpeechSpeakerName[];
261
447
  /** Voice with language code (derived from SpeechConfig's languageCode) */
262
448
  export interface SpeechVoiceLanguage {
263
449
  voice: SpeechVoice;
264
- languageCode: Gemini.SpeechConfig.LanguageCode;
450
+ languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;
265
451
  }
266
452
  /** Voices with language code */
267
453
  export interface SpeechVoicesLanguage {
268
454
  voices: SpeechVoice;
269
- languageCode: Gemini.SpeechConfig.LanguageCode;
455
+ languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;
270
456
  }
271
457
  /** Simplified language config (with voice or voices) */
272
458
  export type SimplifiedSpeechLanguageConfig = SpeechVoiceLanguage | SpeechVoicesLanguage;
273
459
  /** Top-level simplified config: just a voice, or voice+language */
274
460
  export type SimplifiedSpeechConfig = SpeechVoice | SimplifiedSpeechLanguageConfig;
275
461
  //#endregion
462
+ export type { GenContent };
276
463
  //# sourceMappingURL=types.d.cts.map