@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @langchain/google
2
2
 
3
+ ## 0.2.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9ec213b`](https://github.com/langchain-ai/langchainjs/commit/9ec213b8aba71c3d2870f478b8a18c647957fb7a) Thanks [@afirstenberg](https://github.com/afirstenberg)! - Adds **experimental** support for the Google Interactions API on AI Studio and
8
+ Google Cloud (Vertex).
9
+
10
+ - Add `InteractionsApiHandler` (`apiHandler: "interactions"`) supporting `.invoke()`, `.stream()`, and `.streamEvents()` across AI Studio (`gai`) and Vertex AI (`gcp`)
11
+ - Add Interactions API converters for messages, tools, parameters, and streaming SSE events
12
+ - Generate Interactions API TypeScript types from the OpenAPI specification (`src/chat_models/api_types/interactions.ts`)
13
+ - Export `GoogleChatApiHandler`, `GenerateContentApiHandler`, `InteractionsApiHandler`, and Interactions converters
14
+ - Supports backwards compatibility with the current API.
15
+ - Parameters for the Integrations API are exposed, but no specific feature changes are included.
16
+
17
+ - [#12141](https://github.com/langchain-ai/langchainjs/pull/12141) [`4585842`](https://github.com/langchain-ai/langchainjs/commit/4585842d7e7d04ca14dc8976569c7984ad97218d) Thanks [@hntrl](https://github.com/hntrl)! - Only route Google chat models through the LangSmith gateway when no credentials are passed. Explicit `apiKey`, `authOptions`, `credentials`, or `googleAuthOptions` now go straight to Google.
18
+
19
+ ## 0.2.12
20
+
21
+ ### Patch Changes
22
+
23
+ - [#11968](https://github.com/langchain-ai/langchainjs/pull/11968) [`84eca2b`](https://github.com/langchain-ai/langchainjs/commit/84eca2b11c0900a67775dca258ebec04f8e852a2) Thanks [@afirstenberg](https://github.com/afirstenberg)! - refactoring in preparation for Interactions API
24
+
25
+ - Protocol-specific operations are now done through `GoogleChatApiHandler`
26
+ subclass
27
+ - Converters for generate_content and shared converters
28
+ - Types moved into protocol-specific generated file
29
+ - Includes support Gemini 4 Argon parity (thinking config, model profile,
30
+ usage-only streaming)
31
+
3
32
  ## 0.2.11
4
33
 
5
34
  ### Patch Changes
@@ -1,5 +1,4 @@
1
- //#region src/chat_models/api-types.d.ts
2
- export declare namespace Gemini {
1
+ export declare namespace GenContent {
3
2
  /**
4
3
  * Safety setting, affecting the safety-blocking behavior.
5
4
  *
@@ -335,7 +334,7 @@ export declare namespace Gemini {
335
334
  * Optional. Presence penalty applied to the next token's logprobs if the token has
336
335
  * already been seen in the response.
337
336
  *
338
- * This penalty is binary on/off and not dependent on the number of times the
337
+ * This penalty is binary on/off and not dependant on the number of times the
339
338
  * token is used (after the first). Use
340
339
  * frequency_penalty
341
340
  * for a penalty that increases with each use.
@@ -387,7 +386,7 @@ export declare namespace Gemini {
387
386
  * Refer to the [JSON text generation
388
387
  * guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.
389
388
  */
390
- responseSchema?: Gemini.Tools.Schema;
389
+ responseSchema?: GenContent.Tools.Schema;
391
390
  /**
392
391
  * Optional. Seed used in decoding. If not set, the request uses a randomly generated
393
392
  * seed.
@@ -712,15 +711,20 @@ export declare namespace Gemini {
712
711
  type: Type;
713
712
  }
714
713
  /**
715
- * Different types of search that can be enabled on the GoogleSearch tool.
714
+ * An object that represents a latitude/longitude pair. This is expressed as a
715
+ * pair of doubles to represent degrees latitude and degrees longitude. Unless
716
+ * specified otherwise, this object must conform to the
717
+ * WGS84 standard. Values must be within normalized ranges.
716
718
  */
717
- interface SearchTypes {
718
- /** Optional. Enables image search. Image bytes are returned. */
719
- imageSearch?: ImageSearch;
719
+ interface LatLng {
720
720
  /**
721
- * Optional. Enables web search. Only text results are returned.
721
+ * The latitude in degrees. It must be in the range [-90.0, +90.0].
722
722
  */
723
- webSearch?: WebSearch;
723
+ latitude?: number;
724
+ /**
725
+ * The longitude in degrees. It must be in the range [-180.0, +180.0].
726
+ */
727
+ longitude?: number;
724
728
  }
725
729
  /**
726
730
  * Represents a time interval, encoded as a Timestamp start (inclusive) and a
@@ -747,28 +751,23 @@ export declare namespace Gemini {
747
751
  startTime?: string;
748
752
  }
749
753
  /**
750
- * An object that represents a latitude/longitude pair. This is expressed as a
751
- * pair of doubles to represent degrees latitude and degrees longitude. Unless
752
- * specified otherwise, this object must conform to the
753
- * WGS84 standard. Values must be within normalized ranges.
754
+ * Different types of search that can be enabled on the GoogleSearch tool.
754
755
  */
755
- interface LatLng {
756
- /**
757
- * The latitude in degrees. It must be in the range [-90.0, +90.0].
758
- */
759
- latitude?: number;
756
+ interface SearchTypes {
757
+ /** Optional. Enables image search. Image bytes are returned. */
758
+ imageSearch?: ImageSearch;
760
759
  /**
761
- * The longitude in degrees. It must be in the range [-180.0, +180.0].
760
+ * Optional. Enables web search. Only text results are returned.
762
761
  */
763
- longitude?: number;
762
+ webSearch?: WebSearch;
764
763
  }
765
764
  type Type = "TYPE_UNSPECIFIED" | "STRING" | "NUMBER" | "INTEGER" | "BOOLEAN" | "ARRAY" | "OBJECT" | "NULL" | (string & {});
766
- /** Image search for grounding and related configurations. */
767
- interface ImageSearch {}
768
765
  /**
769
766
  * Standard web search for grounding and related configurations.
770
767
  */
771
768
  interface WebSearch {}
769
+ /** Image search for grounding and related configurations. */
770
+ interface ImageSearch {}
772
771
  }
773
772
  /** Request to generate a completion from the model. */
774
773
  interface GenerateContentRequest {
@@ -835,7 +834,7 @@ export declare namespace Gemini {
835
834
  * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode)
836
835
  * for a usage example.
837
836
  */
838
- toolConfig?: Gemini.Tools.ToolConfig;
837
+ toolConfig?: GenContent.Tools.ToolConfig;
839
838
  /**
840
839
  * Optional. A list of `Tools` the `Model` may use to generate the next response.
841
840
  *
@@ -1227,66 +1226,26 @@ export declare namespace Gemini {
1227
1226
  */
1228
1227
  readonly usageMetadata?: UsageMetadata;
1229
1228
  }
1230
- /**
1231
- * A grounding chunk from Google Maps. A Maps chunk corresponds to a single
1232
- * place.
1233
- */
1234
- interface Maps {
1235
- /**
1236
- * Sources that provide answers about the features of a given place in
1237
- * Google Maps.
1238
- */
1239
- placeAnswerSources?: PlaceAnswerSources;
1240
- /**
1241
- * The ID of the place, in `places/{place_id}` format. A user can use this
1242
- * ID to look up that place.
1243
- */
1244
- placeId?: string;
1245
- /** Text description of the place answer. */
1246
- text?: string;
1247
- /** Title of the place. */
1248
- title?: string;
1249
- /** URI reference of the place. */
1250
- uri?: string;
1251
- }
1252
- /** User provided metadata about the GroundingFact. */
1253
- interface GroundingChunkCustomMetadata {
1254
- /** The key of the metadata. */
1255
- key?: string;
1229
+ /** A citation to a source for a portion of a specific response. */
1230
+ interface CitationSource {
1231
+ /** Optional. End of the attributed segment, exclusive. */
1232
+ endIndex?: number;
1256
1233
  /**
1257
- * Optional. The numeric value of the metadata.
1258
- * The expected range for this value depends on the specific `key` used.
1234
+ * Optional. License for the GitHub project that is attributed as a source for segment.
1235
+ *
1236
+ * License info is required for code citations.
1259
1237
  */
1260
- numericValue?: number;
1261
- /** Optional. A list of string values for the metadata. */
1262
- stringListValue?: GroundingChunkStringList;
1263
- /** Optional. The string value of the metadata. */
1264
- stringValue?: string;
1265
- }
1266
- type ServiceTier = "unspecified" | "standard" | "flex" | "priority" | (string & {});
1267
- /**
1268
- * Optional. If specified, the media resolution specified will be used.
1269
- */
1270
- type MediaResolution = "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | (string & {});
1271
- /**
1272
- * The output from a server-side `ToolCall` execution. This message contains
1273
- * the results of a tool invocation that was initiated by a `ToolCall`
1274
- * from the model. The client should pass this `ToolResponse` back to the API
1275
- * in a subsequent turn within a `Content` message, along with the corresponding
1276
- * `ToolCall`.
1277
- */
1278
- interface ToolResponse {
1238
+ license?: string;
1279
1239
  /**
1280
- * Optional. The identifier of the tool call this response is for.
1240
+ * Optional. Start of segment of the response that is attributed to this source.
1241
+ *
1242
+ * Index indicates the start of the segment, measured in bytes.
1281
1243
  */
1282
- id?: string;
1283
- /** Optional. The tool response. */
1284
- response?: Record<string, unknown>;
1244
+ startIndex?: number;
1285
1245
  /**
1286
- * Required. The type of tool that was called, matching the `tool_type` in the
1287
- * corresponding `ToolCall`.
1246
+ * Optional. URI that is attributed as a source for a portion of the text.
1288
1247
  */
1289
- toolType: ToolType;
1248
+ uri?: string;
1290
1249
  }
1291
1250
  /** Chunk from image search. */
1292
1251
  interface Image {
@@ -1302,25 +1261,11 @@ export declare namespace Gemini {
1302
1261
  /** The title of the web page that the image is from. */
1303
1262
  title?: string;
1304
1263
  }
1305
- /** Chunk from the web. */
1306
- interface Web {
1307
- /** Output only. Title of the chunk. */
1308
- readonly title?: string;
1309
- /** Output only. URI reference of the chunk. */
1310
- readonly uri?: string;
1311
- }
1312
1264
  /** The configuration for the prebuilt speaker to use. */
1313
1265
  interface PrebuiltVoiceConfig {
1314
1266
  /** The name of the preset voice to use. */
1315
1267
  voiceName?: string;
1316
1268
  }
1317
- /** URI based data. */
1318
- interface FileData {
1319
- /** Required. URI. */
1320
- fileUri: string;
1321
- /** Optional. The IANA standard MIME type of the source data. */
1322
- mimeType?: string;
1323
- }
1324
1269
  /**
1325
1270
  * The result output from a `FunctionCall` that contains a string
1326
1271
  * representing the `FunctionDeclaration.name` and a structured JSON
@@ -1371,27 +1316,7 @@ export declare namespace Gemini {
1371
1316
  */
1372
1317
  willContinue?: boolean;
1373
1318
  }
1374
- /** Google search entry point. */
1375
- interface SearchEntryPoint {
1376
- /**
1377
- * Optional. Web content snippet that can be embedded in a web page or an app webview.
1378
- */
1379
- renderedContent?: string;
1380
- /** Optional. Base64 encoded JSON representing array of tuple. */
1381
- sdkBlob?: string;
1382
- }
1383
- /**
1384
- * The status of the underlying model. This is used to indicate the stage of the
1385
- * underlying model and the retirement time if applicable.
1386
- */
1387
- interface ModelStatus {
1388
- /** A message explaining the model status. */
1389
- message?: string;
1390
- /** The stage of the underlying model. */
1391
- modelStage?: ModelStage;
1392
- /** The time at which the model will be retired. */
1393
- retirementTime?: string;
1394
- }
1319
+ type ServiceTier = "unspecified" | "standard" | "flex" | "priority" | (string & {});
1395
1320
  /**
1396
1321
  * Tool details that the model may use to generate response.
1397
1322
  *
@@ -1405,18 +1330,18 @@ export declare namespace Gemini {
1405
1330
  /**
1406
1331
  * Optional. Enables the model to execute code as part of generation.
1407
1332
  */
1408
- codeExecution?: Gemini.Tools.CodeExecution;
1333
+ codeExecution?: GenContent.Tools.CodeExecution;
1409
1334
  /**
1410
1335
  * Optional. Tool to support the model interacting directly with the computer.
1411
1336
  * If enabled, it automatically populates computer-use specific Function
1412
1337
  * Declarations.
1413
1338
  */
1414
- computerUse?: Gemini.Tools.ComputerUse;
1339
+ computerUse?: GenContent.Tools.ComputerUse;
1415
1340
  /**
1416
1341
  * Optional. FileSearch tool type.
1417
1342
  * Tool to retrieve knowledge from Semantic Retrieval corpora.
1418
1343
  */
1419
- fileSearch?: Gemini.Tools.FileSearch;
1344
+ fileSearch?: GenContent.Tools.FileSearch;
1420
1345
  /**
1421
1346
  * Optional. A list of `FunctionDeclarations` available to the model that can be used
1422
1347
  * for function calling.
@@ -1431,66 +1356,37 @@ export declare namespace Gemini {
1431
1356
  * with the Content.role "function" generation context for the next model
1432
1357
  * turn.
1433
1358
  */
1434
- functionDeclarations?: Array<Gemini.Tools.FunctionDeclaration>;
1359
+ functionDeclarations?: Array<GenContent.Tools.FunctionDeclaration>;
1435
1360
  /**
1436
1361
  * Optional. Tool that allows grounding the model's response with geospatial context
1437
1362
  * related to the user's query.
1438
1363
  */
1439
- googleMaps?: Gemini.Tools.GoogleMaps;
1364
+ googleMaps?: GenContent.Tools.GoogleMaps;
1440
1365
  /**
1441
1366
  * Optional. GoogleSearch tool type.
1442
1367
  * Tool to support Google Search in Model. Powered by Google.
1443
1368
  */
1444
- googleSearch?: Gemini.Tools.GoogleSearch;
1369
+ googleSearch?: GenContent.Tools.GoogleSearch;
1445
1370
  /** Optional. Retrieval tool that is powered by Google search. */
1446
1371
  googleSearchRetrieval?: GoogleSearchRetrieval;
1447
1372
  /** Optional. MCP Servers to connect to. */
1448
1373
  mcpServers?: Array<McpServer>;
1449
1374
  /** Optional. Tool to support URL context retrieval. */
1450
- urlContext?: Gemini.Tools.UrlContext;
1451
- }
1452
- /** A citation to a source for a portion of a specific response. */
1453
- interface CitationSource {
1454
- /** Optional. End of the attributed segment, exclusive. */
1455
- endIndex?: number;
1456
- /**
1457
- * Optional. License for the GitHub project that is attributed as a source for segment.
1458
- *
1459
- * License info is required for code citations.
1460
- */
1461
- license?: string;
1462
- /**
1463
- * Optional. Start of segment of the response that is attributed to this source.
1464
- *
1465
- * Index indicates the start of the segment, measured in bytes.
1466
- */
1467
- startIndex?: number;
1468
- /**
1469
- * Optional. URI that is attributed as a source for a portion of the text.
1470
- */
1471
- uri?: string;
1375
+ urlContext?: GenContent.Tools.UrlContext;
1472
1376
  }
1473
- /**
1474
- * A predicted `FunctionCall` returned from the model that contains
1475
- * a string representing the `FunctionDeclaration.name` with the
1476
- * arguments and their values.
1477
- */
1478
- interface FunctionCall {
1479
- /**
1480
- * Optional. The function parameters and values in JSON object format.
1481
- */
1482
- args?: Record<string, unknown>;
1483
- /**
1484
- * Optional. Unique identifier of the function call. If populated, the client to
1485
- * execute the `function_call` and return the response with the matching `id`.
1486
- */
1487
- id?: string;
1377
+ /** User provided metadata about the GroundingFact. */
1378
+ interface GroundingChunkCustomMetadata {
1379
+ /** The key of the metadata. */
1380
+ key?: string;
1488
1381
  /**
1489
- * Required. The name of the function to call.
1490
- * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
1491
- * length of 128.
1382
+ * Optional. The numeric value of the metadata.
1383
+ * The expected range for this value depends on the specific `key` used.
1492
1384
  */
1493
- name: string;
1385
+ numericValue?: number;
1386
+ /** Optional. A list of string values for the metadata. */
1387
+ stringListValue?: GroundingChunkStringList;
1388
+ /** Optional. The string value of the metadata. */
1389
+ stringValue?: string;
1494
1390
  }
1495
1391
  /**
1496
1392
  * Raw media bytes.
@@ -1511,6 +1407,61 @@ export declare namespace Gemini {
1511
1407
  */
1512
1408
  mimeType?: string;
1513
1409
  }
1410
+ /**
1411
+ * The output from a server-side `ToolCall` execution. This message contains
1412
+ * the results of a tool invocation that was initiated by a `ToolCall`
1413
+ * from the model. The client should pass this `ToolResponse` back to the API
1414
+ * in a subsequent turn within a `Content` message, along with the corresponding
1415
+ * `ToolCall`.
1416
+ */
1417
+ interface ToolResponse {
1418
+ /**
1419
+ * Optional. The identifier of the tool call this response is for.
1420
+ */
1421
+ id?: string;
1422
+ /** Optional. The tool response. */
1423
+ response?: Record<string, unknown>;
1424
+ /**
1425
+ * Required. The type of tool that was called, matching the `tool_type` in the
1426
+ * corresponding `ToolCall`.
1427
+ */
1428
+ toolType: ToolType;
1429
+ }
1430
+ /** Google search entry point. */
1431
+ interface SearchEntryPoint {
1432
+ /**
1433
+ * Optional. Web content snippet that can be embedded in a web page or an app webview.
1434
+ */
1435
+ renderedContent?: string;
1436
+ /** Optional. Base64 encoded JSON representing array of tuple. */
1437
+ sdkBlob?: string;
1438
+ }
1439
+ /** Chunk from the web. */
1440
+ interface Web {
1441
+ /** Output only. Title of the chunk. */
1442
+ readonly title?: string;
1443
+ /** Output only. URI reference of the chunk. */
1444
+ readonly uri?: string;
1445
+ }
1446
+ /**
1447
+ * The status of the underlying model. This is used to indicate the stage of the
1448
+ * underlying model and the retirement time if applicable.
1449
+ */
1450
+ interface ModelStatus {
1451
+ /** A message explaining the model status. */
1452
+ message?: string;
1453
+ /** The stage of the underlying model. */
1454
+ modelStage?: ModelStage;
1455
+ /** The time at which the model will be retired. */
1456
+ retirementTime?: string;
1457
+ }
1458
+ /** URI based data. */
1459
+ interface FileData {
1460
+ /** Required. URI. */
1461
+ fileUri: string;
1462
+ /** Optional. The IANA standard MIME type of the source data. */
1463
+ mimeType?: string;
1464
+ }
1514
1465
  /**
1515
1466
  * A predicted server-side `ToolCall` returned from the model. This message
1516
1467
  * contains information about a tool that the model wants to invoke.
@@ -1532,13 +1483,61 @@ export declare namespace Gemini {
1532
1483
  /** Required. The type of tool that was called. */
1533
1484
  toolType: ToolType;
1534
1485
  }
1535
- /** A list of string values. */
1536
- interface GroundingChunkStringList {
1537
- /** The string values of the list. */
1538
- values?: Array<string>;
1486
+ /**
1487
+ * A grounding chunk from Google Maps. A Maps chunk corresponds to a single
1488
+ * place.
1489
+ */
1490
+ interface Maps {
1491
+ /**
1492
+ * Sources that provide answers about the features of a given place in
1493
+ * Google Maps.
1494
+ */
1495
+ placeAnswerSources?: PlaceAnswerSources;
1496
+ /**
1497
+ * The ID of the place, in `places/{place_id}` format. A user can use this
1498
+ * ID to look up that place.
1499
+ */
1500
+ placeId?: string;
1501
+ /** Text description of the place answer. */
1502
+ text?: string;
1503
+ /** Title of the place. */
1504
+ title?: string;
1505
+ /** URI reference of the place. */
1506
+ uri?: string;
1507
+ }
1508
+ /**
1509
+ * A predicted `FunctionCall` returned from the model that contains
1510
+ * a string representing the `FunctionDeclaration.name` with the
1511
+ * arguments and their values.
1512
+ */
1513
+ interface FunctionCall {
1514
+ /**
1515
+ * Optional. The function parameters and values in JSON object format.
1516
+ */
1517
+ args?: Record<string, unknown>;
1518
+ /**
1519
+ * Optional. Unique identifier of the function call. If populated, the client to
1520
+ * execute the `function_call` and return the response with the matching `id`.
1521
+ */
1522
+ id?: string;
1523
+ /**
1524
+ * Required. The name of the function to call.
1525
+ * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
1526
+ * length of 128.
1527
+ */
1528
+ name: string;
1529
+ }
1530
+ /**
1531
+ * A MCPServer is a server that can be called by the model to perform actions.
1532
+ * It is a server that implements the MCP protocol.
1533
+ * Next ID: 5
1534
+ */
1535
+ interface McpServer {
1536
+ /** The name of the MCPServer. */
1537
+ name?: string;
1538
+ /** A transport that can stream HTTP requests and responses. */
1539
+ streamableHttpTransport?: StreamableHttpTransport;
1539
1540
  }
1540
- /** Required. The type of tool that was called. */
1541
- type ToolType = "TOOL_TYPE_UNSPECIFIED" | "GOOGLE_SEARCH_WEB" | "GOOGLE_SEARCH_IMAGE" | "URL_CONTEXT" | "GOOGLE_MAPS" | "FILE_SEARCH" | (string & {});
1542
1541
  /**
1543
1542
  * A datatype containing media that is part of a `FunctionResponse` message.
1544
1543
  *
@@ -1554,17 +1553,7 @@ export declare namespace Gemini {
1554
1553
  /** Inline media bytes. */
1555
1554
  inlineData?: FunctionResponseBlob;
1556
1555
  }
1557
- /**
1558
- * A MCPServer is a server that can be called by the model to perform actions.
1559
- * It is a server that implements the MCP protocol.
1560
- * Next ID: 5
1561
- */
1562
- interface McpServer {
1563
- /** The name of the MCPServer. */
1564
- name?: string;
1565
- /** A transport that can stream HTTP requests and responses. */
1566
- streamableHttpTransport?: StreamableHttpTransport;
1567
- }
1556
+ type ModelStage = "MODEL_STAGE_UNSPECIFIED" | "UNSTABLE_EXPERIMENTAL" | "EXPERIMENTAL" | "PREVIEW" | "STABLE" | "LEGACY" | "DEPRECATED" | "RETIRED" | (string & {});
1568
1557
  /**
1569
1558
  * Collection of sources that provide answers about the features of a given
1570
1559
  * place in Google Maps. Each PlaceAnswerSources message corresponds to a
@@ -1580,7 +1569,11 @@ export declare namespace Gemini {
1580
1569
  */
1581
1570
  reviewSnippets?: Array<ReviewSnippet>;
1582
1571
  }
1583
- type ModelStage = "MODEL_STAGE_UNSPECIFIED" | "UNSTABLE_EXPERIMENTAL" | "EXPERIMENTAL" | "PREVIEW" | "STABLE" | "LEGACY" | "DEPRECATED" | "RETIRED" | (string & {});
1572
+ /** A list of string values. */
1573
+ interface GroundingChunkStringList {
1574
+ /** The string values of the list. */
1575
+ values?: Array<string>;
1576
+ }
1584
1577
  /**
1585
1578
  * Tool to retrieve public web data for grounding, powered by Google.
1586
1579
  */
@@ -1590,26 +1583,6 @@ export declare namespace Gemini {
1590
1583
  */
1591
1584
  dynamicRetrievalConfig?: DynamicRetrievalConfig;
1592
1585
  }
1593
- /**
1594
- * Raw media bytes for function response.
1595
- *
1596
- * Text should not be sent as raw bytes, use the 'FunctionResponse.response'
1597
- * field.
1598
- */
1599
- interface FunctionResponseBlob {
1600
- /** Raw bytes for media formats. */
1601
- data?: string;
1602
- /**
1603
- * The IANA standard MIME type of the source data.
1604
- * Examples:
1605
- * - image/png
1606
- * - image/jpeg
1607
- * If an unsupported MIME type is provided, an error will be returned. For a
1608
- * complete list of supported types, see [Supported file
1609
- * formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
1610
- */
1611
- mimeType?: string;
1612
- }
1613
1586
  /**
1614
1587
  * A transport that can stream HTTP requests and responses.
1615
1588
  * Next ID: 6
@@ -1633,6 +1606,26 @@ export declare namespace Gemini {
1633
1606
  */
1634
1607
  url?: string;
1635
1608
  }
1609
+ /**
1610
+ * Raw media bytes for function response.
1611
+ *
1612
+ * Text should not be sent as raw bytes, use the 'FunctionResponse.response'
1613
+ * field.
1614
+ */
1615
+ interface FunctionResponseBlob {
1616
+ /** Raw bytes for media formats. */
1617
+ data?: string;
1618
+ /**
1619
+ * The IANA standard MIME type of the source data.
1620
+ * Examples:
1621
+ * - image/png
1622
+ * - image/jpeg
1623
+ * If an unsupported MIME type is provided, an error will be returned. For a
1624
+ * complete list of supported types, see [Supported file
1625
+ * formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
1626
+ */
1627
+ mimeType?: string;
1628
+ }
1636
1629
  /**
1637
1630
  * Encapsulates a snippet of a user review that answers a question about
1638
1631
  * the features of a specific place in Google Maps.
@@ -1655,6 +1648,11 @@ export declare namespace Gemini {
1655
1648
  /** The mode of the predictor to be used in dynamic retrieval. */
1656
1649
  mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | (string & {});
1657
1650
  }
1651
+ /**
1652
+ * Optional. If specified, the media resolution specified will be used.
1653
+ */
1654
+ type MediaResolution = "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | (string & {});
1655
+ /** Required. The type of tool that was called. */
1656
+ type ToolType = "TOOL_TYPE_UNSPECIFIED" | "GOOGLE_SEARCH_WEB" | "GOOGLE_SEARCH_IMAGE" | "URL_CONTEXT" | "GOOGLE_MAPS" | "FILE_SEARCH" | (string & {});
1658
1657
  }
1659
- //#endregion
1660
- //# sourceMappingURL=api-types.d.ts.map
1658
+ //# sourceMappingURL=generate_content.d.cts.map