@langchain/google 0.1.11 → 0.1.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.
- package/CHANGELOG.md +8 -0
- package/dist/chat_models/api-types.d.cts +256 -101
- package/dist/chat_models/api-types.d.ts +256 -101
- package/dist/chat_models/base.cjs +34 -8
- package/dist/chat_models/base.cjs.map +1 -1
- package/dist/chat_models/base.d.cts +3 -0
- package/dist/chat_models/base.d.ts +3 -0
- package/dist/chat_models/base.js +35 -9
- package/dist/chat_models/base.js.map +1 -1
- package/dist/chat_models/types.cjs +6 -0
- package/dist/chat_models/types.cjs.map +1 -0
- package/dist/chat_models/types.d.cts +13 -0
- package/dist/chat_models/types.d.ts +13 -0
- package/dist/chat_models/types.js +6 -0
- package/dist/chat_models/types.js.map +1 -0
- package/dist/converters/params.cjs +12 -0
- package/dist/converters/params.cjs.map +1 -1
- package/dist/converters/params.js +12 -1
- package/dist/converters/params.js.map +1 -1
- package/node.cjs +1 -0
- package/node.d.cts +1 -0
- package/node.d.ts +1 -0
- package/node.js +1 -0
- package/package.json +10 -5
|
@@ -34,10 +34,6 @@ declare namespace Gemini {
|
|
|
34
34
|
thinkingLevel?: "THINKING_LEVEL_UNSPECIFIED" | "MINIMAL" | "LOW" | "MEDIUM" | "HIGH" | (string & {});
|
|
35
35
|
}
|
|
36
36
|
type GenerativeLanguageModality = "MODALITY_UNSPECIFIED" | "TEXT" | "IMAGE" | "VIDEO" | "AUDIO" | "DOCUMENT" | (string & {});
|
|
37
|
-
/** Media resolution for the input media. */
|
|
38
|
-
interface MediaResolution {
|
|
39
|
-
level?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | "MEDIA_RESOLUTION_ULTRA_HIGH" | (string & {});
|
|
40
|
-
}
|
|
41
37
|
/** Config for speech generation and transcription. */
|
|
42
38
|
interface SpeechConfig {
|
|
43
39
|
/**
|
|
@@ -85,15 +81,16 @@ declare namespace Gemini {
|
|
|
85
81
|
interface ImageConfig {
|
|
86
82
|
/**
|
|
87
83
|
* Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`,
|
|
88
|
-
* `
|
|
84
|
+
* `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`,
|
|
85
|
+
* `9:16`, `16:9`, or `21:9`.
|
|
89
86
|
*
|
|
90
87
|
* If not specified, the model will choose a default aspect ratio based on any
|
|
91
88
|
* reference images provided.
|
|
92
89
|
*/
|
|
93
90
|
aspectRatio?: string;
|
|
94
91
|
/**
|
|
95
|
-
* Optional. Specifies the size of generated images. Supported values are `
|
|
96
|
-
* `4K`. If not specified, the model will use default value `1K`.
|
|
92
|
+
* Optional. Specifies the size of generated images. Supported values are `512`, `1K`,
|
|
93
|
+
* `2K`, `4K`. If not specified, the model will use default value `1K`.
|
|
97
94
|
*/
|
|
98
95
|
imageSize?: string;
|
|
99
96
|
}
|
|
@@ -146,13 +143,28 @@ declare namespace Gemini {
|
|
|
146
143
|
* requests.
|
|
147
144
|
*/
|
|
148
145
|
thoughtSignature?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Server-side tool call. This field is populated when the model
|
|
148
|
+
* predicts a tool invocation that should be executed on the server.
|
|
149
|
+
* The client is expected to echo this message back to the API.
|
|
150
|
+
*/
|
|
151
|
+
toolCall?: ToolCall;
|
|
152
|
+
/**
|
|
153
|
+
* The output from a server-side `ToolCall` execution. This field is
|
|
154
|
+
* populated by the client with the results of executing the
|
|
155
|
+
* corresponding `ToolCall`.
|
|
156
|
+
*/
|
|
157
|
+
toolResponse?: ToolResponse;
|
|
149
158
|
/**
|
|
150
159
|
* Optional. Video metadata. The metadata should only be specified while the video
|
|
151
160
|
* data is presented in inline_data or file_data.
|
|
152
161
|
*/
|
|
153
162
|
videoMetadata?: VideoMetadata;
|
|
154
163
|
}
|
|
155
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata
|
|
166
|
+
* describes the input video content.
|
|
167
|
+
*/
|
|
156
168
|
interface VideoMetadata {
|
|
157
169
|
/** Optional. The end offset of the video. */
|
|
158
170
|
endOffset?: string;
|
|
@@ -168,10 +180,14 @@ declare namespace Gemini {
|
|
|
168
180
|
/**
|
|
169
181
|
* Result of executing the `ExecutableCode`.
|
|
170
182
|
*
|
|
171
|
-
*
|
|
172
|
-
* containing the `ExecutableCode`.
|
|
183
|
+
* Generated only when the `CodeExecution` tool is used.
|
|
173
184
|
*/
|
|
174
185
|
interface CodeExecutionResult {
|
|
186
|
+
/**
|
|
187
|
+
* Optional. The identifier of the `ExecutableCode` part this result is for.
|
|
188
|
+
* Only populated if the corresponding `ExecutableCode` has an id.
|
|
189
|
+
*/
|
|
190
|
+
id?: string;
|
|
175
191
|
/** Required. Outcome of the code execution. */
|
|
176
192
|
outcome: "OUTCOME_UNSPECIFIED" | "OUTCOME_OK" | "OUTCOME_FAILED" | "OUTCOME_DEADLINE_EXCEEDED" | (string & {});
|
|
177
193
|
/**
|
|
@@ -191,6 +207,11 @@ declare namespace Gemini {
|
|
|
191
207
|
interface ExecutableCode {
|
|
192
208
|
/** Required. The code to be executed. */
|
|
193
209
|
code: string;
|
|
210
|
+
/**
|
|
211
|
+
* Optional. Unique identifier of the `ExecutableCode` part.
|
|
212
|
+
* The server returns the `CodeExecutionResult` with the matching `id`.
|
|
213
|
+
*/
|
|
214
|
+
id?: string;
|
|
194
215
|
/** Required. Programming language of the `code`. */
|
|
195
216
|
language: "LANGUAGE_UNSPECIFIED" | "PYTHON" | (string & {});
|
|
196
217
|
}
|
|
@@ -294,8 +315,9 @@ declare namespace Gemini {
|
|
|
294
315
|
imageConfig?: ImageConfig;
|
|
295
316
|
/**
|
|
296
317
|
* Optional. Only valid if response_logprobs=True.
|
|
297
|
-
* This sets the number of top logprobs
|
|
298
|
-
*
|
|
318
|
+
* This sets the number of top logprobs, including the chosen candidate, to
|
|
319
|
+
* return at each decoding step in the Candidate.logprobs_result. The
|
|
320
|
+
* number must be in the range of [0, 20].
|
|
299
321
|
*/
|
|
300
322
|
logprobs?: number;
|
|
301
323
|
/**
|
|
@@ -444,7 +466,7 @@ declare namespace Gemini {
|
|
|
444
466
|
/**
|
|
445
467
|
* Required. The name of the function.
|
|
446
468
|
* Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes,
|
|
447
|
-
* with a maximum length of
|
|
469
|
+
* with a maximum length of 128.
|
|
448
470
|
*/
|
|
449
471
|
name: string;
|
|
450
472
|
/**
|
|
@@ -494,6 +516,11 @@ declare namespace Gemini {
|
|
|
494
516
|
* Tool to support Google Search in Model. Powered by Google.
|
|
495
517
|
*/
|
|
496
518
|
interface GoogleSearch {
|
|
519
|
+
/**
|
|
520
|
+
* Optional. The set of search types to enable. If not set, web search is
|
|
521
|
+
* enabled by default.
|
|
522
|
+
*/
|
|
523
|
+
searchTypes?: SearchTypes;
|
|
497
524
|
/**
|
|
498
525
|
* Optional. Filter search results to a specific time range.
|
|
499
526
|
* If customers set a start time, they must set an end time (and vice
|
|
@@ -591,6 +618,12 @@ declare namespace Gemini {
|
|
|
591
618
|
interface ToolConfig {
|
|
592
619
|
/** Optional. Function calling config. */
|
|
593
620
|
functionCallingConfig?: FunctionCallingConfig;
|
|
621
|
+
/**
|
|
622
|
+
* Optional. If true, the API response will include the server-side tool calls and
|
|
623
|
+
* responses within the `Content` message. This allows clients to
|
|
624
|
+
* observe the server's tool interactions.
|
|
625
|
+
*/
|
|
626
|
+
includeServerSideToolInvocations?: boolean;
|
|
594
627
|
/** Optional. Retrieval config. */
|
|
595
628
|
retrievalConfig?: RetrievalConfig;
|
|
596
629
|
}
|
|
@@ -678,7 +711,17 @@ declare namespace Gemini {
|
|
|
678
711
|
/** Required. Data type. */
|
|
679
712
|
type: Type;
|
|
680
713
|
}
|
|
681
|
-
|
|
714
|
+
/**
|
|
715
|
+
* Different types of search that can be enabled on the GoogleSearch tool.
|
|
716
|
+
*/
|
|
717
|
+
interface SearchTypes {
|
|
718
|
+
/** Optional. Enables image search. Image bytes are returned. */
|
|
719
|
+
imageSearch?: ImageSearch;
|
|
720
|
+
/**
|
|
721
|
+
* Optional. Enables web search. Only text results are returned.
|
|
722
|
+
*/
|
|
723
|
+
webSearch?: WebSearch;
|
|
724
|
+
}
|
|
682
725
|
/**
|
|
683
726
|
* Represents a time interval, encoded as a Timestamp start (inclusive) and a
|
|
684
727
|
* Timestamp end (exclusive).
|
|
@@ -719,6 +762,13 @@ declare namespace Gemini {
|
|
|
719
762
|
*/
|
|
720
763
|
longitude?: number;
|
|
721
764
|
}
|
|
765
|
+
type Type = "TYPE_UNSPECIFIED" | "STRING" | "NUMBER" | "INTEGER" | "BOOLEAN" | "ARRAY" | "OBJECT" | "NULL" | (string & {});
|
|
766
|
+
/** Image search for grounding and related configurations. */
|
|
767
|
+
interface ImageSearch {}
|
|
768
|
+
/**
|
|
769
|
+
* Standard web search for grounding and related configurations.
|
|
770
|
+
*/
|
|
771
|
+
interface WebSearch {}
|
|
722
772
|
}
|
|
723
773
|
/** Request to generate a completion from the model. */
|
|
724
774
|
interface GenerateContentRequest {
|
|
@@ -766,6 +816,13 @@ declare namespace Gemini {
|
|
|
766
816
|
* learn how to incorporate safety considerations in your AI applications.
|
|
767
817
|
*/
|
|
768
818
|
safetySettings?: Array<SafetySetting>;
|
|
819
|
+
/** Optional. The service tier of the request. */
|
|
820
|
+
serviceTier?: ServiceTier;
|
|
821
|
+
/**
|
|
822
|
+
* Optional. Configures the logging behavior for a given request. If set, it takes
|
|
823
|
+
* precedence over the project-level logging config.
|
|
824
|
+
*/
|
|
825
|
+
store?: boolean;
|
|
769
826
|
/**
|
|
770
827
|
* Optional. Developer set [system
|
|
771
828
|
* instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions).
|
|
@@ -830,6 +887,8 @@ declare namespace Gemini {
|
|
|
830
887
|
groundingChunks?: Array<GroundingChunk>;
|
|
831
888
|
/** List of grounding support. */
|
|
832
889
|
groundingSupports?: Array<GoogleAiGenerativelanguageV1betaGroundingSupport>;
|
|
890
|
+
/** Image search queries used for grounding. */
|
|
891
|
+
imageSearchQueries?: Array<string>;
|
|
833
892
|
/** Metadata related to retrieval in the grounding flow. */
|
|
834
893
|
retrievalMetadata?: RetrievalMetadata;
|
|
835
894
|
/**
|
|
@@ -839,8 +898,14 @@ declare namespace Gemini {
|
|
|
839
898
|
/** Web search queries for the following-up web search. */
|
|
840
899
|
webSearchQueries?: Array<string>;
|
|
841
900
|
}
|
|
842
|
-
/**
|
|
901
|
+
/**
|
|
902
|
+
* A `GroundingChunk` represents a segment of supporting evidence that grounds
|
|
903
|
+
* the model's response. It can be a chunk from the web, a retrieved context
|
|
904
|
+
* from a file, or information from Google Maps.
|
|
905
|
+
*/
|
|
843
906
|
interface GroundingChunk {
|
|
907
|
+
/** Optional. Grounding chunk from image search. */
|
|
908
|
+
image?: Image;
|
|
844
909
|
/** Optional. Grounding chunk from Google Maps. */
|
|
845
910
|
maps?: Maps;
|
|
846
911
|
/**
|
|
@@ -852,6 +917,10 @@ declare namespace Gemini {
|
|
|
852
917
|
}
|
|
853
918
|
/** Chunk from context retrieved by the file search tool. */
|
|
854
919
|
interface RetrievedContext {
|
|
920
|
+
/**
|
|
921
|
+
* Optional. User-provided metadata about the retrieved context.
|
|
922
|
+
*/
|
|
923
|
+
customMetadata?: Array<GroundingChunkCustomMetadata>;
|
|
855
924
|
/**
|
|
856
925
|
* Optional. Name of the `FileSearchStore` containing the document.
|
|
857
926
|
* Example: `fileSearchStores/123`
|
|
@@ -883,6 +952,11 @@ declare namespace Gemini {
|
|
|
883
952
|
* all responses (while maintaining the same order).
|
|
884
953
|
*/
|
|
885
954
|
groundingChunkIndices?: Array<number>;
|
|
955
|
+
/**
|
|
956
|
+
* Output only. Indices into the `parts` field of the candidate's content. These indices
|
|
957
|
+
* specify which rendered parts are associated with this support source.
|
|
958
|
+
*/
|
|
959
|
+
readonly renderedParts?: Array<number>;
|
|
886
960
|
/** Segment of the content this support belongs to. */
|
|
887
961
|
segment?: GoogleAiGenerativelanguageV1betaSegment;
|
|
888
962
|
}
|
|
@@ -1164,7 +1238,7 @@ declare namespace Gemini {
|
|
|
1164
1238
|
*/
|
|
1165
1239
|
placeAnswerSources?: PlaceAnswerSources;
|
|
1166
1240
|
/**
|
|
1167
|
-
*
|
|
1241
|
+
* The ID of the place, in `places/{place_id}` format. A user can use this
|
|
1168
1242
|
* ID to look up that place.
|
|
1169
1243
|
*/
|
|
1170
1244
|
placeId?: string;
|
|
@@ -1175,32 +1249,77 @@ declare namespace Gemini {
|
|
|
1175
1249
|
/** URI reference of the place. */
|
|
1176
1250
|
uri?: string;
|
|
1177
1251
|
}
|
|
1178
|
-
/**
|
|
1179
|
-
interface
|
|
1180
|
-
/** The
|
|
1181
|
-
|
|
1252
|
+
/** User provided metadata about the GroundingFact. */
|
|
1253
|
+
interface GroundingChunkCustomMetadata {
|
|
1254
|
+
/** The key of the metadata. */
|
|
1255
|
+
key?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* Optional. The numeric value of the metadata.
|
|
1258
|
+
* The expected range for this value depends on the specific `key` used.
|
|
1259
|
+
*/
|
|
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;
|
|
1182
1265
|
}
|
|
1266
|
+
type ServiceTier = "unspecified" | "standard" | "flex" | "priority" | (string & {});
|
|
1183
1267
|
/**
|
|
1184
|
-
*
|
|
1185
|
-
* a string representing the `FunctionDeclaration.name` with the
|
|
1186
|
-
* arguments and their values.
|
|
1268
|
+
* Optional. If specified, the media resolution specified will be used.
|
|
1187
1269
|
*/
|
|
1188
|
-
|
|
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 {
|
|
1189
1279
|
/**
|
|
1190
|
-
* Optional. The
|
|
1191
|
-
*/
|
|
1192
|
-
args?: Record<string, unknown>;
|
|
1193
|
-
/**
|
|
1194
|
-
* Optional. The unique identifier of the function call. If populated, the client to
|
|
1195
|
-
* execute the `function_call` and return the response with the matching `id`.
|
|
1280
|
+
* Optional. The identifier of the tool call this response is for.
|
|
1196
1281
|
*/
|
|
1197
1282
|
id?: string;
|
|
1283
|
+
/** Optional. The tool response. */
|
|
1284
|
+
response?: Record<string, unknown>;
|
|
1198
1285
|
/**
|
|
1199
|
-
* Required. The
|
|
1200
|
-
*
|
|
1201
|
-
* length of 64.
|
|
1286
|
+
* Required. The type of tool that was called, matching the `tool_type` in the
|
|
1287
|
+
* corresponding `ToolCall`.
|
|
1202
1288
|
*/
|
|
1203
|
-
|
|
1289
|
+
toolType: ToolType;
|
|
1290
|
+
}
|
|
1291
|
+
/** Chunk from image search. */
|
|
1292
|
+
interface Image {
|
|
1293
|
+
/**
|
|
1294
|
+
* The root domain of the web page that the image is from, e.g.
|
|
1295
|
+
* "example.com".
|
|
1296
|
+
*/
|
|
1297
|
+
domain?: string;
|
|
1298
|
+
/** The image asset URL. */
|
|
1299
|
+
imageUri?: string;
|
|
1300
|
+
/** The web page URI for attribution. */
|
|
1301
|
+
sourceUri?: string;
|
|
1302
|
+
/** The title of the web page that the image is from. */
|
|
1303
|
+
title?: string;
|
|
1304
|
+
}
|
|
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
|
+
/** The configuration for the prebuilt speaker to use. */
|
|
1313
|
+
interface PrebuiltVoiceConfig {
|
|
1314
|
+
/** The name of the preset voice to use. */
|
|
1315
|
+
voiceName?: string;
|
|
1316
|
+
}
|
|
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;
|
|
1204
1323
|
}
|
|
1205
1324
|
/**
|
|
1206
1325
|
* The result output from a `FunctionCall` that contains a string
|
|
@@ -1218,7 +1337,7 @@ declare namespace Gemini {
|
|
|
1218
1337
|
/**
|
|
1219
1338
|
* Required. The name of the function to call.
|
|
1220
1339
|
* Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
|
|
1221
|
-
* length of
|
|
1340
|
+
* length of 128.
|
|
1222
1341
|
*/
|
|
1223
1342
|
name: string;
|
|
1224
1343
|
/**
|
|
@@ -1252,6 +1371,27 @@ declare namespace Gemini {
|
|
|
1252
1371
|
*/
|
|
1253
1372
|
willContinue?: boolean;
|
|
1254
1373
|
}
|
|
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
|
+
}
|
|
1255
1395
|
/**
|
|
1256
1396
|
* Tool details that the model may use to generate response.
|
|
1257
1397
|
*
|
|
@@ -1259,7 +1399,7 @@ declare namespace Gemini {
|
|
|
1259
1399
|
* external systems to perform an action, or set of actions, outside of
|
|
1260
1400
|
* knowledge and scope of the model.
|
|
1261
1401
|
*
|
|
1262
|
-
* Next ID:
|
|
1402
|
+
* Next ID: 16
|
|
1263
1403
|
*/
|
|
1264
1404
|
interface Tool {
|
|
1265
1405
|
/**
|
|
@@ -1309,13 +1449,6 @@ declare namespace Gemini {
|
|
|
1309
1449
|
/** Optional. Tool to support URL context retrieval. */
|
|
1310
1450
|
urlContext?: Gemini.Tools.UrlContext;
|
|
1311
1451
|
}
|
|
1312
|
-
/** Chunk from the web. */
|
|
1313
|
-
interface Web {
|
|
1314
|
-
/** Title of the chunk. */
|
|
1315
|
-
title?: string;
|
|
1316
|
-
/** URI reference of the chunk. */
|
|
1317
|
-
uri?: string;
|
|
1318
|
-
}
|
|
1319
1452
|
/** A citation to a source for a portion of a specific response. */
|
|
1320
1453
|
interface CitationSource {
|
|
1321
1454
|
/** Optional. End of the attributed segment, exclusive. */
|
|
@@ -1338,23 +1471,26 @@ declare namespace Gemini {
|
|
|
1338
1471
|
uri?: string;
|
|
1339
1472
|
}
|
|
1340
1473
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1474
|
+
* A predicted `FunctionCall` returned from the model that contains
|
|
1475
|
+
* a string representing the `FunctionDeclaration.name` with the
|
|
1476
|
+
* arguments and their values.
|
|
1343
1477
|
*/
|
|
1344
|
-
interface
|
|
1345
|
-
/**
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
/**
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
/**
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
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;
|
|
1488
|
+
/**
|
|
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.
|
|
1492
|
+
*/
|
|
1493
|
+
name: string;
|
|
1358
1494
|
}
|
|
1359
1495
|
/**
|
|
1360
1496
|
* Raw media bytes.
|
|
@@ -1375,14 +1511,48 @@ declare namespace Gemini {
|
|
|
1375
1511
|
*/
|
|
1376
1512
|
mimeType?: string;
|
|
1377
1513
|
}
|
|
1378
|
-
/**
|
|
1379
|
-
|
|
1514
|
+
/**
|
|
1515
|
+
* A predicted server-side `ToolCall` returned from the model. This message
|
|
1516
|
+
* contains information about a tool that the model wants to invoke.
|
|
1517
|
+
* The client is NOT expected to execute this `ToolCall`. Instead, the
|
|
1518
|
+
* client should pass this `ToolCall` back to the API in a subsequent turn
|
|
1519
|
+
* within a `Content` message, along with the corresponding `ToolResponse`.
|
|
1520
|
+
*/
|
|
1521
|
+
interface ToolCall {
|
|
1380
1522
|
/**
|
|
1381
|
-
* Optional.
|
|
1523
|
+
* Optional. The tool call arguments.
|
|
1524
|
+
* Example: {"arg1" : "value1", "arg2" : "value2" , ...}
|
|
1382
1525
|
*/
|
|
1383
|
-
|
|
1384
|
-
/**
|
|
1385
|
-
|
|
1526
|
+
args?: Record<string, unknown>;
|
|
1527
|
+
/**
|
|
1528
|
+
* Optional. Unique identifier of the tool call.
|
|
1529
|
+
* The server returns the tool response with the matching `id`.
|
|
1530
|
+
*/
|
|
1531
|
+
id?: string;
|
|
1532
|
+
/** Required. The type of tool that was called. */
|
|
1533
|
+
toolType: ToolType;
|
|
1534
|
+
}
|
|
1535
|
+
/** A list of string values. */
|
|
1536
|
+
interface GroundingChunkStringList {
|
|
1537
|
+
/** The string values of the list. */
|
|
1538
|
+
values?: Array<string>;
|
|
1539
|
+
}
|
|
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
|
+
/**
|
|
1543
|
+
* A datatype containing media that is part of a `FunctionResponse` message.
|
|
1544
|
+
*
|
|
1545
|
+
* A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
1546
|
+
* `FunctionResponsePart` can only contain one of the accepted types in
|
|
1547
|
+
* `FunctionResponsePart.data`.
|
|
1548
|
+
*
|
|
1549
|
+
* A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
1550
|
+
* type and subtype of the media if the `inline_data` field is filled with raw
|
|
1551
|
+
* bytes.
|
|
1552
|
+
*/
|
|
1553
|
+
interface FunctionResponsePart {
|
|
1554
|
+
/** Inline media bytes. */
|
|
1555
|
+
inlineData?: FunctionResponseBlob;
|
|
1386
1556
|
}
|
|
1387
1557
|
/**
|
|
1388
1558
|
* A MCPServer is a server that can be called by the model to perform actions.
|
|
@@ -1395,7 +1565,6 @@ declare namespace Gemini {
|
|
|
1395
1565
|
/** A transport that can stream HTTP requests and responses. */
|
|
1396
1566
|
streamableHttpTransport?: StreamableHttpTransport;
|
|
1397
1567
|
}
|
|
1398
|
-
type ModelStage = "MODEL_STAGE_UNSPECIFIED" | "UNSTABLE_EXPERIMENTAL" | "EXPERIMENTAL" | "PREVIEW" | "STABLE" | "LEGACY" | "DEPRECATED" | "RETIRED" | (string & {});
|
|
1399
1568
|
/**
|
|
1400
1569
|
* Collection of sources that provide answers about the features of a given
|
|
1401
1570
|
* place in Google Maps. Each PlaceAnswerSources message corresponds to a
|
|
@@ -1411,21 +1580,7 @@ declare namespace Gemini {
|
|
|
1411
1580
|
*/
|
|
1412
1581
|
reviewSnippets?: Array<ReviewSnippet>;
|
|
1413
1582
|
}
|
|
1414
|
-
|
|
1415
|
-
* A datatype containing media that is part of a `FunctionResponse` message.
|
|
1416
|
-
*
|
|
1417
|
-
* A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
1418
|
-
* `FunctionResponsePart` can only contain one of the accepted types in
|
|
1419
|
-
* `FunctionResponsePart.data`.
|
|
1420
|
-
*
|
|
1421
|
-
* A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
1422
|
-
* type and subtype of the media if the `inline_data` field is filled with raw
|
|
1423
|
-
* bytes.
|
|
1424
|
-
*/
|
|
1425
|
-
interface FunctionResponsePart {
|
|
1426
|
-
/** Inline media bytes. */
|
|
1427
|
-
inlineData?: FunctionResponseBlob;
|
|
1428
|
-
}
|
|
1583
|
+
type ModelStage = "MODEL_STAGE_UNSPECIFIED" | "UNSTABLE_EXPERIMENTAL" | "EXPERIMENTAL" | "PREVIEW" | "STABLE" | "LEGACY" | "DEPRECATED" | "RETIRED" | (string & {});
|
|
1429
1584
|
/**
|
|
1430
1585
|
* Tool to retrieve public web data for grounding, powered by Google.
|
|
1431
1586
|
*/
|
|
@@ -1435,6 +1590,26 @@ declare namespace Gemini {
|
|
|
1435
1590
|
*/
|
|
1436
1591
|
dynamicRetrievalConfig?: DynamicRetrievalConfig;
|
|
1437
1592
|
}
|
|
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
|
+
}
|
|
1438
1613
|
/**
|
|
1439
1614
|
* A transport that can stream HTTP requests and responses.
|
|
1440
1615
|
* Next ID: 6
|
|
@@ -1470,26 +1645,6 @@ declare namespace Gemini {
|
|
|
1470
1645
|
/** Title of the review. */
|
|
1471
1646
|
title?: string;
|
|
1472
1647
|
}
|
|
1473
|
-
/**
|
|
1474
|
-
* Raw media bytes for function response.
|
|
1475
|
-
*
|
|
1476
|
-
* Text should not be sent as raw bytes, use the 'FunctionResponse.response'
|
|
1477
|
-
* field.
|
|
1478
|
-
*/
|
|
1479
|
-
interface FunctionResponseBlob {
|
|
1480
|
-
/** Raw bytes for media formats. */
|
|
1481
|
-
data?: string;
|
|
1482
|
-
/**
|
|
1483
|
-
* The IANA standard MIME type of the source data.
|
|
1484
|
-
* Examples:
|
|
1485
|
-
* - image/png
|
|
1486
|
-
* - image/jpeg
|
|
1487
|
-
* If an unsupported MIME type is provided, an error will be returned. For a
|
|
1488
|
-
* complete list of supported types, see [Supported file
|
|
1489
|
-
* formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
|
|
1490
|
-
*/
|
|
1491
|
-
mimeType?: string;
|
|
1492
|
-
}
|
|
1493
1648
|
/** Describes the options to customize dynamic retrieval. */
|
|
1494
1649
|
interface DynamicRetrievalConfig {
|
|
1495
1650
|
/**
|