@bodhiapp/ts-client 0.1.26 → 0.1.28

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 (33) hide show
  1. package/dist/anthropic.d.ts +1 -0
  2. package/dist/anthropic.js +20 -0
  3. package/dist/anthropic.mjs +2 -0
  4. package/dist/gemini.d.ts +1 -0
  5. package/dist/gemini.js +20 -0
  6. package/dist/gemini.mjs +2 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/openai.d.ts +1 -0
  9. package/dist/openai.js +20 -0
  10. package/dist/openai.mjs +2 -0
  11. package/dist/openapi-typescript/openapi-schema-anthropic.d.ts +3391 -0
  12. package/dist/openapi-typescript/openapi-schema-anthropic.ts +3392 -0
  13. package/dist/openapi-typescript/openapi-schema-gemini.d.ts +3708 -0
  14. package/dist/openapi-typescript/openapi-schema-gemini.ts +3709 -0
  15. package/dist/openapi-typescript/openapi-schema-oai.d.ts +4371 -0
  16. package/dist/openapi-typescript/openapi-schema-oai.ts +4372 -0
  17. package/dist/openapi-typescript/openapi-schema.d.ts +1453 -3111
  18. package/dist/openapi-typescript/openapi-schema.ts +1453 -3111
  19. package/dist/types/types.gen.d.ts +477 -1731
  20. package/dist/types/types.gen.ts +516 -1903
  21. package/dist/types-anthropic/index.d.ts +1 -0
  22. package/dist/types-anthropic/index.ts +2 -0
  23. package/dist/types-anthropic/types.gen.d.ts +2241 -0
  24. package/dist/types-anthropic/types.gen.ts +2416 -0
  25. package/dist/types-gemini/index.d.ts +1 -0
  26. package/dist/types-gemini/index.ts +2 -0
  27. package/dist/types-gemini/types.gen.d.ts +4622 -0
  28. package/dist/types-gemini/types.gen.ts +4849 -0
  29. package/dist/types-oai/index.d.ts +1 -0
  30. package/dist/types-oai/index.ts +2 -0
  31. package/dist/types-oai/types.gen.d.ts +4428 -0
  32. package/dist/types-oai/types.gen.ts +4810 -0
  33. package/package.json +39 -7
@@ -0,0 +1,4849 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ /**
4
+ * A response from `CountTextTokens`.
5
+ *
6
+ * It returns the model's `token_count` for the `prompt`.
7
+ */
8
+ export type CountTextTokensResponse = {
9
+ /**
10
+ * The number of tokens that the `model` tokenizes the `prompt` into.
11
+ *
12
+ * Always non-negative.
13
+ */
14
+ tokenCount?: number;
15
+ };
16
+
17
+ /**
18
+ * Config for thinking features.
19
+ */
20
+ export type ThinkingConfig = {
21
+ /**
22
+ * Optional. Controls the maximum depth of the model's internal reasoning process before
23
+ * it produces a response. If not specified, the default is HIGH. Recommended
24
+ * for Gemini 3 or later models. Use with earlier models results in an error.
25
+ */
26
+ thinkingLevel?: 'THINKING_LEVEL_UNSPECIFIED' | 'MINIMAL' | 'LOW' | 'MEDIUM' | 'HIGH';
27
+ /**
28
+ * The number of thoughts tokens that the model should generate.
29
+ */
30
+ thinkingBudget?: number;
31
+ /**
32
+ * Indicates whether to include thoughts in the response.
33
+ * If true, thoughts are returned only when available.
34
+ */
35
+ includeThoughts?: boolean;
36
+ };
37
+
38
+ /**
39
+ * Structured representation of a function declaration as defined by the
40
+ * [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included
41
+ * in this declaration are the function name and parameters. This
42
+ * FunctionDeclaration is a representation of a block of code that can be used
43
+ * as a `Tool` by the model and executed by the client.
44
+ */
45
+ export type FunctionDeclaration = {
46
+ /**
47
+ * Optional. Describes the output from this function in JSON Schema format. Reflects the
48
+ * Open API 3.03 Response Object. The Schema defines the type used for the
49
+ * response value of the function.
50
+ */
51
+ response?: Schema;
52
+ /**
53
+ * Optional. Describes the output from this function in JSON Schema format. The value
54
+ * specified by the schema is the response value of the function.
55
+ *
56
+ * This field is mutually exclusive with `response`.
57
+ */
58
+ responseJsonSchema?: unknown;
59
+ /**
60
+ * Required. A brief description of the function.
61
+ */
62
+ description: string;
63
+ /**
64
+ * Optional. Describes the parameters to the function in JSON Schema format. The schema
65
+ * must describe an object where the properties are the parameters to the
66
+ * function. For example:
67
+ *
68
+ * ```
69
+ * {
70
+ * "type": "object",
71
+ * "properties": {
72
+ * "name": { "type": "string" },
73
+ * "age": { "type": "integer" }
74
+ * },
75
+ * "additionalProperties": false,
76
+ * "required": ["name", "age"],
77
+ * "propertyOrdering": ["name", "age"]
78
+ * }
79
+ * ```
80
+ *
81
+ * This field is mutually exclusive with `parameters`.
82
+ */
83
+ parametersJsonSchema?: unknown;
84
+ /**
85
+ * Required. The name of the function.
86
+ * Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes,
87
+ * with a maximum length of 128.
88
+ */
89
+ name: string;
90
+ /**
91
+ * Optional. Describes the parameters to this function. Reflects the Open API 3.03
92
+ * Parameter Object string Key: the name of the parameter. Parameter names are
93
+ * case sensitive. Schema Value: the Schema defining the type used for the
94
+ * parameter.
95
+ */
96
+ parameters?: Schema;
97
+ /**
98
+ * Optional. Specifies the function Behavior.
99
+ * Currently only supported by the BidiGenerateContent method.
100
+ */
101
+ behavior?: 'UNSPECIFIED' | 'BLOCKING' | 'NON_BLOCKING';
102
+ };
103
+
104
+ /**
105
+ * Response for `ImportFile` to import a File API file with a `FileSearchStore`.
106
+ */
107
+ export type ImportFileResponse = {
108
+ /**
109
+ * The name of the `FileSearchStore` containing `Document`s.
110
+ * Example: `fileSearchStores/my-file-search-store-123`
111
+ */
112
+ parent?: string;
113
+ /**
114
+ * Immutable. Identifier. The identifier for the `Document` imported.
115
+ * Example:
116
+ * `fileSearchStores/my-file-search-store-123/documents/my-awesome-doc-123a456b789c`
117
+ */
118
+ documentName?: string;
119
+ };
120
+
121
+ /**
122
+ * Veo response.
123
+ */
124
+ export type PredictLongRunningGeneratedVideoResponse = {
125
+ /**
126
+ * The generated samples.
127
+ */
128
+ generatedSamples?: Array<Media>;
129
+ /**
130
+ * Returns if any videos were filtered due to RAI policies.
131
+ */
132
+ raiMediaFilteredCount?: number;
133
+ /**
134
+ * Returns rai failure reasons if any.
135
+ */
136
+ raiMediaFilteredReasons?: Array<string>;
137
+ };
138
+
139
+ /**
140
+ * Counts the number of tokens in the `prompt` sent to a model.
141
+ *
142
+ * Models may tokenize text differently, so each model may return a different
143
+ * `token_count`.
144
+ */
145
+ export type CountTextTokensRequest = {
146
+ /**
147
+ * Required. The free-form input text given to the model as a prompt.
148
+ */
149
+ prompt: TextPrompt;
150
+ };
151
+
152
+ /**
153
+ * A `FileSearchStore` is a collection of `Document`s.
154
+ */
155
+ export type FileSearchStore = {
156
+ /**
157
+ * Output only. The Timestamp of when the `FileSearchStore` was created.
158
+ */
159
+ readonly createTime?: string;
160
+ /**
161
+ * Output only. The number of documents in the `FileSearchStore` that have failed
162
+ * processing.
163
+ */
164
+ readonly failedDocumentsCount?: string;
165
+ /**
166
+ * Output only. The number of documents in the `FileSearchStore` that are being processed.
167
+ */
168
+ readonly pendingDocumentsCount?: string;
169
+ /**
170
+ * Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the
171
+ * "fileSearchStores/" prefix) that can contain up to 40 characters that are
172
+ * lowercase alphanumeric or dashes
173
+ * (-). It is output only. The unique name will be derived from
174
+ * `display_name` along with a 12 character random suffix. Example:
175
+ * `fileSearchStores/my-awesome-file-search-store-123a456b789c`
176
+ * If `display_name` is not provided, the name will be randomly generated.
177
+ */
178
+ readonly name?: string;
179
+ /**
180
+ * Optional. The human-readable display name for the `FileSearchStore`. The display name
181
+ * must be no more than 512 characters in length, including spaces. Example:
182
+ * "Docs on Semantic Retriever"
183
+ */
184
+ displayName?: string;
185
+ /**
186
+ * Output only. The number of documents in the `FileSearchStore` that are active and ready
187
+ * for retrieval.
188
+ */
189
+ readonly activeDocumentsCount?: string;
190
+ /**
191
+ * Output only. The Timestamp of when the `FileSearchStore` was last updated.
192
+ */
193
+ readonly updateTime?: string;
194
+ /**
195
+ * Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the
196
+ * total size of all the documents in the `FileSearchStore`.
197
+ */
198
+ readonly sizeBytes?: string;
199
+ };
200
+
201
+ /**
202
+ * Record for a single tuning step.
203
+ */
204
+ export type TuningSnapshot = {
205
+ /**
206
+ * Output only. The timestamp when this metric was computed.
207
+ */
208
+ readonly computeTime?: string;
209
+ /**
210
+ * Output only. The epoch this step was part of.
211
+ */
212
+ readonly epoch?: number;
213
+ /**
214
+ * Output only. The mean loss of the training examples for this step.
215
+ */
216
+ readonly meanLoss?: number;
217
+ /**
218
+ * Output only. The tuning step.
219
+ */
220
+ readonly step?: number;
221
+ };
222
+
223
+ /**
224
+ * The request to be processed in the batch.
225
+ */
226
+ export type InlinedEmbedContentRequest = {
227
+ /**
228
+ * Required. The request to be processed in the batch.
229
+ */
230
+ request: EmbedContentRequest;
231
+ /**
232
+ * Optional. The metadata to be associated with the request.
233
+ */
234
+ metadata?: {};
235
+ };
236
+
237
+ /**
238
+ * An input/output example used to instruct the Model.
239
+ *
240
+ * It demonstrates how the model should respond or format its response.
241
+ */
242
+ export type Example = {
243
+ /**
244
+ * Required. An example of an input `Message` from the user.
245
+ */
246
+ input: Message;
247
+ /**
248
+ * Required. An example of what the model should output given the input.
249
+ */
250
+ output: Message;
251
+ };
252
+
253
+ /**
254
+ * Request message for PredictionService.Predict.
255
+ */
256
+ export type PredictRequest = {
257
+ /**
258
+ * Required. The instances that are the input to the prediction call.
259
+ */
260
+ instances: Array<unknown>;
261
+ /**
262
+ * Optional. The parameters that govern the prediction call.
263
+ */
264
+ parameters?: unknown;
265
+ };
266
+
267
+ /**
268
+ * Raw media bytes.
269
+ *
270
+ * Text should not be sent as raw bytes, use the 'text' field.
271
+ */
272
+ export type Blob = {
273
+ /**
274
+ * The IANA standard MIME type of the source data.
275
+ * Examples:
276
+ * - image/png
277
+ * - image/jpeg
278
+ * If an unsupported MIME type is provided, an error will be returned. For a
279
+ * complete list of supported types, see [Supported file
280
+ * formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
281
+ */
282
+ mimeType?: string;
283
+ /**
284
+ * Raw bytes for media formats.
285
+ */
286
+ data?: string;
287
+ };
288
+
289
+ export type GenerativeLanguageModality = 'MODALITY_UNSPECIFIED' | 'TEXT' | 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT';
290
+
291
+ /**
292
+ * Metadata on the generation request's token usage.
293
+ */
294
+ export type UsageMetadata = {
295
+ /**
296
+ * Total token count for the generation request (prompt + response
297
+ * candidates).
298
+ */
299
+ totalTokenCount?: number;
300
+ /**
301
+ * Output only. Number of tokens present in tool-use prompt(s).
302
+ */
303
+ readonly toolUsePromptTokenCount?: number;
304
+ /**
305
+ * Output only. List of modalities of the cached content in the request input.
306
+ */
307
+ readonly cacheTokensDetails?: Array<ModalityTokenCount>;
308
+ /**
309
+ * Number of tokens in the prompt. When `cached_content` is set, this is
310
+ * still the total effective prompt size meaning this includes the number of
311
+ * tokens in the cached content.
312
+ */
313
+ promptTokenCount?: number;
314
+ /**
315
+ * Output only. List of modalities that were returned in the response.
316
+ */
317
+ readonly candidatesTokensDetails?: Array<ModalityTokenCount>;
318
+ /**
319
+ * Output only. List of modalities that were processed for tool-use request inputs.
320
+ */
321
+ readonly toolUsePromptTokensDetails?: Array<ModalityTokenCount>;
322
+ /**
323
+ * Number of tokens in the cached part of the prompt (the cached content)
324
+ */
325
+ cachedContentTokenCount?: number;
326
+ /**
327
+ * Output only. Number of tokens of thoughts for thinking models.
328
+ */
329
+ readonly thoughtsTokenCount?: number;
330
+ /**
331
+ * Output only. List of modalities that were processed in the request input.
332
+ */
333
+ readonly promptTokensDetails?: Array<ModalityTokenCount>;
334
+ /**
335
+ * Total number of tokens across all the generated response candidates.
336
+ */
337
+ candidatesTokenCount?: number;
338
+ };
339
+
340
+ /**
341
+ * Response from the model for a grounded answer.
342
+ */
343
+ export type GenerateAnswerResponse = {
344
+ /**
345
+ * Candidate answer from the model.
346
+ *
347
+ * Note: The model *always* attempts to provide a grounded answer, even when
348
+ * the answer is unlikely to be answerable from the given passages.
349
+ * In that case, a low-quality or ungrounded answer may be provided, along
350
+ * with a low `answerable_probability`.
351
+ */
352
+ answer?: Candidate;
353
+ /**
354
+ * Output only. The model's estimate of the probability that its answer is correct and
355
+ * grounded in the input passages.
356
+ *
357
+ * A low `answerable_probability` indicates that the answer might not be
358
+ * grounded in the sources.
359
+ *
360
+ * When `answerable_probability` is low, you may want to:
361
+ *
362
+ * * Display a message to the effect of "We couldn’t answer that question" to
363
+ * the user.
364
+ * * Fall back to a general-purpose LLM that answers the question from world
365
+ * knowledge. The threshold and nature of such fallbacks will depend on
366
+ * individual use cases. `0.5` is a good starting threshold.
367
+ */
368
+ readonly answerableProbability?: number;
369
+ /**
370
+ * Output only. Feedback related to the input data used to answer the question, as opposed
371
+ * to the model-generated response to the question.
372
+ *
373
+ * The input data can be one or more of the following:
374
+ *
375
+ * - Question specified by the last entry in `GenerateAnswerRequest.content`
376
+ * - Conversation history specified by the other entries in
377
+ * `GenerateAnswerRequest.content`
378
+ * - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or
379
+ * `GenerateAnswerRequest.inline_passages`)
380
+ */
381
+ inputFeedback?: InputFeedback;
382
+ };
383
+
384
+ /**
385
+ * Stats about the batch.
386
+ */
387
+ export type EmbedContentBatchStats = {
388
+ /**
389
+ * Output only. The number of requests in the batch.
390
+ */
391
+ readonly requestCount?: string;
392
+ /**
393
+ * Output only. The number of requests that were successfully processed.
394
+ */
395
+ readonly successfulRequestCount?: string;
396
+ /**
397
+ * Output only. The number of requests that are still pending processing.
398
+ */
399
+ readonly pendingRequestCount?: string;
400
+ /**
401
+ * Output only. The number of requests that failed to be processed.
402
+ */
403
+ readonly failedRequestCount?: string;
404
+ };
405
+
406
+ /**
407
+ * A fine-tuned model created using ModelService.CreateTunedModel.
408
+ */
409
+ export type TunedModel = {
410
+ /**
411
+ * Optional. A short description of this model.
412
+ */
413
+ description?: string;
414
+ /**
415
+ * Optional. Controls the randomness of the output.
416
+ *
417
+ * Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will
418
+ * produce responses that are more varied, while a value closer to `0.0` will
419
+ * typically result in less surprising responses from the model.
420
+ *
421
+ * This value specifies default to be the one used by the base model while
422
+ * creating the model.
423
+ */
424
+ temperature?: number;
425
+ /**
426
+ * Optional. The name to display for this model in user interfaces.
427
+ * The display name must be up to 40 characters including spaces.
428
+ */
429
+ displayName?: string;
430
+ /**
431
+ * Optional. List of project numbers that have read access to the tuned model.
432
+ */
433
+ readerProjectNumbers?: Array<string>;
434
+ /**
435
+ * Output only. The timestamp when this model was created.
436
+ */
437
+ readonly createTime?: string;
438
+ /**
439
+ * Optional. For Nucleus sampling.
440
+ *
441
+ * Nucleus sampling considers the smallest set of tokens whose probability
442
+ * sum is at least `top_p`.
443
+ *
444
+ * This value specifies default to be the one used by the base model while
445
+ * creating the model.
446
+ */
447
+ topP?: number;
448
+ /**
449
+ * Required. The tuning task that creates the tuned model.
450
+ */
451
+ tuningTask: TuningTask;
452
+ /**
453
+ * Output only. The timestamp when this model was updated.
454
+ */
455
+ readonly updateTime?: string;
456
+ /**
457
+ * Output only. The tuned model name. A unique name will be generated on create.
458
+ * Example: `tunedModels/az2mb0bpw6i`
459
+ * If display_name is set on create, the id portion of the name will be set
460
+ * by concatenating the words of the display_name with hyphens and adding a
461
+ * random portion for uniqueness.
462
+ *
463
+ * Example:
464
+ *
465
+ * * display_name = `Sentence Translator`
466
+ * * name = `tunedModels/sentence-translator-u3b7m`
467
+ */
468
+ readonly name?: string;
469
+ /**
470
+ * Output only. The state of the tuned model.
471
+ */
472
+ state?: 'STATE_UNSPECIFIED' | 'CREATING' | 'ACTIVE' | 'FAILED';
473
+ /**
474
+ * Immutable. The name of the `Model` to tune.
475
+ * Example: `models/gemini-1.5-flash-001`
476
+ */
477
+ baseModel?: string;
478
+ /**
479
+ * Optional. For Top-k sampling.
480
+ *
481
+ * Top-k sampling considers the set of `top_k` most probable tokens.
482
+ * This value specifies default to be used by the backend while making the
483
+ * call to the model.
484
+ *
485
+ * This value specifies default to be the one used by the base model while
486
+ * creating the model.
487
+ */
488
+ topK?: number;
489
+ /**
490
+ * Optional. TunedModel to use as the starting point for training the new model.
491
+ */
492
+ tunedModelSource?: TunedModelSource;
493
+ };
494
+
495
+ /**
496
+ * Tuning tasks that create tuned models.
497
+ */
498
+ export type TuningTask = {
499
+ /**
500
+ * Output only. The timestamp when tuning this model started.
501
+ */
502
+ readonly startTime?: string;
503
+ /**
504
+ * Output only. The timestamp when tuning this model completed.
505
+ */
506
+ readonly completeTime?: string;
507
+ /**
508
+ * Required. Input only. Immutable. The model training data.
509
+ */
510
+ trainingData: Dataset;
511
+ /**
512
+ * Output only. Metrics collected during tuning.
513
+ */
514
+ readonly snapshots?: Array<TuningSnapshot>;
515
+ /**
516
+ * Immutable. Hyperparameters controlling the tuning process. If not provided, default
517
+ * values will be used.
518
+ */
519
+ hyperparameters?: Hyperparameters;
520
+ };
521
+
522
+ /**
523
+ * A response from `CountMessageTokens`.
524
+ *
525
+ * It returns the model's `token_count` for the `prompt`.
526
+ */
527
+ export type CountMessageTokensResponse = {
528
+ /**
529
+ * The number of tokens that the `model` tokenizes the `prompt` into.
530
+ *
531
+ * Always non-negative.
532
+ */
533
+ tokenCount?: number;
534
+ };
535
+
536
+ /**
537
+ * The status of the underlying model. This is used to indicate the stage of the
538
+ * underlying model and the retirement time if applicable.
539
+ */
540
+ export type ModelStatus = {
541
+ /**
542
+ * The time at which the model will be retired.
543
+ */
544
+ retirementTime?: string;
545
+ /**
546
+ * The stage of the underlying model.
547
+ */
548
+ modelStage?: ModelStage;
549
+ /**
550
+ * A message explaining the model status.
551
+ */
552
+ message?: string;
553
+ };
554
+
555
+ /**
556
+ * Response for `DownloadFile`.
557
+ */
558
+ export type DownloadFileResponse = {
559
+ [key: string]: unknown;
560
+ };
561
+
562
+ /**
563
+ * Metadata about the state and progress of creating a tuned model returned from
564
+ * the long-running operation
565
+ */
566
+ export type CreateTunedModelMetadata = {
567
+ /**
568
+ * The total number of tuning steps.
569
+ */
570
+ totalSteps?: number;
571
+ /**
572
+ * The number of steps completed.
573
+ */
574
+ completedSteps?: number;
575
+ /**
576
+ * The completed percentage for the tuning operation.
577
+ */
578
+ completedPercent?: number;
579
+ /**
580
+ * Metrics collected during tuning.
581
+ */
582
+ snapshots?: Array<TuningSnapshot>;
583
+ /**
584
+ * Name of the tuned model associated with the tuning operation.
585
+ */
586
+ tunedModel?: string;
587
+ };
588
+
589
+ /**
590
+ * Metadata for LongRunning UploadToFileSearchStore Operations.
591
+ */
592
+ export type UploadToFileSearchStoreMetadata = {
593
+ [key: string]: unknown;
594
+ };
595
+
596
+ /**
597
+ * A predicted `FunctionCall` returned from the model that contains
598
+ * a string representing the `FunctionDeclaration.name` with the
599
+ * arguments and their values.
600
+ */
601
+ export type FunctionCall = {
602
+ /**
603
+ * Optional. The function parameters and values in JSON object format.
604
+ */
605
+ args?: {};
606
+ /**
607
+ * Optional. Unique identifier of the function call. If populated, the client to
608
+ * execute the `function_call` and return the response with the matching `id`.
609
+ */
610
+ id?: string;
611
+ /**
612
+ * Required. The name of the function to call.
613
+ * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
614
+ * length of 128.
615
+ */
616
+ name: string;
617
+ };
618
+
619
+ /**
620
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
621
+ */
622
+ export type PredictLongRunningOperation = BaseOperation & {
623
+ metadata?: PredictLongRunningMetadata;
624
+ response?: PredictLongRunningResponse;
625
+ };
626
+
627
+ /**
628
+ * Chunk from context retrieved by the file search tool.
629
+ */
630
+ export type RetrievedContext = {
631
+ /**
632
+ * Optional. Title of the document.
633
+ */
634
+ title?: string;
635
+ /**
636
+ * Optional. Name of the `FileSearchStore` containing the document.
637
+ * Example: `fileSearchStores/123`
638
+ */
639
+ fileSearchStore?: string;
640
+ /**
641
+ * Optional. URI reference of the semantic retrieval document.
642
+ */
643
+ uri?: string;
644
+ /**
645
+ * Optional. Text of the chunk.
646
+ */
647
+ text?: string;
648
+ /**
649
+ * Optional. User-provided metadata about the retrieved context.
650
+ */
651
+ customMetadata?: Array<GroundingChunkCustomMetadata>;
652
+ };
653
+
654
+ /**
655
+ * Candidates with top log probabilities at each decoding step.
656
+ */
657
+ export type TopCandidates = {
658
+ /**
659
+ * Sorted by log probability in descending order.
660
+ */
661
+ candidates?: Array<LogprobsResultCandidate>;
662
+ };
663
+
664
+ /**
665
+ * Identifier for the source contributing to this attribution.
666
+ */
667
+ export type AttributionSourceId = {
668
+ /**
669
+ * Identifier for an inline passage.
670
+ */
671
+ groundingPassage?: GroundingPassageId;
672
+ /**
673
+ * Identifier for a `Chunk` fetched via Semantic Retriever.
674
+ */
675
+ semanticRetrieverChunk?: SemanticRetrieverChunk;
676
+ };
677
+
678
+ /**
679
+ * Response from `TransferOwnership`.
680
+ */
681
+ export type TransferOwnershipResponse = {
682
+ [key: string]: unknown;
683
+ };
684
+
685
+ /**
686
+ * A resource representing a batch of `EmbedContent` requests.
687
+ */
688
+ export type EmbedContentBatch = {
689
+ /**
690
+ * Required. The name of the `Model` to use for generating the completion.
691
+ *
692
+ * Format: `models/{model}`.
693
+ */
694
+ model: string;
695
+ /**
696
+ * Required. The user-defined name of this batch.
697
+ */
698
+ displayName: string;
699
+ /**
700
+ * Output only. Identifier. Resource name of the batch.
701
+ *
702
+ * Format: `batches/{batch_id}`.
703
+ */
704
+ readonly name?: string;
705
+ /**
706
+ * Output only. The output of the batch request.
707
+ */
708
+ output?: EmbedContentBatchOutput;
709
+ /**
710
+ * Output only. The time at which the batch was last updated.
711
+ */
712
+ readonly updateTime?: string;
713
+ /**
714
+ * Output only. Stats about the batch.
715
+ */
716
+ batchStats?: EmbedContentBatchStats;
717
+ /**
718
+ * Output only. The time at which the batch was created.
719
+ */
720
+ readonly createTime?: string;
721
+ /**
722
+ * Output only. The time at which the batch processing completed.
723
+ */
724
+ readonly endTime?: string;
725
+ /**
726
+ * Output only. The state of the batch.
727
+ */
728
+ state?: BatchState;
729
+ /**
730
+ * Optional. The priority of the batch. Batches with a higher priority value will be
731
+ * processed before batches with a lower priority value. Negative values are
732
+ * allowed. Default is 0.
733
+ */
734
+ priority?: string;
735
+ /**
736
+ * Required. Input configuration of the instances on which batch processing
737
+ * are performed.
738
+ */
739
+ inputConfig: InputEmbedContentConfig;
740
+ };
741
+
742
+ /**
743
+ * Text given to the model as a prompt.
744
+ *
745
+ * The Model will use this TextPrompt to Generate a text completion.
746
+ */
747
+ export type TextPrompt = {
748
+ /**
749
+ * Required. The prompt text.
750
+ */
751
+ text: string;
752
+ };
753
+
754
+ /**
755
+ * The output from a server-side `ToolCall` execution. This message contains
756
+ * the results of a tool invocation that was initiated by a `ToolCall`
757
+ * from the model. The client should pass this `ToolResponse` back to the API
758
+ * in a subsequent turn within a `Content` message, along with the corresponding
759
+ * `ToolCall`.
760
+ */
761
+ export type ToolResponse = {
762
+ /**
763
+ * Optional. The identifier of the tool call this response is for.
764
+ */
765
+ id?: string;
766
+ /**
767
+ * Required. The type of tool that was called, matching the `tool_type` in the
768
+ * corresponding `ToolCall`.
769
+ */
770
+ toolType: ToolType;
771
+ /**
772
+ * Optional. The tool response.
773
+ */
774
+ response?: {};
775
+ };
776
+
777
+ /**
778
+ * Configuration for retrieving grounding content from a `Corpus` or
779
+ * `Document` created using the Semantic Retriever API.
780
+ */
781
+ export type SemanticRetrieverConfig = {
782
+ /**
783
+ * Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.
784
+ */
785
+ metadataFilters?: Array<MetadataFilter>;
786
+ /**
787
+ * Required. Query to use for matching `Chunk`s in the given resource by similarity.
788
+ */
789
+ query: Content;
790
+ /**
791
+ * Required. Name of the resource for retrieval. Example: `corpora/123` or
792
+ * `corpora/123/documents/abc`.
793
+ */
794
+ source: string;
795
+ /**
796
+ * Optional. Maximum number of relevant `Chunk`s to retrieve.
797
+ */
798
+ maxChunksCount?: number;
799
+ /**
800
+ * Optional. Minimum relevance score for retrieved relevant `Chunk`s.
801
+ */
802
+ minimumRelevanceScore?: number;
803
+ };
804
+
805
+ /**
806
+ * Response for `RegisterFiles`.
807
+ */
808
+ export type RegisterFilesResponse = {
809
+ /**
810
+ * The registered files to be used when calling GenerateContent.
811
+ */
812
+ files?: Array<File>;
813
+ };
814
+
815
+ /**
816
+ * Logprobs Result
817
+ */
818
+ export type LogprobsResult = {
819
+ /**
820
+ * Length = total number of decoding steps.
821
+ */
822
+ topCandidates?: Array<TopCandidates>;
823
+ /**
824
+ * Length = total number of decoding steps.
825
+ * The chosen candidates may or may not be in top_candidates.
826
+ */
827
+ chosenCandidates?: Array<LogprobsResultCandidate>;
828
+ /**
829
+ * Sum of log probabilities for all tokens.
830
+ */
831
+ logProbabilitySum?: number;
832
+ };
833
+
834
+ /**
835
+ * Configures the input to the batch request.
836
+ */
837
+ export type InputEmbedContentConfig = {
838
+ /**
839
+ * The requests to be processed in the batch.
840
+ */
841
+ requests?: InlinedEmbedContentRequests;
842
+ /**
843
+ * The name of the `File` containing the input requests.
844
+ */
845
+ fileName?: string;
846
+ };
847
+
848
+ /**
849
+ * The configuration for a single speaker in a multi speaker setup.
850
+ */
851
+ export type SpeakerVoiceConfig = {
852
+ /**
853
+ * Required. The name of the speaker to use. Should be the same as in the prompt.
854
+ */
855
+ speaker: string;
856
+ /**
857
+ * Required. The configuration for the voice to use.
858
+ */
859
+ voiceConfig: VoiceConfig;
860
+ };
861
+
862
+ /**
863
+ * The response to an `EmbedContentRequest`.
864
+ */
865
+ export type EmbedContentResponse = {
866
+ /**
867
+ * Output only. The embedding generated from the input content.
868
+ */
869
+ embedding?: ContentEmbedding;
870
+ /**
871
+ * Output only. The usage metadata for the request.
872
+ */
873
+ usageMetadata?: EmbeddingUsageMetadata;
874
+ };
875
+
876
+ /**
877
+ * A datatype containing media that is part of a multi-part `Content` message.
878
+ *
879
+ * A `Part` consists of data which has an associated datatype. A `Part` can only
880
+ * contain one of the accepted types in `Part.data`.
881
+ *
882
+ * A `Part` must have a fixed IANA MIME type identifying the type and subtype
883
+ * of the media if the `inline_data` field is filled with raw bytes.
884
+ */
885
+ export type Part = {
886
+ /**
887
+ * Optional. An opaque signature for the thought so it can be reused in subsequent
888
+ * requests.
889
+ */
890
+ thoughtSignature?: string;
891
+ /**
892
+ * Inline text.
893
+ */
894
+ text?: string;
895
+ /**
896
+ * Optional. Video metadata. The metadata should only be specified while the video
897
+ * data is presented in inline_data or file_data.
898
+ */
899
+ videoMetadata?: VideoMetadata;
900
+ /**
901
+ * Optional. Indicates if the part is thought from the model.
902
+ */
903
+ thought?: boolean;
904
+ /**
905
+ * A predicted `FunctionCall` returned from the model that contains
906
+ * a string representing the `FunctionDeclaration.name` with the
907
+ * arguments and their values.
908
+ */
909
+ functionCall?: FunctionCall;
910
+ /**
911
+ * URI based data.
912
+ */
913
+ fileData?: FileData;
914
+ /**
915
+ * The result output of a `FunctionCall` that contains a string
916
+ * representing the `FunctionDeclaration.name` and a structured JSON
917
+ * object containing any output from the function is used as context to
918
+ * the model.
919
+ */
920
+ functionResponse?: FunctionResponse;
921
+ /**
922
+ * Result of executing the `ExecutableCode`.
923
+ */
924
+ codeExecutionResult?: CodeExecutionResult;
925
+ /**
926
+ * Code generated by the model that is meant to be executed.
927
+ */
928
+ executableCode?: ExecutableCode;
929
+ /**
930
+ * Custom metadata associated with the Part.
931
+ * Agents using genai.Part as content representation may need to keep track
932
+ * of the additional information. For example it can be name of a file/source
933
+ * from which the Part originates or a way to multiplex multiple Part streams.
934
+ */
935
+ partMetadata?: {};
936
+ /**
937
+ * Optional. Media resolution for the input media.
938
+ */
939
+ mediaResolution?: MediaResolution;
940
+ /**
941
+ * Server-side tool call. This field is populated when the model
942
+ * predicts a tool invocation that should be executed on the server.
943
+ * The client is expected to echo this message back to the API.
944
+ */
945
+ toolCall?: ToolCall;
946
+ /**
947
+ * The output from a server-side `ToolCall` execution. This field is
948
+ * populated by the client with the results of executing the
949
+ * corresponding `ToolCall`.
950
+ */
951
+ toolResponse?: ToolResponse;
952
+ /**
953
+ * Inline media bytes.
954
+ */
955
+ inlineData?: Blob;
956
+ };
957
+
958
+ /**
959
+ * Response message for [PredictionService.PredictLongRunning]
960
+ */
961
+ export type PredictLongRunningResponse = {
962
+ /**
963
+ * The response of the video generation prediction.
964
+ */
965
+ generateVideoResponse?: PredictLongRunningGeneratedVideoResponse;
966
+ };
967
+
968
+ /**
969
+ * A response candidate generated from the model.
970
+ */
971
+ export type Candidate = {
972
+ /**
973
+ * Optional. Output only. Details the reason why the model stopped generating tokens.
974
+ * This is populated only when `finish_reason` is set.
975
+ */
976
+ readonly finishMessage?: string;
977
+ /**
978
+ * Output only. Generated content returned from the model.
979
+ */
980
+ content?: Content;
981
+ /**
982
+ * Output only. Index of the candidate in the list of response candidates.
983
+ */
984
+ readonly index?: number;
985
+ /**
986
+ * Optional. Output only. The reason why the model stopped generating tokens.
987
+ *
988
+ * If empty, the model has not stopped generating tokens.
989
+ */
990
+ finishReason?: 'FINISH_REASON_UNSPECIFIED' | 'STOP' | 'MAX_TOKENS' | 'SAFETY' | 'RECITATION' | 'LANGUAGE' | 'OTHER' | 'BLOCKLIST' | 'PROHIBITED_CONTENT' | 'SPII' | 'MALFORMED_FUNCTION_CALL' | 'IMAGE_SAFETY' | 'IMAGE_PROHIBITED_CONTENT' | 'IMAGE_OTHER' | 'NO_IMAGE' | 'IMAGE_RECITATION' | 'UNEXPECTED_TOOL_CALL' | 'TOO_MANY_TOOL_CALLS' | 'MISSING_THOUGHT_SIGNATURE' | 'MALFORMED_RESPONSE';
991
+ /**
992
+ * List of ratings for the safety of a response candidate.
993
+ *
994
+ * There is at most one rating per category.
995
+ */
996
+ safetyRatings?: Array<SafetyRating>;
997
+ /**
998
+ * Output only. Attribution information for sources that contributed to a grounded answer.
999
+ *
1000
+ * This field is populated for `GenerateAnswer` calls.
1001
+ */
1002
+ readonly groundingAttributions?: Array<GroundingAttribution>;
1003
+ /**
1004
+ * Output only. Citation information for model-generated candidate.
1005
+ *
1006
+ * This field may be populated with recitation information for any text
1007
+ * included in the `content`. These are passages that are "recited" from
1008
+ * copyrighted material in the foundational LLM's training data.
1009
+ */
1010
+ citationMetadata?: CitationMetadata;
1011
+ /**
1012
+ * Output only. Grounding metadata for the candidate.
1013
+ *
1014
+ * This field is populated for `GenerateContent` calls.
1015
+ */
1016
+ groundingMetadata?: GroundingMetadata;
1017
+ /**
1018
+ * Output only. Average log probability score of the candidate.
1019
+ */
1020
+ readonly avgLogprobs?: number;
1021
+ /**
1022
+ * Output only. Metadata related to url context retrieval tool.
1023
+ */
1024
+ urlContextMetadata?: UrlContextMetadata;
1025
+ /**
1026
+ * Output only. Log-likelihood scores for the response tokens and top tokens
1027
+ */
1028
+ logprobsResult?: LogprobsResult;
1029
+ /**
1030
+ * Output only. Token count for this candidate.
1031
+ */
1032
+ readonly tokenCount?: number;
1033
+ };
1034
+
1035
+ /**
1036
+ * A datatype containing media that is part of a `FunctionResponse` message.
1037
+ *
1038
+ * A `FunctionResponsePart` consists of data which has an associated datatype. A
1039
+ * `FunctionResponsePart` can only contain one of the accepted types in
1040
+ * `FunctionResponsePart.data`.
1041
+ *
1042
+ * A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
1043
+ * type and subtype of the media if the `inline_data` field is filled with raw
1044
+ * bytes.
1045
+ */
1046
+ export type FunctionResponsePart = {
1047
+ /**
1048
+ * Inline media bytes.
1049
+ */
1050
+ inlineData?: FunctionResponseBlob;
1051
+ };
1052
+
1053
+ /**
1054
+ * Content that has been preprocessed and can be used in subsequent request
1055
+ * to GenerativeService.
1056
+ *
1057
+ * Cached content can be only used with model it was created for.
1058
+ */
1059
+ export type CachedContent = {
1060
+ /**
1061
+ * Optional. Input only. Immutable. Developer set system instruction. Currently text only.
1062
+ */
1063
+ systemInstruction?: Content;
1064
+ /**
1065
+ * Output only. Metadata on the usage of the cached content.
1066
+ */
1067
+ usageMetadata?: CachedContentUsageMetadata;
1068
+ /**
1069
+ * Output only. Creation time of the cache entry.
1070
+ */
1071
+ readonly createTime?: string;
1072
+ /**
1073
+ * Timestamp in UTC of when this resource is considered expired.
1074
+ * This is *always* provided on output, regardless of what was sent
1075
+ * on input.
1076
+ */
1077
+ expireTime?: string;
1078
+ /**
1079
+ * Optional. Input only. Immutable. The content to cache.
1080
+ */
1081
+ contents?: Array<Content>;
1082
+ /**
1083
+ * Output only. When the cache entry was last updated in UTC time.
1084
+ */
1085
+ readonly updateTime?: string;
1086
+ /**
1087
+ * Input only. New TTL for this resource, input only.
1088
+ */
1089
+ ttl?: string;
1090
+ /**
1091
+ * Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
1092
+ */
1093
+ tools?: Array<Tool>;
1094
+ /**
1095
+ * Output only. Identifier. The resource name referring to the cached content.
1096
+ * Format: `cachedContents/{id}`
1097
+ */
1098
+ readonly name?: string;
1099
+ /**
1100
+ * Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum
1101
+ * 128 Unicode characters.
1102
+ */
1103
+ displayName?: string;
1104
+ /**
1105
+ * Required. Immutable. The name of the `Model` to use for cached content
1106
+ * Format: `models/{model}`
1107
+ */
1108
+ model: string;
1109
+ /**
1110
+ * Optional. Input only. Immutable. Tool config. This config is shared for all tools.
1111
+ */
1112
+ toolConfig?: ToolConfig;
1113
+ };
1114
+
1115
+ /**
1116
+ * Identifier for a part within a `GroundingPassage`.
1117
+ */
1118
+ export type GroundingPassageId = {
1119
+ /**
1120
+ * Output only. ID of the passage matching the `GenerateAnswerRequest`'s
1121
+ * `GroundingPassage.id`.
1122
+ */
1123
+ readonly passageId?: string;
1124
+ /**
1125
+ * Output only. Index of the part within the `GenerateAnswerRequest`'s
1126
+ * `GroundingPassage.content`.
1127
+ */
1128
+ readonly partIndex?: number;
1129
+ };
1130
+
1131
+ /**
1132
+ * Different types of search that can be enabled on the GoogleSearch tool.
1133
+ */
1134
+ export type SearchTypes = {
1135
+ /**
1136
+ * Optional. Enables web search. Only text results are returned.
1137
+ */
1138
+ webSearch?: WebSearch;
1139
+ /**
1140
+ * Optional. Enables image search. Image bytes are returned.
1141
+ */
1142
+ imageSearch?: ImageSearch;
1143
+ };
1144
+
1145
+ /**
1146
+ * A proto encapsulate various type of media.
1147
+ */
1148
+ export type Media = {
1149
+ /**
1150
+ * Video as the only one for now. This is mimicking Vertex proto.
1151
+ */
1152
+ video?: Video;
1153
+ };
1154
+
1155
+ /**
1156
+ * Request to generate a completion from the model.
1157
+ */
1158
+ export type GenerateContentRequest = {
1159
+ /**
1160
+ * Required. The name of the `Model` to use for generating the completion.
1161
+ *
1162
+ * Format: `models/{model}`.
1163
+ */
1164
+ model: string;
1165
+ /**
1166
+ * Optional. Tool configuration for any `Tool` specified in the request. Refer to the
1167
+ * [Function calling
1168
+ * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode)
1169
+ * for a usage example.
1170
+ */
1171
+ toolConfig?: ToolConfig;
1172
+ /**
1173
+ * Optional. Configuration options for model generation and outputs.
1174
+ */
1175
+ generationConfig?: GenerationConfig;
1176
+ /**
1177
+ * Optional. A list of `Tools` the `Model` may use to generate the next response.
1178
+ *
1179
+ * A `Tool` is a piece of code that enables the system to interact with
1180
+ * external systems to perform an action, or set of actions, outside of
1181
+ * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and
1182
+ * `code_execution`. Refer to the [Function
1183
+ * calling](https://ai.google.dev/gemini-api/docs/function-calling) and the
1184
+ * [Code execution](https://ai.google.dev/gemini-api/docs/code-execution)
1185
+ * guides to learn more.
1186
+ */
1187
+ tools?: Array<Tool>;
1188
+ /**
1189
+ * Required. The content of the current conversation with the model.
1190
+ *
1191
+ * For single-turn queries, this is a single instance. For multi-turn queries
1192
+ * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat),
1193
+ * this is a repeated field that contains the conversation history and the
1194
+ * latest request.
1195
+ */
1196
+ contents: Array<Content>;
1197
+ /**
1198
+ * Optional. The name of the content
1199
+ * [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context
1200
+ * to serve the prediction. Format: `cachedContents/{cachedContent}`
1201
+ */
1202
+ cachedContent?: string;
1203
+ /**
1204
+ * Optional. A list of unique `SafetySetting` instances for blocking unsafe content.
1205
+ *
1206
+ * This will be enforced on the `GenerateContentRequest.contents` and
1207
+ * `GenerateContentResponse.candidates`. There should not be more than one
1208
+ * setting for each `SafetyCategory` type. The API will block any contents and
1209
+ * responses that fail to meet the thresholds set by these settings. This list
1210
+ * overrides the default settings for each `SafetyCategory` specified in the
1211
+ * safety_settings. If there is no `SafetySetting` for a given
1212
+ * `SafetyCategory` provided in the list, the API will use the default safety
1213
+ * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,
1214
+ * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
1215
+ * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported.
1216
+ * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings)
1217
+ * for detailed information on available safety settings. Also refer to the
1218
+ * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to
1219
+ * learn how to incorporate safety considerations in your AI applications.
1220
+ */
1221
+ safetySettings?: Array<SafetySetting>;
1222
+ /**
1223
+ * Optional. The service tier of the request.
1224
+ */
1225
+ serviceTier?: ServiceTier;
1226
+ /**
1227
+ * Optional. Developer set [system
1228
+ * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions).
1229
+ * Currently, text only.
1230
+ */
1231
+ systemInstruction?: Content;
1232
+ /**
1233
+ * Optional. Configures the logging behavior for a given request. If set, it takes
1234
+ * precedence over the project-level logging config.
1235
+ */
1236
+ store?: boolean;
1237
+ };
1238
+
1239
+ /**
1240
+ * Counts the number of tokens in the `prompt` sent to a model.
1241
+ *
1242
+ * Models may tokenize text differently, so each model may return a different
1243
+ * `token_count`.
1244
+ */
1245
+ export type CountMessageTokensRequest = {
1246
+ /**
1247
+ * Required. The prompt, whose token count is to be returned.
1248
+ */
1249
+ prompt: MessagePrompt;
1250
+ };
1251
+
1252
+ export type ServiceTier = 'unspecified' | 'standard' | 'flex' | 'priority';
1253
+
1254
+ /**
1255
+ * This resource represents a long-running operation that is the result of a
1256
+ * network API call.
1257
+ */
1258
+ export type BaseOperation = {
1259
+ /**
1260
+ * If the value is `false`, it means the operation is still in progress.
1261
+ * If `true`, the operation is completed, and either `error` or `response` is
1262
+ * available.
1263
+ */
1264
+ done?: boolean;
1265
+ /**
1266
+ * The error result of the operation in case of failure or cancellation.
1267
+ */
1268
+ error?: Status;
1269
+ /**
1270
+ * The server-assigned name, which is only unique within the same service that
1271
+ * originally returns it. If you use the default HTTP mapping, the
1272
+ * `name` should be a resource name ending with `operations/{unique_id}`.
1273
+ */
1274
+ name?: string;
1275
+ };
1276
+
1277
+ /**
1278
+ * Collection of sources that provide answers about the features of a given
1279
+ * place in Google Maps. Each PlaceAnswerSources message corresponds to a
1280
+ * specific place in Google Maps. The Google Maps tool used these sources in
1281
+ * order to answer questions about features of the place (e.g: "does Bar Foo
1282
+ * have Wifi" or "is Foo Bar wheelchair accessible?"). Currently we only
1283
+ * support review snippets as sources.
1284
+ */
1285
+ export type PlaceAnswerSources = {
1286
+ /**
1287
+ * Snippets of reviews that are used to generate answers about the
1288
+ * features of a given place in Google Maps.
1289
+ */
1290
+ reviewSnippets?: Array<ReviewSnippet>;
1291
+ };
1292
+
1293
+ /**
1294
+ * Metadata related to retrieval in the grounding flow.
1295
+ */
1296
+ export type RetrievalMetadata = {
1297
+ /**
1298
+ * Optional. Score indicating how likely information from google search could help
1299
+ * answer the prompt. The score is in the range [0, 1], where 0 is the least
1300
+ * likely and 1 is the most likely. This score is only populated when
1301
+ * google search grounding and dynamic retrieval is enabled. It will be
1302
+ * compared to the threshold to determine whether to trigger google search.
1303
+ */
1304
+ googleSearchDynamicRetrievalScore?: number;
1305
+ };
1306
+
1307
+ /**
1308
+ * Attribution for a source that contributed to an answer.
1309
+ */
1310
+ export type GroundingAttribution = {
1311
+ /**
1312
+ * Output only. Identifier for the source contributing to this attribution.
1313
+ */
1314
+ sourceId?: AttributionSourceId;
1315
+ /**
1316
+ * Grounding source content that makes up this attribution.
1317
+ */
1318
+ content?: Content;
1319
+ };
1320
+
1321
+ /**
1322
+ * Parameters for telling the service how to chunk the file.
1323
+ * inspired by
1324
+ * google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto
1325
+ */
1326
+ export type ChunkingConfig = {
1327
+ /**
1328
+ * White space chunking configuration.
1329
+ */
1330
+ whiteSpaceConfig?: WhiteSpaceConfig;
1331
+ };
1332
+
1333
+ /**
1334
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
1335
+ */
1336
+ export type BatchGenerateContentOperation = BaseOperation & {
1337
+ metadata?: GenerateContentBatch;
1338
+ response?: BatchGenerateContentResponse;
1339
+ };
1340
+
1341
+ /**
1342
+ * Response from `ListModel` containing a paginated list of Models.
1343
+ */
1344
+ export type ListModelsResponse = {
1345
+ /**
1346
+ * A token, which can be sent as `page_token` to retrieve the next page.
1347
+ *
1348
+ * If this field is omitted, there are no more pages.
1349
+ */
1350
+ nextPageToken?: string;
1351
+ /**
1352
+ * The returned Models.
1353
+ */
1354
+ models?: Array<Model>;
1355
+ };
1356
+
1357
+ /**
1358
+ * Response from `ListCorpora` containing a paginated list of `Corpora`.
1359
+ * The results are sorted by ascending `corpus.create_time`.
1360
+ */
1361
+ export type ListCorporaResponse = {
1362
+ /**
1363
+ * The returned corpora.
1364
+ */
1365
+ corpora?: Array<Corpus>;
1366
+ /**
1367
+ * A token, which can be sent as `page_token` to retrieve the next page.
1368
+ * If this field is omitted, there are no more pages.
1369
+ */
1370
+ nextPageToken?: string;
1371
+ };
1372
+
1373
+ /**
1374
+ * The response to a EmbedTextRequest.
1375
+ */
1376
+ export type BatchEmbedTextResponse = {
1377
+ /**
1378
+ * Output only. The embeddings generated from the input text.
1379
+ */
1380
+ readonly embeddings?: Array<Embedding>;
1381
+ };
1382
+
1383
+ export type Type = 'TYPE_UNSPECIFIED' | 'STRING' | 'NUMBER' | 'INTEGER' | 'BOOLEAN' | 'ARRAY' | 'OBJECT' | 'NULL';
1384
+
1385
+ /**
1386
+ * Stats about the batch.
1387
+ */
1388
+ export type BatchStats = {
1389
+ /**
1390
+ * Output only. The number of requests that were successfully processed.
1391
+ */
1392
+ readonly successfulRequestCount?: string;
1393
+ /**
1394
+ * Output only. The number of requests that are still pending processing.
1395
+ */
1396
+ readonly pendingRequestCount?: string;
1397
+ /**
1398
+ * Output only. The number of requests that failed to be processed.
1399
+ */
1400
+ readonly failedRequestCount?: string;
1401
+ /**
1402
+ * Output only. The number of requests in the batch.
1403
+ */
1404
+ readonly requestCount?: string;
1405
+ };
1406
+
1407
+ /**
1408
+ * Request for `CreateFile`.
1409
+ */
1410
+ export type CreateFileRequest = {
1411
+ /**
1412
+ * Optional. Metadata for the file to create.
1413
+ */
1414
+ file?: File;
1415
+ };
1416
+
1417
+ /**
1418
+ * Request to transfer the ownership of the tuned model.
1419
+ */
1420
+ export type TransferOwnershipRequest = {
1421
+ /**
1422
+ * Required. The email address of the user to whom the tuned model is being transferred
1423
+ * to.
1424
+ */
1425
+ emailAddress: string;
1426
+ };
1427
+
1428
+ /**
1429
+ * Config for image generation features.
1430
+ */
1431
+ export type ImageConfig = {
1432
+ /**
1433
+ * Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`,
1434
+ * `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`,
1435
+ * `9:16`, `16:9`, or `21:9`.
1436
+ *
1437
+ * If not specified, the model will choose a default aspect ratio based on any
1438
+ * reference images provided.
1439
+ */
1440
+ aspectRatio?: string;
1441
+ /**
1442
+ * Optional. Specifies the size of generated images. Supported values are `512`, `1K`,
1443
+ * `2K`, `4K`. If not specified, the model will use default value `1K`.
1444
+ */
1445
+ imageSize?: string;
1446
+ };
1447
+
1448
+ /**
1449
+ * Hyperparameters controlling the tuning process. Read more at
1450
+ * https://ai.google.dev/docs/model_tuning_guidance
1451
+ */
1452
+ export type Hyperparameters = {
1453
+ /**
1454
+ * Immutable. The batch size hyperparameter for tuning.
1455
+ * If not set, a default of 4 or 16 will be used based on the number of
1456
+ * training examples.
1457
+ */
1458
+ batchSize?: number;
1459
+ /**
1460
+ * Optional. Immutable. The learning rate hyperparameter for tuning.
1461
+ * If not set, a default of 0.001 or 0.0002 will be calculated based on the
1462
+ * number of training examples.
1463
+ */
1464
+ learningRate?: number;
1465
+ /**
1466
+ * Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate
1467
+ * based on the default (recommended) value.
1468
+ * Actual learning rate := learning_rate_multiplier * default learning rate
1469
+ * Default learning rate is dependent on base model and dataset size.
1470
+ * If not set, a default of 1.0 will be used.
1471
+ */
1472
+ learningRateMultiplier?: number;
1473
+ /**
1474
+ * Immutable. The number of training epochs. An epoch is one pass through the training
1475
+ * data.
1476
+ * If not set, a default of 5 will be used.
1477
+ */
1478
+ epochCount?: number;
1479
+ };
1480
+
1481
+ /**
1482
+ * Response from `ListFileSearchStores` containing a paginated list of
1483
+ * `FileSearchStores`. The results are sorted by ascending
1484
+ * `file_search_store.create_time`.
1485
+ */
1486
+ export type ListFileSearchStoresResponse = {
1487
+ /**
1488
+ * The returned rag_stores.
1489
+ */
1490
+ fileSearchStores?: Array<FileSearchStore>;
1491
+ /**
1492
+ * A token, which can be sent as `page_token` to retrieve the next page.
1493
+ * If this field is omitted, there are no more pages.
1494
+ */
1495
+ nextPageToken?: string;
1496
+ };
1497
+
1498
+ /**
1499
+ * The Tool configuration containing parameters for specifying `Tool` use
1500
+ * in the request.
1501
+ */
1502
+ export type ToolConfig = {
1503
+ /**
1504
+ * Optional. Function calling config.
1505
+ */
1506
+ functionCallingConfig?: FunctionCallingConfig;
1507
+ /**
1508
+ * Optional. Retrieval config.
1509
+ */
1510
+ retrievalConfig?: RetrievalConfig;
1511
+ /**
1512
+ * Optional. If true, the API response will include the server-side tool calls and
1513
+ * responses within the `Content` message. This allows clients to
1514
+ * observe the server's tool interactions.
1515
+ */
1516
+ includeServerSideToolInvocations?: boolean;
1517
+ };
1518
+
1519
+ /**
1520
+ * Request for `ImportFile` to import a File API file with a `FileSearchStore`.
1521
+ */
1522
+ export type ImportFileRequest = {
1523
+ /**
1524
+ * Optional. Config for telling the service how to chunk the file.
1525
+ * If not provided, the service will use default parameters.
1526
+ */
1527
+ chunkingConfig?: ChunkingConfig;
1528
+ /**
1529
+ * Required. The name of the `File` to import.
1530
+ * Example: `files/abc-123`
1531
+ */
1532
+ fileName: string;
1533
+ /**
1534
+ * Custom metadata to be associated with the file.
1535
+ */
1536
+ customMetadata?: Array<CustomMetadata>;
1537
+ };
1538
+
1539
+ /**
1540
+ * Response from the model supporting multiple candidate responses.
1541
+ *
1542
+ * Safety ratings and content filtering are reported for both
1543
+ * prompt in `GenerateContentResponse.prompt_feedback` and for each candidate
1544
+ * in `finish_reason` and in `safety_ratings`. The API:
1545
+ * - Returns either all requested candidates or none of them
1546
+ * - Returns no candidates at all only if there was something wrong with the
1547
+ * prompt (check `prompt_feedback`)
1548
+ * - Reports feedback on each candidate in `finish_reason` and
1549
+ * `safety_ratings`.
1550
+ */
1551
+ export type GenerateContentResponse = {
1552
+ /**
1553
+ * Candidate responses from the model.
1554
+ */
1555
+ candidates?: Array<Candidate>;
1556
+ /**
1557
+ * Output only. The model version used to generate the response.
1558
+ */
1559
+ readonly modelVersion?: string;
1560
+ /**
1561
+ * Output only. Metadata on the generation requests' token usage.
1562
+ */
1563
+ usageMetadata?: UsageMetadata;
1564
+ /**
1565
+ * Returns the prompt's feedback related to the content filters.
1566
+ */
1567
+ promptFeedback?: PromptFeedback;
1568
+ /**
1569
+ * Output only. The current model status of this model.
1570
+ */
1571
+ modelStatus?: ModelStatus;
1572
+ /**
1573
+ * Output only. response_id is used to identify each response.
1574
+ */
1575
+ readonly responseId?: string;
1576
+ };
1577
+
1578
+ /**
1579
+ * Google search entry point.
1580
+ */
1581
+ export type SearchEntryPoint = {
1582
+ /**
1583
+ * Optional. Web content snippet that can be embedded in a web page or an app webview.
1584
+ */
1585
+ renderedContent?: string;
1586
+ /**
1587
+ * Optional. Base64 encoded JSON representing array of tuple.
1588
+ */
1589
+ sdkBlob?: string;
1590
+ };
1591
+
1592
+ /**
1593
+ * An object that represents a latitude/longitude pair. This is expressed as a
1594
+ * pair of doubles to represent degrees latitude and degrees longitude. Unless
1595
+ * specified otherwise, this object must conform to the
1596
+ * WGS84 standard. Values must be within normalized ranges.
1597
+ */
1598
+ export type LatLng = {
1599
+ /**
1600
+ * The latitude in degrees. It must be in the range [-90.0, +90.0].
1601
+ */
1602
+ latitude?: number;
1603
+ /**
1604
+ * The longitude in degrees. It must be in the range [-180.0, +180.0].
1605
+ */
1606
+ longitude?: number;
1607
+ };
1608
+
1609
+ /**
1610
+ * A file uploaded to the API.
1611
+ * Next ID: 15
1612
+ */
1613
+ export type File = {
1614
+ /**
1615
+ * Output only. The uri of the `File`.
1616
+ */
1617
+ readonly uri?: string;
1618
+ /**
1619
+ * Output only. Processing state of the File.
1620
+ */
1621
+ state?: 'STATE_UNSPECIFIED' | 'PROCESSING' | 'ACTIVE' | 'FAILED';
1622
+ /**
1623
+ * Output only. The download uri of the `File`.
1624
+ */
1625
+ readonly downloadUri?: string;
1626
+ /**
1627
+ * Immutable. Identifier. The `File` resource name. The ID (name excluding the "files/" prefix) can
1628
+ * contain up to 40 characters that are lowercase alphanumeric or dashes (-).
1629
+ * The ID cannot start or end with a dash. If the name is empty on create, a
1630
+ * unique name will be generated.
1631
+ * Example: `files/123-456`
1632
+ */
1633
+ name?: string;
1634
+ /**
1635
+ * Output only. MIME type of the file.
1636
+ */
1637
+ readonly mimeType?: string;
1638
+ /**
1639
+ * Source of the File.
1640
+ */
1641
+ source?: 'SOURCE_UNSPECIFIED' | 'UPLOADED' | 'GENERATED' | 'REGISTERED';
1642
+ /**
1643
+ * Output only. The timestamp of when the `File` was last updated.
1644
+ */
1645
+ readonly updateTime?: string;
1646
+ /**
1647
+ * Output only. The timestamp of when the `File` was created.
1648
+ */
1649
+ readonly createTime?: string;
1650
+ /**
1651
+ * Output only. Size of the file in bytes.
1652
+ */
1653
+ readonly sizeBytes?: string;
1654
+ /**
1655
+ * Output only. SHA-256 hash of the uploaded bytes.
1656
+ */
1657
+ readonly sha256Hash?: string;
1658
+ /**
1659
+ * Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is
1660
+ * scheduled to expire.
1661
+ */
1662
+ readonly expirationTime?: string;
1663
+ /**
1664
+ * Output only. Metadata for a video.
1665
+ */
1666
+ videoMetadata?: VideoFileMetadata;
1667
+ /**
1668
+ * Optional. The human-readable display name for the `File`. The display name must be
1669
+ * no more than 512 characters in length, including spaces.
1670
+ * Example: "Welcome Image"
1671
+ */
1672
+ displayName?: string;
1673
+ /**
1674
+ * Output only. Error status if File processing failed.
1675
+ */
1676
+ error?: Status;
1677
+ };
1678
+
1679
+ /**
1680
+ * Feedback related to the input data used to answer the question, as opposed
1681
+ * to the model-generated response to the question.
1682
+ */
1683
+ export type InputFeedback = {
1684
+ /**
1685
+ * Ratings for safety of the input.
1686
+ * There is at most one rating per category.
1687
+ */
1688
+ safetyRatings?: Array<SafetyRating>;
1689
+ /**
1690
+ * Optional. If set, the input was blocked and no candidates are returned.
1691
+ * Rephrase the input.
1692
+ */
1693
+ blockReason?: 'BLOCK_REASON_UNSPECIFIED' | 'SAFETY' | 'OTHER';
1694
+ };
1695
+
1696
+ /**
1697
+ * Response from `ListTunedModels` containing a paginated list of Models.
1698
+ */
1699
+ export type ListTunedModelsResponse = {
1700
+ /**
1701
+ * The returned Models.
1702
+ */
1703
+ tunedModels?: Array<TunedModel>;
1704
+ /**
1705
+ * A token, which can be sent as `page_token` to retrieve the next page.
1706
+ *
1707
+ * If this field is omitted, there are no more pages.
1708
+ */
1709
+ nextPageToken?: string;
1710
+ };
1711
+
1712
+ export type ModelStage = 'MODEL_STAGE_UNSPECIFIED' | 'UNSTABLE_EXPERIMENTAL' | 'EXPERIMENTAL' | 'PREVIEW' | 'STABLE' | 'LEGACY' | 'DEPRECATED' | 'RETIRED';
1713
+
1714
+ /**
1715
+ * A repeated list of passages.
1716
+ */
1717
+ export type GroundingPassages = {
1718
+ /**
1719
+ * List of passages.
1720
+ */
1721
+ passages?: Array<GroundingPassage>;
1722
+ };
1723
+
1724
+ /**
1725
+ * GoogleSearch tool type.
1726
+ * Tool to support Google Search in Model. Powered by Google.
1727
+ */
1728
+ export type GoogleSearch = {
1729
+ /**
1730
+ * Optional. The set of search types to enable. If not set, web search is
1731
+ * enabled by default.
1732
+ */
1733
+ searchTypes?: SearchTypes;
1734
+ /**
1735
+ * Optional. Filter search results to a specific time range.
1736
+ * If customers set a start time, they must set an end time (and vice
1737
+ * versa).
1738
+ */
1739
+ timeRangeFilter?: Interval;
1740
+ };
1741
+
1742
+ /**
1743
+ * A set of the feedback metadata the prompt specified in
1744
+ * `GenerateContentRequest.content`.
1745
+ */
1746
+ export type PromptFeedback = {
1747
+ /**
1748
+ * Ratings for safety of the prompt.
1749
+ * There is at most one rating per category.
1750
+ */
1751
+ safetyRatings?: Array<SafetyRating>;
1752
+ /**
1753
+ * Optional. If set, the prompt was blocked and no candidates are returned.
1754
+ * Rephrase the prompt.
1755
+ */
1756
+ blockReason?: 'BLOCK_REASON_UNSPECIFIED' | 'SAFETY' | 'OTHER' | 'BLOCKLIST' | 'PROHIBITED_CONTENT' | 'IMAGE_SAFETY';
1757
+ };
1758
+
1759
+ /**
1760
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
1761
+ */
1762
+ export type UploadToFileSearchStoreOperation = BaseOperation & {
1763
+ metadata?: UploadToFileSearchStoreMetadata;
1764
+ response?: UploadToFileSearchStoreResponse;
1765
+ };
1766
+
1767
+ /**
1768
+ * Batch request to get a text embedding from the model.
1769
+ */
1770
+ export type BatchEmbedTextRequest = {
1771
+ /**
1772
+ * Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.
1773
+ */
1774
+ requests?: Array<EmbedTextRequest>;
1775
+ /**
1776
+ * Optional. The free-form input texts that the model will turn into an embedding. The
1777
+ * current limit is 100 texts, over which an error will be thrown.
1778
+ */
1779
+ texts?: Array<string>;
1780
+ };
1781
+
1782
+ /**
1783
+ * A `GroundingChunk` represents a segment of supporting evidence that grounds
1784
+ * the model's response. It can be a chunk from the web, a retrieved context
1785
+ * from a file, or information from Google Maps.
1786
+ */
1787
+ export type GroundingChunk = {
1788
+ /**
1789
+ * Grounding chunk from the web.
1790
+ */
1791
+ web?: Web;
1792
+ /**
1793
+ * Optional. Grounding chunk from context retrieved by the file search tool.
1794
+ */
1795
+ retrievedContext?: RetrievedContext;
1796
+ /**
1797
+ * Optional. Grounding chunk from image search.
1798
+ */
1799
+ image?: Image;
1800
+ /**
1801
+ * Optional. Grounding chunk from Google Maps.
1802
+ */
1803
+ maps?: Maps;
1804
+ };
1805
+
1806
+ /**
1807
+ * User provided filter to limit retrieval based on `Chunk` or `Document` level
1808
+ * metadata values.
1809
+ * Example (genre = drama OR genre = action):
1810
+ * key = "document.custom_metadata.genre"
1811
+ * conditions = [{string_value = "drama", operation = EQUAL},
1812
+ * {string_value = "action", operation = EQUAL}]
1813
+ */
1814
+ export type MetadataFilter = {
1815
+ /**
1816
+ * Required. The key of the metadata to filter on.
1817
+ */
1818
+ key: string;
1819
+ /**
1820
+ * Required. The `Condition`s for the given key that will trigger this filter. Multiple
1821
+ * `Condition`s are joined by logical ORs.
1822
+ */
1823
+ conditions: Array<Condition>;
1824
+ };
1825
+
1826
+ /**
1827
+ * The response to a single request in the batch.
1828
+ */
1829
+ export type InlinedResponse = {
1830
+ /**
1831
+ * Output only. The response to the request.
1832
+ */
1833
+ response?: GenerateContentResponse;
1834
+ /**
1835
+ * Output only. The metadata associated with the request.
1836
+ */
1837
+ readonly metadata?: {};
1838
+ /**
1839
+ * Output only. The error encountered while processing the request.
1840
+ */
1841
+ error?: Status;
1842
+ };
1843
+
1844
+ /**
1845
+ * The request to be processed in the batch.
1846
+ */
1847
+ export type InlinedRequest = {
1848
+ /**
1849
+ * Optional. The metadata to be associated with the request.
1850
+ */
1851
+ metadata?: {};
1852
+ /**
1853
+ * Required. The request to be processed in the batch.
1854
+ */
1855
+ request: GenerateContentRequest;
1856
+ };
1857
+
1858
+ /**
1859
+ * A response from `CountTokens`.
1860
+ *
1861
+ * It returns the model's `token_count` for the `prompt`.
1862
+ */
1863
+ export type CountTokensResponse = {
1864
+ /**
1865
+ * Output only. List of modalities that were processed in the request input.
1866
+ */
1867
+ readonly promptTokensDetails?: Array<ModalityTokenCount>;
1868
+ /**
1869
+ * The number of tokens that the `Model` tokenizes the `prompt` into. Always
1870
+ * non-negative.
1871
+ */
1872
+ totalTokens?: number;
1873
+ /**
1874
+ * Output only. List of modalities that were processed in the cached content.
1875
+ */
1876
+ readonly cacheTokensDetails?: Array<ModalityTokenCount>;
1877
+ /**
1878
+ * Number of tokens in the cached part of the prompt (the cached content).
1879
+ */
1880
+ cachedContentTokenCount?: number;
1881
+ };
1882
+
1883
+ /**
1884
+ * Content filtering metadata associated with processing a single request.
1885
+ *
1886
+ * ContentFilter contains a reason and an optional supporting string. The reason
1887
+ * may be unspecified.
1888
+ */
1889
+ export type ContentFilter = {
1890
+ /**
1891
+ * The reason content was blocked during request processing.
1892
+ */
1893
+ reason?: 'BLOCKED_REASON_UNSPECIFIED' | 'SAFETY' | 'OTHER';
1894
+ /**
1895
+ * A string that describes the filtering behavior in more detail.
1896
+ */
1897
+ message?: string;
1898
+ };
1899
+
1900
+ /**
1901
+ * A collection of source attributions for a piece of content.
1902
+ */
1903
+ export type CitationMetadata = {
1904
+ /**
1905
+ * Citations to sources for a specific response.
1906
+ */
1907
+ citationSources?: Array<CitationSource>;
1908
+ };
1909
+
1910
+ /**
1911
+ * Tool details that the model may use to generate response.
1912
+ *
1913
+ * A `Tool` is a piece of code that enables the system to interact with
1914
+ * external systems to perform an action, or set of actions, outside of
1915
+ * knowledge and scope of the model.
1916
+ *
1917
+ * Next ID: 16
1918
+ */
1919
+ export type Tool = {
1920
+ /**
1921
+ * Optional. MCP Servers to connect to.
1922
+ */
1923
+ mcpServers?: Array<McpServer>;
1924
+ /**
1925
+ * Optional. GoogleSearch tool type.
1926
+ * Tool to support Google Search in Model. Powered by Google.
1927
+ */
1928
+ googleSearch?: GoogleSearch;
1929
+ /**
1930
+ * Optional. A list of `FunctionDeclarations` available to the model that can be used
1931
+ * for function calling.
1932
+ *
1933
+ * The model or system does not execute the function. Instead the defined
1934
+ * function may be returned as a FunctionCall
1935
+ * with arguments to the client side for execution. The model may decide to
1936
+ * call a subset of these functions by populating
1937
+ * FunctionCall in the response. The next
1938
+ * conversation turn may contain a
1939
+ * FunctionResponse
1940
+ * with the Content.role "function" generation context for the next model
1941
+ * turn.
1942
+ */
1943
+ functionDeclarations?: Array<FunctionDeclaration>;
1944
+ /**
1945
+ * Optional. Retrieval tool that is powered by Google search.
1946
+ */
1947
+ googleSearchRetrieval?: GoogleSearchRetrieval;
1948
+ /**
1949
+ * Optional. Tool that allows grounding the model's response with geospatial context
1950
+ * related to the user's query.
1951
+ */
1952
+ googleMaps?: GoogleMaps;
1953
+ /**
1954
+ * Optional. Tool to support the model interacting directly with the computer.
1955
+ * If enabled, it automatically populates computer-use specific Function
1956
+ * Declarations.
1957
+ */
1958
+ computerUse?: ComputerUse;
1959
+ /**
1960
+ * Optional. Tool to support URL context retrieval.
1961
+ */
1962
+ urlContext?: UrlContext;
1963
+ /**
1964
+ * Optional. Enables the model to execute code as part of generation.
1965
+ */
1966
+ codeExecution?: CodeExecution;
1967
+ /**
1968
+ * Optional. FileSearch tool type.
1969
+ * Tool to retrieve knowledge from Semantic Retrieval corpora.
1970
+ */
1971
+ fileSearch?: FileSearch;
1972
+ };
1973
+
1974
+ /**
1975
+ * The `Schema` object allows the definition of input and output data types.
1976
+ * These types can be objects, but also primitives and arrays.
1977
+ * Represents a select subset of an [OpenAPI 3.0 schema
1978
+ * object](https://spec.openapis.org/oas/v3.0.3#schema).
1979
+ */
1980
+ export type Schema = {
1981
+ /**
1982
+ * Optional. The title of the schema.
1983
+ */
1984
+ title?: string;
1985
+ /**
1986
+ * Optional. Schema of the elements of Type.ARRAY.
1987
+ */
1988
+ items?: Schema;
1989
+ /**
1990
+ * Optional. Properties of Type.OBJECT.
1991
+ */
1992
+ properties?: {
1993
+ [key: string]: Schema;
1994
+ };
1995
+ /**
1996
+ * Optional. Maximum number of the properties for Type.OBJECT.
1997
+ */
1998
+ maxProperties?: string;
1999
+ /**
2000
+ * Optional. Maximum length of the Type.STRING
2001
+ */
2002
+ maxLength?: string;
2003
+ /**
2004
+ * Optional. Possible values of the element of Type.STRING with enum format.
2005
+ * For example we can define an Enum Direction as :
2006
+ * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
2007
+ */
2008
+ enum?: Array<string>;
2009
+ /**
2010
+ * Optional. The value should be validated against any (one or more) of the subschemas
2011
+ * in the list.
2012
+ */
2013
+ anyOf?: Array<Schema>;
2014
+ /**
2015
+ * Optional. Required properties of Type.OBJECT.
2016
+ */
2017
+ required?: Array<string>;
2018
+ /**
2019
+ * Optional. The format of the data. Any value is allowed, but most do not trigger any
2020
+ * special functionality.
2021
+ */
2022
+ format?: string;
2023
+ /**
2024
+ * Optional. Minimum number of the properties for Type.OBJECT.
2025
+ */
2026
+ minProperties?: string;
2027
+ /**
2028
+ * Optional. Maximum number of the elements for Type.ARRAY.
2029
+ */
2030
+ maxItems?: string;
2031
+ /**
2032
+ * Optional. Indicates if the value may be null.
2033
+ */
2034
+ nullable?: boolean;
2035
+ /**
2036
+ * Optional. Maximum value of the Type.INTEGER and Type.NUMBER
2037
+ */
2038
+ maximum?: number;
2039
+ /**
2040
+ * Optional. The order of the properties.
2041
+ * Not a standard field in open api spec. Used to determine the order of the
2042
+ * properties in the response.
2043
+ */
2044
+ propertyOrdering?: Array<string>;
2045
+ /**
2046
+ * Optional. Default value of the field. Per JSON Schema, this field is intended for
2047
+ * documentation generators and doesn't affect validation. Thus it's included
2048
+ * here and ignored so that developers who send schemas with a `default` field
2049
+ * don't get unknown-field errors.
2050
+ */
2051
+ default?: unknown;
2052
+ /**
2053
+ * Optional. Minimum number of the elements for Type.ARRAY.
2054
+ */
2055
+ minItems?: string;
2056
+ /**
2057
+ * Optional. SCHEMA FIELDS FOR TYPE STRING
2058
+ * Minimum length of the Type.STRING
2059
+ */
2060
+ minLength?: string;
2061
+ /**
2062
+ * Required. Data type.
2063
+ */
2064
+ type: Type;
2065
+ /**
2066
+ * Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
2067
+ */
2068
+ pattern?: string;
2069
+ /**
2070
+ * Optional. Example of the object. Will only populated when the object is the root.
2071
+ */
2072
+ example?: unknown;
2073
+ /**
2074
+ * Optional. A brief description of the parameter. This could contain examples of use.
2075
+ * Parameter description may be formatted as Markdown.
2076
+ */
2077
+ description?: string;
2078
+ /**
2079
+ * Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER
2080
+ * Minimum value of the Type.INTEGER and Type.NUMBER
2081
+ */
2082
+ minimum?: number;
2083
+ };
2084
+
2085
+ /**
2086
+ * The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora.
2087
+ * Files are imported to Semantic Retrieval corpora using the ImportFile API.
2088
+ */
2089
+ export type FileSearch = {
2090
+ /**
2091
+ * Required. The names of the file_search_stores to retrieve from.
2092
+ * Example: `fileSearchStores/my-file-search-store-123`
2093
+ */
2094
+ fileSearchStoreNames: Array<string>;
2095
+ /**
2096
+ * Optional. The number of semantic retrieval chunks to retrieve.
2097
+ */
2098
+ topK?: number;
2099
+ /**
2100
+ * Optional. Metadata filter to apply to the semantic retrieval documents and chunks.
2101
+ */
2102
+ metadataFilter?: string;
2103
+ };
2104
+
2105
+ /**
2106
+ * A file generated on behalf of a user.
2107
+ */
2108
+ export type GeneratedFile = {
2109
+ /**
2110
+ * Identifier. The name of the generated file.
2111
+ * Example: `generatedFiles/abc-123`
2112
+ */
2113
+ name?: string;
2114
+ /**
2115
+ * MIME type of the generatedFile.
2116
+ */
2117
+ mimeType?: string;
2118
+ /**
2119
+ * Error details if the GeneratedFile ends up in the STATE_FAILED state.
2120
+ */
2121
+ error?: Status;
2122
+ /**
2123
+ * Output only. The state of the GeneratedFile.
2124
+ */
2125
+ state?: 'STATE_UNSPECIFIED' | 'GENERATING' | 'GENERATED' | 'FAILED';
2126
+ };
2127
+
2128
+ /**
2129
+ * The response from the model.
2130
+ *
2131
+ * This includes candidate messages and
2132
+ * conversation history in the form of chronologically-ordered messages.
2133
+ */
2134
+ export type GenerateMessageResponse = {
2135
+ /**
2136
+ * A set of content filtering metadata for the prompt and response
2137
+ * text.
2138
+ *
2139
+ * This indicates which `SafetyCategory`(s) blocked a
2140
+ * candidate from this response, the lowest `HarmProbability`
2141
+ * that triggered a block, and the HarmThreshold setting for that category.
2142
+ */
2143
+ filters?: Array<ContentFilter>;
2144
+ /**
2145
+ * Candidate response messages from the model.
2146
+ */
2147
+ candidates?: Array<Message>;
2148
+ /**
2149
+ * The conversation history used by the model.
2150
+ */
2151
+ messages?: Array<Message>;
2152
+ };
2153
+
2154
+ /**
2155
+ * Represents token counting info for a single modality.
2156
+ */
2157
+ export type ModalityTokenCount = {
2158
+ /**
2159
+ * The modality associated with this token count.
2160
+ */
2161
+ modality?: GenerativeLanguageModality;
2162
+ /**
2163
+ * Number of tokens.
2164
+ */
2165
+ tokenCount?: number;
2166
+ };
2167
+
2168
+ /**
2169
+ * Retrieval config.
2170
+ */
2171
+ export type RetrievalConfig = {
2172
+ /**
2173
+ * Optional. The location of the user.
2174
+ */
2175
+ latLng?: LatLng;
2176
+ /**
2177
+ * Optional. The language code of the user.
2178
+ * Language code for content. Use language tags defined by
2179
+ * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
2180
+ */
2181
+ languageCode?: string;
2182
+ };
2183
+
2184
+ /**
2185
+ * Request for `UploadToFileSearchStore`.
2186
+ */
2187
+ export type UploadToFileSearchStoreRequest = {
2188
+ /**
2189
+ * Custom metadata to be associated with the data.
2190
+ */
2191
+ customMetadata?: Array<CustomMetadata>;
2192
+ /**
2193
+ * Optional. Display name of the created document.
2194
+ */
2195
+ displayName?: string;
2196
+ /**
2197
+ * Optional. Config for telling the service how to chunk the data.
2198
+ * If not provided, the service will use default parameters.
2199
+ */
2200
+ chunkingConfig?: ChunkingConfig;
2201
+ /**
2202
+ * Optional. MIME type of the data. If not provided, it will be inferred from the
2203
+ * uploaded content.
2204
+ */
2205
+ mimeType?: string;
2206
+ };
2207
+
2208
+ /**
2209
+ * Dataset for training or validation.
2210
+ */
2211
+ export type Dataset = {
2212
+ /**
2213
+ * Optional. Inline examples with simple input/output text.
2214
+ */
2215
+ examples?: TuningExamples;
2216
+ };
2217
+
2218
+ /**
2219
+ * The response from the model, including candidate completions.
2220
+ */
2221
+ export type GenerateTextResponse = {
2222
+ /**
2223
+ * A set of content filtering metadata for the prompt and response
2224
+ * text.
2225
+ *
2226
+ * This indicates which `SafetyCategory`(s) blocked a
2227
+ * candidate from this response, the lowest `HarmProbability`
2228
+ * that triggered a block, and the HarmThreshold setting for that category.
2229
+ * This indicates the smallest change to the `SafetySettings` that would be
2230
+ * necessary to unblock at least 1 response.
2231
+ *
2232
+ * The blocking is configured by the `SafetySettings` in the request (or the
2233
+ * default `SafetySettings` of the API).
2234
+ */
2235
+ filters?: Array<ContentFilter>;
2236
+ /**
2237
+ * Candidate responses from the model.
2238
+ */
2239
+ candidates?: Array<TextCompletion>;
2240
+ /**
2241
+ * Returns any safety feedback related to content filtering.
2242
+ */
2243
+ safetyFeedback?: Array<SafetyFeedback>;
2244
+ };
2245
+
2246
+ /**
2247
+ * Identifier for a `Chunk` retrieved via Semantic Retriever specified in the
2248
+ * `GenerateAnswerRequest` using `SemanticRetrieverConfig`.
2249
+ */
2250
+ export type SemanticRetrieverChunk = {
2251
+ /**
2252
+ * Output only. Name of the `Chunk` containing the attributed text.
2253
+ * Example: `corpora/123/documents/abc/chunks/xyz`
2254
+ */
2255
+ readonly chunk?: string;
2256
+ /**
2257
+ * Output only. Name of the source matching the request's
2258
+ * `SemanticRetrieverConfig.source`. Example: `corpora/123` or
2259
+ * `corpora/123/documents/abc`
2260
+ */
2261
+ readonly source?: string;
2262
+ };
2263
+
2264
+ /**
2265
+ * The response to a EmbedTextRequest.
2266
+ */
2267
+ export type EmbedTextResponse = {
2268
+ /**
2269
+ * Output only. The embedding generated from the input text.
2270
+ */
2271
+ embedding?: Embedding;
2272
+ };
2273
+
2274
+ /**
2275
+ * Computer Use tool type.
2276
+ */
2277
+ export type ComputerUse = {
2278
+ /**
2279
+ * Required. The environment being operated.
2280
+ */
2281
+ environment: 'ENVIRONMENT_UNSPECIFIED' | 'ENVIRONMENT_BROWSER';
2282
+ /**
2283
+ * Optional. By default, predefined functions are included in the final model
2284
+ * call.
2285
+ * Some of them can be explicitly excluded from being automatically
2286
+ * included. This can serve two purposes:
2287
+ * 1. Using a more restricted / different action space.
2288
+ * 2. Improving the definitions / instructions of predefined functions.
2289
+ */
2290
+ excludedPredefinedFunctions?: Array<string>;
2291
+ };
2292
+
2293
+ /**
2294
+ * A set of tuning examples. Can be training or validation data.
2295
+ */
2296
+ export type TuningExamples = {
2297
+ /**
2298
+ * The examples. Example input can be for text or discuss, but all examples
2299
+ * in a set must be of the same type.
2300
+ */
2301
+ examples?: Array<TuningExample>;
2302
+ };
2303
+
2304
+ /**
2305
+ * The `Status` type defines a logical error model that is suitable for
2306
+ * different programming environments, including REST APIs and RPC APIs. It is
2307
+ * used by [gRPC](https://github.com/grpc). Each `Status` message contains
2308
+ * three pieces of data: error code, error message, and error details.
2309
+ *
2310
+ * You can find out more about this error model and how to work with it in the
2311
+ * [API Design Guide](https://cloud.google.com/apis/design/errors).
2312
+ */
2313
+ export type Status = {
2314
+ /**
2315
+ * A developer-facing error message, which should be in English. Any
2316
+ * user-facing error message should be localized and sent in the
2317
+ * google.rpc.Status.details field, or localized by the client.
2318
+ */
2319
+ message?: string;
2320
+ /**
2321
+ * The status code, which should be an enum value of google.rpc.Code.
2322
+ */
2323
+ code?: number;
2324
+ /**
2325
+ * A list of messages that carry the error details. There is a common set of
2326
+ * message types for APIs to use.
2327
+ */
2328
+ details?: Array<{}>;
2329
+ };
2330
+
2331
+ /**
2332
+ * Permission resource grants user, group or the rest of the world access to the
2333
+ * PaLM API resource (e.g. a tuned model, corpus).
2334
+ *
2335
+ * A role is a collection of permitted operations that allows users to perform
2336
+ * specific actions on PaLM API resources. To make them available to users,
2337
+ * groups, or service accounts, you assign roles. When you assign a role, you
2338
+ * grant permissions that the role contains.
2339
+ *
2340
+ * There are three concentric roles. Each role is a superset of the previous
2341
+ * role's permitted operations:
2342
+ *
2343
+ * - reader can use the resource (e.g. tuned model, corpus) for inference
2344
+ * - writer has reader's permissions and additionally can edit and share
2345
+ * - owner has writer's permissions and additionally can delete
2346
+ */
2347
+ export type Permission = {
2348
+ /**
2349
+ * Optional. Immutable. The email address of the user of group which this permission refers.
2350
+ * Field is not set when permission's grantee type is EVERYONE.
2351
+ */
2352
+ emailAddress?: string;
2353
+ /**
2354
+ * Required. The role granted by this permission.
2355
+ */
2356
+ role: 'ROLE_UNSPECIFIED' | 'OWNER' | 'WRITER' | 'READER';
2357
+ /**
2358
+ * Output only. Identifier. The permission name. A unique name will be generated on create.
2359
+ * Examples:
2360
+ * tunedModels/{tuned_model}/permissions/{permission}
2361
+ * corpora/{corpus}/permissions/{permission}
2362
+ * Output only.
2363
+ */
2364
+ readonly name?: string;
2365
+ /**
2366
+ * Optional. Immutable. The type of the grantee.
2367
+ */
2368
+ granteeType?: 'GRANTEE_TYPE_UNSPECIFIED' | 'USER' | 'GROUP' | 'EVERYONE';
2369
+ };
2370
+
2371
+ /**
2372
+ * The configuration for the voice to use.
2373
+ */
2374
+ export type VoiceConfig = {
2375
+ /**
2376
+ * The configuration for the prebuilt voice to use.
2377
+ */
2378
+ prebuiltVoiceConfig?: PrebuiltVoiceConfig;
2379
+ };
2380
+
2381
+ /**
2382
+ * Encapsulates a snippet of a user review that answers a question about
2383
+ * the features of a specific place in Google Maps.
2384
+ */
2385
+ export type ReviewSnippet = {
2386
+ /**
2387
+ * A link that corresponds to the user review on Google Maps.
2388
+ */
2389
+ googleMapsUri?: string;
2390
+ /**
2391
+ * The ID of the review snippet.
2392
+ */
2393
+ reviewId?: string;
2394
+ /**
2395
+ * Title of the review.
2396
+ */
2397
+ title?: string;
2398
+ };
2399
+
2400
+ /**
2401
+ * A predicted server-side `ToolCall` returned from the model. This message
2402
+ * contains information about a tool that the model wants to invoke.
2403
+ * The client is NOT expected to execute this `ToolCall`. Instead, the
2404
+ * client should pass this `ToolCall` back to the API in a subsequent turn
2405
+ * within a `Content` message, along with the corresponding `ToolResponse`.
2406
+ */
2407
+ export type ToolCall = {
2408
+ /**
2409
+ * Optional. The tool call arguments.
2410
+ * Example: {"arg1" : "value1", "arg2" : "value2" , ...}
2411
+ */
2412
+ args?: {};
2413
+ /**
2414
+ * Required. The type of tool that was called.
2415
+ */
2416
+ toolType: ToolType;
2417
+ /**
2418
+ * Optional. Unique identifier of the tool call.
2419
+ * The server returns the tool response with the matching `id`.
2420
+ */
2421
+ id?: string;
2422
+ };
2423
+
2424
+ /**
2425
+ * A resource representing a batch of `GenerateContent` requests.
2426
+ */
2427
+ export type GenerateContentBatch = {
2428
+ /**
2429
+ * Required. Input configuration of the instances on which batch processing
2430
+ * are performed.
2431
+ */
2432
+ inputConfig: InputConfig;
2433
+ /**
2434
+ * Optional. The priority of the batch. Batches with a higher priority value will be
2435
+ * processed before batches with a lower priority value. Negative values are
2436
+ * allowed. Default is 0.
2437
+ */
2438
+ priority?: string;
2439
+ /**
2440
+ * Output only. The state of the batch.
2441
+ */
2442
+ state?: BatchState;
2443
+ /**
2444
+ * Output only. The time at which the batch processing completed.
2445
+ */
2446
+ readonly endTime?: string;
2447
+ /**
2448
+ * Output only. The time at which the batch was created.
2449
+ */
2450
+ readonly createTime?: string;
2451
+ /**
2452
+ * Output only. The output of the batch request.
2453
+ */
2454
+ output?: GenerateContentBatchOutput;
2455
+ /**
2456
+ * Output only. The time at which the batch was last updated.
2457
+ */
2458
+ readonly updateTime?: string;
2459
+ /**
2460
+ * Output only. Stats about the batch.
2461
+ */
2462
+ batchStats?: BatchStats;
2463
+ /**
2464
+ * Output only. Identifier. Resource name of the batch.
2465
+ *
2466
+ * Format: `batches/{batch_id}`.
2467
+ */
2468
+ readonly name?: string;
2469
+ /**
2470
+ * Required. The name of the `Model` to use for generating the completion.
2471
+ *
2472
+ * Format: `models/{model}`.
2473
+ */
2474
+ model: string;
2475
+ /**
2476
+ * Required. The user-defined name of this batch.
2477
+ */
2478
+ displayName: string;
2479
+ };
2480
+
2481
+ /**
2482
+ * A single example for tuning.
2483
+ */
2484
+ export type TuningExample = {
2485
+ /**
2486
+ * Optional. Text model input.
2487
+ */
2488
+ textInput?: string;
2489
+ /**
2490
+ * Required. The expected model output.
2491
+ */
2492
+ output: string;
2493
+ };
2494
+
2495
+ /**
2496
+ * The GoogleMaps Tool that provides geospatial context for the user's query.
2497
+ */
2498
+ export type GoogleMaps = {
2499
+ /**
2500
+ * Optional. Whether to return a widget context token in the GroundingMetadata of the
2501
+ * response. Developers can use the widget context token to render a Google
2502
+ * Maps widget with geospatial context related to the places that the model
2503
+ * references in the response.
2504
+ */
2505
+ enableWidget?: boolean;
2506
+ };
2507
+
2508
+ /**
2509
+ * Request message for [PredictionService.PredictLongRunning].
2510
+ */
2511
+ export type PredictLongRunningRequest = {
2512
+ /**
2513
+ * Required. The instances that are the input to the prediction call.
2514
+ */
2515
+ instances: Array<unknown>;
2516
+ /**
2517
+ * Optional. The parameters that govern the prediction call.
2518
+ */
2519
+ parameters?: unknown;
2520
+ };
2521
+
2522
+ /**
2523
+ * Metadata on the usage of the cached content.
2524
+ */
2525
+ export type CachedContentUsageMetadata = {
2526
+ /**
2527
+ * Total number of tokens that the cached content consumes.
2528
+ */
2529
+ totalTokenCount?: number;
2530
+ };
2531
+
2532
+ /**
2533
+ * All of the structured input text passed to the model as a prompt.
2534
+ *
2535
+ * A `MessagePrompt` contains a structured set of fields that provide context
2536
+ * for the conversation, examples of user input/model output message pairs that
2537
+ * prime the model to respond in different ways, and the conversation history
2538
+ * or list of messages representing the alternating turns of the conversation
2539
+ * between the user and the model.
2540
+ */
2541
+ export type MessagePrompt = {
2542
+ /**
2543
+ * Optional. Text that should be provided to the model first to ground the response.
2544
+ *
2545
+ * If not empty, this `context` will be given to the model first before the
2546
+ * `examples` and `messages`. When using a `context` be sure to provide it
2547
+ * with every request to maintain continuity.
2548
+ *
2549
+ * This field can be a description of your prompt to the model to help provide
2550
+ * context and guide the responses. Examples: "Translate the phrase from
2551
+ * English to French." or "Given a statement, classify the sentiment as happy,
2552
+ * sad or neutral."
2553
+ *
2554
+ * Anything included in this field will take precedence over message history
2555
+ * if the total input size exceeds the model's `input_token_limit` and the
2556
+ * input request is truncated.
2557
+ */
2558
+ context?: string;
2559
+ /**
2560
+ * Optional. Examples of what the model should generate.
2561
+ *
2562
+ * This includes both user input and the response that the model should
2563
+ * emulate.
2564
+ *
2565
+ * These `examples` are treated identically to conversation messages except
2566
+ * that they take precedence over the history in `messages`:
2567
+ * If the total input size exceeds the model's `input_token_limit` the input
2568
+ * will be truncated. Items will be dropped from `messages` before `examples`.
2569
+ */
2570
+ examples?: Array<Example>;
2571
+ /**
2572
+ * Required. A snapshot of the recent conversation history sorted chronologically.
2573
+ *
2574
+ * Turns alternate between two authors.
2575
+ *
2576
+ * If the total input size exceeds the model's `input_token_limit` the input
2577
+ * will be truncated: The oldest items will be dropped from `messages`.
2578
+ */
2579
+ messages: Array<Message>;
2580
+ };
2581
+
2582
+ /**
2583
+ * Response for a `BatchGenerateContent` operation.
2584
+ */
2585
+ export type AsyncBatchEmbedContentResponse = {
2586
+ /**
2587
+ * Output only. The output of the batch request.
2588
+ */
2589
+ output?: EmbedContentBatchOutput;
2590
+ };
2591
+
2592
+ /**
2593
+ * Safety setting, affecting the safety-blocking behavior.
2594
+ *
2595
+ * Passing a safety setting for a category changes the allowed probability that
2596
+ * content is blocked.
2597
+ */
2598
+ export type SafetySetting = {
2599
+ /**
2600
+ * Required. The category for this setting.
2601
+ */
2602
+ category: HarmCategory;
2603
+ /**
2604
+ * Required. Controls the probability threshold at which harm is blocked.
2605
+ */
2606
+ threshold: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_ONLY_HIGH' | 'BLOCK_NONE' | 'OFF';
2607
+ };
2608
+
2609
+ /**
2610
+ * Describes the options to customize dynamic retrieval.
2611
+ */
2612
+ export type DynamicRetrievalConfig = {
2613
+ /**
2614
+ * The mode of the predictor to be used in dynamic retrieval.
2615
+ */
2616
+ mode?: 'MODE_UNSPECIFIED' | 'MODE_DYNAMIC';
2617
+ /**
2618
+ * The threshold to be used in dynamic retrieval.
2619
+ * If not set, a system default value is used.
2620
+ */
2621
+ dynamicThreshold?: number;
2622
+ };
2623
+
2624
+ /**
2625
+ * Representation of a video.
2626
+ */
2627
+ export type Video = {
2628
+ /**
2629
+ * Raw bytes.
2630
+ */
2631
+ video?: string;
2632
+ /**
2633
+ * Path to another storage.
2634
+ */
2635
+ uri?: string;
2636
+ };
2637
+
2638
+ /**
2639
+ * A generic empty message that you can re-use to avoid defining duplicated
2640
+ * empty messages in your APIs. A typical example is to use it as the request
2641
+ * or the response type of an API method. For instance:
2642
+ *
2643
+ * service Foo {
2644
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
2645
+ * }
2646
+ */
2647
+ export type Empty = {
2648
+ [key: string]: unknown;
2649
+ };
2650
+
2651
+ /**
2652
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
2653
+ */
2654
+ export type CreateTunedModelOperation = BaseOperation & {
2655
+ metadata?: CreateTunedModelMetadata;
2656
+ response?: TunedModel;
2657
+ };
2658
+
2659
+ /**
2660
+ * A list of floats representing an embedding.
2661
+ */
2662
+ export type ContentEmbedding = {
2663
+ /**
2664
+ * The embedding values. This is for 3P users only and will not be populated
2665
+ * for 1P calls.
2666
+ */
2667
+ values?: Array<number>;
2668
+ /**
2669
+ * This field stores the soft tokens tensor frame shape
2670
+ * (e.g. [1, 1, 256, 2048]).
2671
+ */
2672
+ shape?: Array<number>;
2673
+ };
2674
+
2675
+ /**
2676
+ * Response message for [PredictionService.Predict].
2677
+ */
2678
+ export type PredictResponse = {
2679
+ /**
2680
+ * The outputs of the prediction call.
2681
+ */
2682
+ predictions?: Array<unknown>;
2683
+ };
2684
+
2685
+ /**
2686
+ * Chunk from the web.
2687
+ */
2688
+ export type Web = {
2689
+ /**
2690
+ * Output only. URI reference of the chunk.
2691
+ */
2692
+ readonly uri?: string;
2693
+ /**
2694
+ * Output only. Title of the chunk.
2695
+ */
2696
+ readonly title?: string;
2697
+ };
2698
+
2699
+ /**
2700
+ * Grounding support.
2701
+ */
2702
+ export type GoogleAiGenerativelanguageV1BetaGroundingSupport = {
2703
+ /**
2704
+ * Segment of the content this support belongs to.
2705
+ */
2706
+ segment?: GoogleAiGenerativelanguageV1BetaSegment;
2707
+ /**
2708
+ * Optional. A list of indices (into 'grounding_chunk' in
2709
+ * `response.candidate.grounding_metadata`) specifying the citations
2710
+ * associated with the claim. For instance [1,3,4] means that
2711
+ * grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the
2712
+ * retrieved content attributed to the claim. If the response is streaming,
2713
+ * the grounding_chunk_indices refer to the indices across all responses.
2714
+ * It is the client's responsibility to accumulate the grounding chunks from
2715
+ * all responses (while maintaining the same order).
2716
+ */
2717
+ groundingChunkIndices?: Array<number>;
2718
+ /**
2719
+ * Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the
2720
+ * most confident. This list must have the same size as the
2721
+ * grounding_chunk_indices.
2722
+ */
2723
+ confidenceScores?: Array<number>;
2724
+ /**
2725
+ * Output only. Indices into the `parts` field of the candidate's content. These indices
2726
+ * specify which rendered parts are associated with this support source.
2727
+ */
2728
+ readonly renderedParts?: Array<number>;
2729
+ };
2730
+
2731
+ /**
2732
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
2733
+ */
2734
+ export type ImportFileOperation = BaseOperation & {
2735
+ metadata?: ImportFileMetadata;
2736
+ response?: ImportFileResponse;
2737
+ };
2738
+
2739
+ /**
2740
+ * Safety feedback for an entire request.
2741
+ *
2742
+ * This field is populated if content in the input and/or response is blocked
2743
+ * due to safety settings. SafetyFeedback may not exist for every HarmCategory.
2744
+ * Each SafetyFeedback will return the safety settings used by the request as
2745
+ * well as the lowest HarmProbability that should be allowed in order to return
2746
+ * a result.
2747
+ */
2748
+ export type SafetyFeedback = {
2749
+ /**
2750
+ * Safety rating evaluated from content.
2751
+ */
2752
+ rating?: SafetyRating;
2753
+ /**
2754
+ * Safety settings applied to the request.
2755
+ */
2756
+ setting?: SafetySetting;
2757
+ };
2758
+
2759
+ /**
2760
+ * Filter condition applicable to a single key.
2761
+ */
2762
+ export type Condition = {
2763
+ /**
2764
+ * The string value to filter the metadata on.
2765
+ */
2766
+ stringValue?: string;
2767
+ /**
2768
+ * The numeric value to filter the metadata on.
2769
+ */
2770
+ numericValue?: number;
2771
+ /**
2772
+ * Required. Operator applied to the given key-value pair to trigger the condition.
2773
+ */
2774
+ operation: 'OPERATOR_UNSPECIFIED' | 'LESS' | 'LESS_EQUAL' | 'EQUAL' | 'GREATER_EQUAL' | 'GREATER' | 'NOT_EQUAL' | 'INCLUDES' | 'EXCLUDES';
2775
+ };
2776
+
2777
+ /**
2778
+ * A `Corpus` is a collection of `Document`s.
2779
+ * A project can create up to 10 corpora.
2780
+ */
2781
+ export type Corpus = {
2782
+ /**
2783
+ * Output only. The Timestamp of when the `Corpus` was last updated.
2784
+ */
2785
+ readonly updateTime?: string;
2786
+ /**
2787
+ * Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the "corpora/" prefix)
2788
+ * can contain up to 40 characters that are lowercase alphanumeric or dashes
2789
+ * (-). The ID cannot start or end with a dash. If the name is empty on
2790
+ * create, a unique name will be derived from `display_name` along with a 12
2791
+ * character random suffix.
2792
+ * Example: `corpora/my-awesome-corpora-123a456b789c`
2793
+ */
2794
+ readonly name?: string;
2795
+ /**
2796
+ * Output only. The Timestamp of when the `Corpus` was created.
2797
+ */
2798
+ readonly createTime?: string;
2799
+ /**
2800
+ * Optional. The human-readable display name for the `Corpus`. The display name must be
2801
+ * no more than 512 characters in length, including spaces.
2802
+ * Example: "Docs on Semantic Retriever"
2803
+ */
2804
+ displayName?: string;
2805
+ };
2806
+
2807
+ /**
2808
+ * Configuration for specifying function calling behavior.
2809
+ */
2810
+ export type FunctionCallingConfig = {
2811
+ /**
2812
+ * Optional. Specifies the mode in which function calling should execute. If
2813
+ * unspecified, the default value will be set to AUTO.
2814
+ */
2815
+ mode?: 'MODE_UNSPECIFIED' | 'AUTO' | 'ANY' | 'NONE' | 'VALIDATED';
2816
+ /**
2817
+ * Optional. A set of function names that, when provided, limits the functions the model
2818
+ * will call.
2819
+ *
2820
+ * This should only be set when the Mode is ANY or VALIDATED. Function names
2821
+ * should match [FunctionDeclaration.name]. When set, model will
2822
+ * predict a function call from only allowed function names.
2823
+ */
2824
+ allowedFunctionNames?: Array<string>;
2825
+ };
2826
+
2827
+ /**
2828
+ * Response from `ListPermissions` containing a paginated list of
2829
+ * permissions.
2830
+ */
2831
+ export type ListPermissionsResponse = {
2832
+ /**
2833
+ * A token, which can be sent as `page_token` to retrieve the next page.
2834
+ *
2835
+ * If this field is omitted, there are no more pages.
2836
+ */
2837
+ nextPageToken?: string;
2838
+ /**
2839
+ * Returned permissions.
2840
+ */
2841
+ permissions?: Array<Permission>;
2842
+ };
2843
+
2844
+ /**
2845
+ * The requests to be processed in the batch if provided as part of the
2846
+ * batch creation request.
2847
+ */
2848
+ export type InlinedRequests = {
2849
+ /**
2850
+ * Required. The requests to be processed in the batch.
2851
+ */
2852
+ requests: Array<InlinedRequest>;
2853
+ };
2854
+
2855
+ /**
2856
+ * Metadata on the usage of the embedding request.
2857
+ */
2858
+ export type EmbeddingUsageMetadata = {
2859
+ /**
2860
+ * Output only. Number of tokens in the prompt.
2861
+ */
2862
+ readonly promptTokenCount?: number;
2863
+ /**
2864
+ * Output only. List of modalities that were processed in the request input.
2865
+ */
2866
+ readonly promptTokenDetails?: Array<ModalityTokenCount>;
2867
+ };
2868
+
2869
+ /**
2870
+ * The requests to be processed in the batch if provided as part of the
2871
+ * batch creation request.
2872
+ */
2873
+ export type InlinedEmbedContentRequests = {
2874
+ /**
2875
+ * Required. The requests to be processed in the batch.
2876
+ */
2877
+ requests: Array<InlinedEmbedContentRequest>;
2878
+ };
2879
+
2880
+ /**
2881
+ * Response from `ListDocuments` containing a paginated list of `Document`s.
2882
+ * The `Document`s are sorted by ascending `document.create_time`.
2883
+ */
2884
+ export type ListDocumentsResponse = {
2885
+ /**
2886
+ * The returned `Document`s.
2887
+ */
2888
+ documents?: Array<Document>;
2889
+ /**
2890
+ * A token, which can be sent as `page_token` to retrieve the next page.
2891
+ * If this field is omitted, there are no more pages.
2892
+ */
2893
+ nextPageToken?: string;
2894
+ };
2895
+
2896
+ export type HarmCategory = 'HARM_CATEGORY_UNSPECIFIED' | 'HARM_CATEGORY_DEROGATORY' | 'HARM_CATEGORY_TOXICITY' | 'HARM_CATEGORY_VIOLENCE' | 'HARM_CATEGORY_SEXUAL' | 'HARM_CATEGORY_MEDICAL' | 'HARM_CATEGORY_DANGEROUS' | 'HARM_CATEGORY_HARASSMENT' | 'HARM_CATEGORY_HATE_SPEECH' | 'HARM_CATEGORY_SEXUALLY_EXPLICIT' | 'HARM_CATEGORY_DANGEROUS_CONTENT' | 'HARM_CATEGORY_CIVIC_INTEGRITY';
2897
+
2898
+ /**
2899
+ * The output of a batch request. This is returned in the
2900
+ * `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.
2901
+ */
2902
+ export type GenerateContentBatchOutput = {
2903
+ /**
2904
+ * Output only. The file ID of the file containing the responses.
2905
+ * The file will be a JSONL file with a single response per line.
2906
+ * The responses will be `GenerateContentResponse` messages formatted as
2907
+ * JSON.
2908
+ * The responses will be written in the same order as the input requests.
2909
+ */
2910
+ readonly responsesFile?: string;
2911
+ /**
2912
+ * Output only. The responses to the requests in the batch. Returned when the batch was
2913
+ * built using inlined requests. The responses will be in the same order as
2914
+ * the input requests.
2915
+ */
2916
+ inlinedResponses?: InlinedResponses;
2917
+ };
2918
+
2919
+ /**
2920
+ * Request to generate a message response from the model.
2921
+ */
2922
+ export type GenerateMessageRequest = {
2923
+ /**
2924
+ * Required. The structured textual input given to the model as a prompt.
2925
+ *
2926
+ * Given a
2927
+ * prompt, the model will return what it predicts is the next message in the
2928
+ * discussion.
2929
+ */
2930
+ prompt: MessagePrompt;
2931
+ /**
2932
+ * Optional. Controls the randomness of the output.
2933
+ *
2934
+ * Values can range over `[0.0,1.0]`,
2935
+ * inclusive. A value closer to `1.0` will produce responses that are more
2936
+ * varied, while a value closer to `0.0` will typically result in
2937
+ * less surprising responses from the model.
2938
+ */
2939
+ temperature?: number;
2940
+ /**
2941
+ * Optional. The number of generated response messages to return.
2942
+ *
2943
+ * This value must be between
2944
+ * `[1, 8]`, inclusive. If unset, this will default to `1`.
2945
+ */
2946
+ candidateCount?: number;
2947
+ /**
2948
+ * Optional. The maximum cumulative probability of tokens to consider when sampling.
2949
+ *
2950
+ * The model uses combined Top-k and nucleus sampling.
2951
+ *
2952
+ * Nucleus sampling considers the smallest set of tokens whose probability
2953
+ * sum is at least `top_p`.
2954
+ */
2955
+ topP?: number;
2956
+ /**
2957
+ * Optional. The maximum number of tokens to consider when sampling.
2958
+ *
2959
+ * The model uses combined Top-k and nucleus sampling.
2960
+ *
2961
+ * Top-k sampling considers the set of `top_k` most probable tokens.
2962
+ */
2963
+ topK?: number;
2964
+ };
2965
+
2966
+ /**
2967
+ * Response for `ListGeneratedFiles`.
2968
+ */
2969
+ export type ListGeneratedFilesResponse = {
2970
+ /**
2971
+ * The list of `GeneratedFile`s.
2972
+ */
2973
+ generatedFiles?: Array<GeneratedFile>;
2974
+ /**
2975
+ * A token that can be sent as a `page_token` into a subsequent
2976
+ * `ListGeneratedFiles` call.
2977
+ */
2978
+ nextPageToken?: string;
2979
+ };
2980
+
2981
+ export type BatchState = 'BATCH_STATE_UNSPECIFIED' | 'BATCH_STATE_PENDING' | 'BATCH_STATE_RUNNING' | 'BATCH_STATE_SUCCEEDED' | 'BATCH_STATE_FAILED' | 'BATCH_STATE_CANCELLED' | 'BATCH_STATE_EXPIRED';
2982
+
2983
+ /**
2984
+ * A list of string values.
2985
+ */
2986
+ export type GroundingChunkStringList = {
2987
+ /**
2988
+ * The string values of the list.
2989
+ */
2990
+ values?: Array<string>;
2991
+ };
2992
+
2993
+ /**
2994
+ * The response to a single request in the batch.
2995
+ */
2996
+ export type InlinedEmbedContentResponse = {
2997
+ /**
2998
+ * Output only. The error encountered while processing the request.
2999
+ */
3000
+ error?: Status;
3001
+ /**
3002
+ * Output only. The metadata associated with the request.
3003
+ */
3004
+ readonly metadata?: {};
3005
+ /**
3006
+ * Output only. The response to the request.
3007
+ */
3008
+ response?: EmbedContentResponse;
3009
+ };
3010
+
3011
+ /**
3012
+ * A transport that can stream HTTP requests and responses.
3013
+ * Next ID: 6
3014
+ */
3015
+ export type StreamableHttpTransport = {
3016
+ /**
3017
+ * Optional: Fields for authentication headers, timeouts, etc., if needed.
3018
+ */
3019
+ headers?: {
3020
+ [key: string]: string;
3021
+ };
3022
+ /**
3023
+ * Timeout for SSE read operations.
3024
+ */
3025
+ sseReadTimeout?: string;
3026
+ /**
3027
+ * The full URL for the MCPServer endpoint.
3028
+ * Example: "https://api.example.com/mcp"
3029
+ */
3030
+ url?: string;
3031
+ /**
3032
+ * HTTP timeout for regular operations.
3033
+ */
3034
+ timeout?: string;
3035
+ /**
3036
+ * Whether to close the client session when the transport closes.
3037
+ */
3038
+ terminateOnClose?: boolean;
3039
+ };
3040
+
3041
+ /**
3042
+ * A citation to a source for a portion of a specific response.
3043
+ */
3044
+ export type CitationSource = {
3045
+ /**
3046
+ * Optional. End of the attributed segment, exclusive.
3047
+ */
3048
+ endIndex?: number;
3049
+ /**
3050
+ * Optional. URI that is attributed as a source for a portion of the text.
3051
+ */
3052
+ uri?: string;
3053
+ /**
3054
+ * Optional. License for the GitHub project that is attributed as a source for segment.
3055
+ *
3056
+ * License info is required for code citations.
3057
+ */
3058
+ license?: string;
3059
+ /**
3060
+ * Optional. Start of segment of the response that is attributed to this source.
3061
+ *
3062
+ * Index indicates the start of the segment, measured in bytes.
3063
+ */
3064
+ startIndex?: number;
3065
+ };
3066
+
3067
+ /**
3068
+ * The response to a `BatchEmbedContentsRequest`.
3069
+ */
3070
+ export type BatchEmbedContentsResponse = {
3071
+ /**
3072
+ * Output only. The usage metadata for the request.
3073
+ */
3074
+ usageMetadata?: EmbeddingUsageMetadata;
3075
+ /**
3076
+ * Output only. The embeddings for each request, in the same order as provided in the batch
3077
+ * request.
3078
+ */
3079
+ readonly embeddings?: Array<ContentEmbedding>;
3080
+ };
3081
+
3082
+ /**
3083
+ * Response with CachedContents list.
3084
+ */
3085
+ export type ListCachedContentsResponse = {
3086
+ /**
3087
+ * List of cached contents.
3088
+ */
3089
+ cachedContents?: Array<CachedContent>;
3090
+ /**
3091
+ * A token, which can be sent as `page_token` to retrieve the next page.
3092
+ * If this field is omitted, there are no subsequent pages.
3093
+ */
3094
+ nextPageToken?: string;
3095
+ };
3096
+
3097
+ /**
3098
+ * Request to generate a text completion response from the model.
3099
+ */
3100
+ export type GenerateTextRequest = {
3101
+ /**
3102
+ * Optional. The maximum number of tokens to include in a candidate.
3103
+ *
3104
+ * If unset, this will default to output_token_limit specified in the `Model`
3105
+ * specification.
3106
+ */
3107
+ maxOutputTokens?: number;
3108
+ /**
3109
+ * Optional. The maximum cumulative probability of tokens to consider when sampling.
3110
+ *
3111
+ * The model uses combined Top-k and nucleus sampling.
3112
+ *
3113
+ * Tokens are sorted based on their assigned probabilities so that only the
3114
+ * most likely tokens are considered. Top-k sampling directly limits the
3115
+ * maximum number of tokens to consider, while Nucleus sampling limits number
3116
+ * of tokens based on the cumulative probability.
3117
+ *
3118
+ * Note: The default value varies by model, see the `Model.top_p`
3119
+ * attribute of the `Model` returned the `getModel` function.
3120
+ */
3121
+ topP?: number;
3122
+ /**
3123
+ * Required. The free-form input text given to the model as a prompt.
3124
+ *
3125
+ * Given a prompt, the model will generate a TextCompletion response it
3126
+ * predicts as the completion of the input text.
3127
+ */
3128
+ prompt: TextPrompt;
3129
+ /**
3130
+ * Optional. Controls the randomness of the output.
3131
+ * Note: The default value varies by model, see the `Model.temperature`
3132
+ * attribute of the `Model` returned the `getModel` function.
3133
+ *
3134
+ * Values can range from [0.0,1.0],
3135
+ * inclusive. A value closer to 1.0 will produce responses that are more
3136
+ * varied and creative, while a value closer to 0.0 will typically result in
3137
+ * more straightforward responses from the model.
3138
+ */
3139
+ temperature?: number;
3140
+ /**
3141
+ * Optional. Number of generated responses to return.
3142
+ *
3143
+ * This value must be between [1, 8], inclusive. If unset, this will default
3144
+ * to 1.
3145
+ */
3146
+ candidateCount?: number;
3147
+ /**
3148
+ * Optional. A list of unique `SafetySetting` instances for blocking unsafe content.
3149
+ *
3150
+ * that will be enforced on the `GenerateTextRequest.prompt` and
3151
+ * `GenerateTextResponse.candidates`. There should not be more than one
3152
+ * setting for each `SafetyCategory` type. The API will block any prompts and
3153
+ * responses that fail to meet the thresholds set by these settings. This list
3154
+ * overrides the default settings for each `SafetyCategory` specified in the
3155
+ * safety_settings. If there is no `SafetySetting` for a given
3156
+ * `SafetyCategory` provided in the list, the API will use the default safety
3157
+ * setting for that category. Harm categories HARM_CATEGORY_DEROGATORY,
3158
+ * HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL,
3159
+ * HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text
3160
+ * service.
3161
+ */
3162
+ safetySettings?: Array<SafetySetting>;
3163
+ /**
3164
+ * Optional. The maximum number of tokens to consider when sampling.
3165
+ *
3166
+ * The model uses combined Top-k and nucleus sampling.
3167
+ *
3168
+ * Top-k sampling considers the set of `top_k` most probable tokens.
3169
+ * Defaults to 40.
3170
+ *
3171
+ * Note: The default value varies by model, see the `Model.top_k`
3172
+ * attribute of the `Model` returned the `getModel` function.
3173
+ */
3174
+ topK?: number;
3175
+ /**
3176
+ * The set of character sequences (up to 5) that will stop output generation.
3177
+ * If specified, the API will stop at the first appearance of a stop
3178
+ * sequence. The stop sequence will not be included as part of the response.
3179
+ */
3180
+ stopSequences?: Array<string>;
3181
+ };
3182
+
3183
+ /**
3184
+ * Batch request to get embeddings from the model for a list of prompts.
3185
+ */
3186
+ export type BatchEmbedContentsRequest = {
3187
+ /**
3188
+ * Required. Embed requests for the batch. The model in each of these requests must
3189
+ * match the model specified `BatchEmbedContentsRequest.model`.
3190
+ */
3191
+ requests: Array<EmbedContentRequest>;
3192
+ };
3193
+
3194
+ /**
3195
+ * User provided string values assigned to a single metadata key.
3196
+ */
3197
+ export type StringList = {
3198
+ /**
3199
+ * The string values of the metadata to store.
3200
+ */
3201
+ values?: Array<string>;
3202
+ };
3203
+
3204
+ /**
3205
+ * Request for a `BatchGenerateContent` operation.
3206
+ */
3207
+ export type BatchGenerateContentRequest = {
3208
+ /**
3209
+ * Required. The batch to create.
3210
+ */
3211
+ batch: GenerateContentBatch;
3212
+ };
3213
+
3214
+ export type CustomLongRunningOperation = {
3215
+ /**
3216
+ * The normal, successful response of the operation. If the original
3217
+ * method returns no data on success, such as `Delete`, the response is
3218
+ * `google.protobuf.Empty`. If the original method is standard
3219
+ * `Get`/`Create`/`Update`, the response should be the resource. For other
3220
+ * methods, the response should have the type `XxxResponse`, where `Xxx`
3221
+ * is the original method name. For example, if the original method name
3222
+ * is `TakeSnapshot()`, the inferred response type is
3223
+ * `TakeSnapshotResponse`.
3224
+ */
3225
+ response?: {};
3226
+ /**
3227
+ * Service-specific metadata associated with the operation. It typically
3228
+ * contains progress information and common metadata such as create time.
3229
+ * Some services might not provide such metadata. Any method that returns a
3230
+ * long-running operation should document the metadata type, if any.
3231
+ */
3232
+ metadata?: {};
3233
+ /**
3234
+ * The server-assigned name, which is only unique within the same service that
3235
+ * originally returns it. If you use the default HTTP mapping, the
3236
+ * `name` should be a resource name ending with `operations/{unique_id}`.
3237
+ */
3238
+ name?: string;
3239
+ /**
3240
+ * The error result of the operation in case of failure or cancellation.
3241
+ */
3242
+ error?: Status;
3243
+ /**
3244
+ * If the value is `false`, it means the operation is still in progress.
3245
+ * If `true`, the operation is completed, and either `error` or `response` is
3246
+ * available.
3247
+ */
3248
+ done?: boolean;
3249
+ };
3250
+
3251
+ /**
3252
+ * This resource represents a long-running operation where metadata and response fields are strongly typed.
3253
+ */
3254
+ export type AsyncBatchEmbedContentOperation = BaseOperation & {
3255
+ metadata?: EmbedContentBatch;
3256
+ response?: AsyncBatchEmbedContentResponse;
3257
+ };
3258
+
3259
+ /**
3260
+ * Tool that executes code generated by the model, and automatically returns
3261
+ * the result to the model.
3262
+ *
3263
+ * See also `ExecutableCode` and `CodeExecutionResult` which are only generated
3264
+ * when using this tool.
3265
+ */
3266
+ export type CodeExecution = {
3267
+ [key: string]: unknown;
3268
+ };
3269
+
3270
+ /**
3271
+ * Metadata for PredictLongRunning long running operations.
3272
+ */
3273
+ export type PredictLongRunningMetadata = {
3274
+ [key: string]: unknown;
3275
+ };
3276
+
3277
+ /**
3278
+ * Configuration for a white space chunking algorithm [white space delimited].
3279
+ */
3280
+ export type WhiteSpaceConfig = {
3281
+ /**
3282
+ * Maximum number of overlapping tokens between two adjacent chunks.
3283
+ */
3284
+ maxOverlapTokens?: number;
3285
+ /**
3286
+ * Maximum number of tokens per chunk.
3287
+ * Tokens are defined as words for this chunking algorithm.
3288
+ * Note: we are defining tokens as words split by whitespace as opposed to
3289
+ * the output of a tokenizer. The context window of the latest gemini
3290
+ * embedding model as of 2025-04-17 is currently 8192 tokens. We assume that
3291
+ * the average word is 5 characters. Therefore, we set the upper limit to
3292
+ * 2**9, which is 512 words, or 2560 tokens, assuming worst case a
3293
+ * character per token. This is a conservative estimate meant to prevent
3294
+ * context window overflow.
3295
+ */
3296
+ maxTokensPerChunk?: number;
3297
+ };
3298
+
3299
+ /**
3300
+ * Safety rating for a piece of content.
3301
+ *
3302
+ * The safety rating contains the category of harm and the
3303
+ * harm probability level in that category for a piece of content.
3304
+ * Content is classified for safety across a number of
3305
+ * harm categories and the probability of the harm classification is included
3306
+ * here.
3307
+ */
3308
+ export type SafetyRating = {
3309
+ /**
3310
+ * Required. The probability of harm for this content.
3311
+ */
3312
+ probability: 'HARM_PROBABILITY_UNSPECIFIED' | 'NEGLIGIBLE' | 'LOW' | 'MEDIUM' | 'HIGH';
3313
+ /**
3314
+ * Required. The category for this rating.
3315
+ */
3316
+ category: HarmCategory;
3317
+ /**
3318
+ * Was this content blocked because of this rating?
3319
+ */
3320
+ blocked?: boolean;
3321
+ };
3322
+
3323
+ /**
3324
+ * URI based data.
3325
+ */
3326
+ export type FileData = {
3327
+ /**
3328
+ * Optional. The IANA standard MIME type of the source data.
3329
+ */
3330
+ mimeType?: string;
3331
+ /**
3332
+ * Required. URI.
3333
+ */
3334
+ fileUri: string;
3335
+ };
3336
+
3337
+ /**
3338
+ * Tool to support URL context retrieval.
3339
+ */
3340
+ export type UrlContext = {
3341
+ [key: string]: unknown;
3342
+ };
3343
+
3344
+ /**
3345
+ * The configuration for the prebuilt speaker to use.
3346
+ */
3347
+ export type PrebuiltVoiceConfig = {
3348
+ /**
3349
+ * The name of the preset voice to use.
3350
+ */
3351
+ voiceName?: string;
3352
+ };
3353
+
3354
+ /**
3355
+ * Response from UploadToFileSearchStore.
3356
+ */
3357
+ export type UploadToFileSearchStoreResponse = {
3358
+ /**
3359
+ * The name of the `FileSearchStore` containing `Document`s.
3360
+ * Example: `fileSearchStores/my-file-search-store-123`
3361
+ */
3362
+ parent?: string;
3363
+ /**
3364
+ * Immutable. Identifier. The identifier for the `Document` imported.
3365
+ * Example: `fileSearchStores/my-file-search-store-123a456b789c`
3366
+ */
3367
+ documentName?: string;
3368
+ /**
3369
+ * MIME type of the file.
3370
+ */
3371
+ mimeType?: string;
3372
+ /**
3373
+ * Size of the file in bytes.
3374
+ */
3375
+ sizeBytes?: string;
3376
+ };
3377
+
3378
+ /**
3379
+ * Metadata returned to client when grounding is enabled.
3380
+ */
3381
+ export type GroundingMetadata = {
3382
+ /**
3383
+ * Optional. Google search entry for the following-up web searches.
3384
+ */
3385
+ searchEntryPoint?: SearchEntryPoint;
3386
+ /**
3387
+ * Web search queries for the following-up web search.
3388
+ */
3389
+ webSearchQueries?: Array<string>;
3390
+ /**
3391
+ * List of supporting references retrieved from specified grounding source.
3392
+ * When streaming, this only contains the grounding chunks that have not been
3393
+ * included in the grounding metadata of previous responses.
3394
+ */
3395
+ groundingChunks?: Array<GroundingChunk>;
3396
+ /**
3397
+ * Image search queries used for grounding.
3398
+ */
3399
+ imageSearchQueries?: Array<string>;
3400
+ /**
3401
+ * List of grounding support.
3402
+ */
3403
+ groundingSupports?: Array<GoogleAiGenerativelanguageV1BetaGroundingSupport>;
3404
+ /**
3405
+ * Metadata related to retrieval in the grounding flow.
3406
+ */
3407
+ retrievalMetadata?: RetrievalMetadata;
3408
+ /**
3409
+ * Optional. Resource name of the Google Maps widget context token that can be used
3410
+ * with the PlacesContextElement widget in order to render contextual data.
3411
+ * Only populated in the case that grounding with Google Maps is enabled.
3412
+ */
3413
+ googleMapsWidgetContextToken?: string;
3414
+ };
3415
+
3416
+ /**
3417
+ * Output text returned from a model.
3418
+ */
3419
+ export type TextCompletion = {
3420
+ /**
3421
+ * Output only. The generated text returned from the model.
3422
+ */
3423
+ readonly output?: string;
3424
+ /**
3425
+ * Output only. Citation information for model-generated `output` in this
3426
+ * `TextCompletion`.
3427
+ *
3428
+ * This field may be populated with attribution information for any text
3429
+ * included in the `output`.
3430
+ */
3431
+ citationMetadata?: CitationMetadata;
3432
+ /**
3433
+ * Ratings for the safety of a response.
3434
+ *
3435
+ * There is at most one rating per category.
3436
+ */
3437
+ safetyRatings?: Array<SafetyRating>;
3438
+ };
3439
+
3440
+ /**
3441
+ * Request containing the `Content` for the model to embed.
3442
+ */
3443
+ export type EmbedContentRequest = {
3444
+ /**
3445
+ * Required. The content to embed. Only the `parts.text` fields will be counted.
3446
+ */
3447
+ content: Content;
3448
+ /**
3449
+ * Optional. Optional task type for which the embeddings will be used. Not supported on
3450
+ * earlier models (`models/embedding-001`).
3451
+ */
3452
+ taskType?: TaskType;
3453
+ /**
3454
+ * Optional. An optional title for the text. Only applicable when TaskType is
3455
+ * `RETRIEVAL_DOCUMENT`.
3456
+ *
3457
+ * Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality
3458
+ * embeddings for retrieval.
3459
+ */
3460
+ title?: string;
3461
+ /**
3462
+ * Required. The model's resource name. This serves as an ID for the Model to use.
3463
+ *
3464
+ * This name should match a model name returned by the `ListModels` method.
3465
+ *
3466
+ * Format: `models/{model}`
3467
+ */
3468
+ model: string;
3469
+ /**
3470
+ * Optional. Optional reduced dimension for the output embedding. If set, excessive
3471
+ * values in the output embedding are truncated from the end. Supported by
3472
+ * newer models since 2024 only. You cannot set this value if using the
3473
+ * earlier model (`models/embedding-001`).
3474
+ */
3475
+ outputDimensionality?: number;
3476
+ };
3477
+
3478
+ /**
3479
+ * User provided metadata stored as key-value pairs.
3480
+ */
3481
+ export type CustomMetadata = {
3482
+ /**
3483
+ * The string value of the metadata to store.
3484
+ */
3485
+ stringValue?: string;
3486
+ /**
3487
+ * The StringList value of the metadata to store.
3488
+ */
3489
+ stringListValue?: StringList;
3490
+ /**
3491
+ * The numeric value of the metadata to store.
3492
+ */
3493
+ numericValue?: number;
3494
+ /**
3495
+ * Required. The key of the metadata to store.
3496
+ */
3497
+ key: string;
3498
+ };
3499
+
3500
+ /**
3501
+ * Standard web search for grounding and related configurations.
3502
+ */
3503
+ export type WebSearch = {
3504
+ [key: string]: unknown;
3505
+ };
3506
+
3507
+ /**
3508
+ * Chunk from image search.
3509
+ */
3510
+ export type Image = {
3511
+ /**
3512
+ * The title of the web page that the image is from.
3513
+ */
3514
+ title?: string;
3515
+ /**
3516
+ * The root domain of the web page that the image is from, e.g.
3517
+ * "example.com".
3518
+ */
3519
+ domain?: string;
3520
+ /**
3521
+ * The web page URI for attribution.
3522
+ */
3523
+ sourceUri?: string;
3524
+ /**
3525
+ * The image asset URL.
3526
+ */
3527
+ imageUri?: string;
3528
+ };
3529
+
3530
+ /**
3531
+ * The response message for Operations.ListOperations.
3532
+ */
3533
+ export type ListOperationsResponse = {
3534
+ /**
3535
+ * A list of operations that matches the specified filter in the request.
3536
+ */
3537
+ operations?: Array<Operation>;
3538
+ /**
3539
+ * The standard List next-page token.
3540
+ */
3541
+ nextPageToken?: string;
3542
+ /**
3543
+ * Unordered list. Unreachable resources. Populated when the request sets
3544
+ * `ListOperationsRequest.return_partial_success` and reads across
3545
+ * collections. For example, when attempting to list all resources across all
3546
+ * supported locations.
3547
+ */
3548
+ unreachable?: Array<string>;
3549
+ };
3550
+
3551
+ /**
3552
+ * The responses to the requests in the batch.
3553
+ */
3554
+ export type InlinedEmbedContentResponses = {
3555
+ /**
3556
+ * Output only. The responses to the requests in the batch.
3557
+ */
3558
+ readonly inlinedResponses?: Array<InlinedEmbedContentResponse>;
3559
+ };
3560
+
3561
+ /**
3562
+ * Request to generate a grounded answer from the `Model`.
3563
+ */
3564
+ export type GenerateAnswerRequest = {
3565
+ /**
3566
+ * Required. The content of the current conversation with the `Model`. For single-turn
3567
+ * queries, this is a single question to answer. For multi-turn queries, this
3568
+ * is a repeated field that contains conversation history and the last
3569
+ * `Content` in the list containing the question.
3570
+ *
3571
+ * Note: `GenerateAnswer` only supports queries in English.
3572
+ */
3573
+ contents: Array<Content>;
3574
+ /**
3575
+ * Content retrieved from resources created via the Semantic Retriever
3576
+ * API.
3577
+ */
3578
+ semanticRetriever?: SemanticRetrieverConfig;
3579
+ /**
3580
+ * Optional. A list of unique `SafetySetting` instances for blocking unsafe content.
3581
+ *
3582
+ * This will be enforced on the `GenerateAnswerRequest.contents` and
3583
+ * `GenerateAnswerResponse.candidate`. There should not be more than one
3584
+ * setting for each `SafetyCategory` type. The API will block any contents and
3585
+ * responses that fail to meet the thresholds set by these settings. This list
3586
+ * overrides the default settings for each `SafetyCategory` specified in the
3587
+ * safety_settings. If there is no `SafetySetting` for a given
3588
+ * `SafetyCategory` provided in the list, the API will use the default safety
3589
+ * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,
3590
+ * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
3591
+ * HARM_CATEGORY_HARASSMENT are supported.
3592
+ * Refer to the
3593
+ * [guide](https://ai.google.dev/gemini-api/docs/safety-settings)
3594
+ * for detailed information on available safety settings. Also refer to the
3595
+ * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to
3596
+ * learn how to incorporate safety considerations in your AI applications.
3597
+ */
3598
+ safetySettings?: Array<SafetySetting>;
3599
+ /**
3600
+ * Optional. Controls the randomness of the output.
3601
+ *
3602
+ * Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will
3603
+ * produce responses that are more varied and creative, while a value closer
3604
+ * to 0.0 will typically result in more straightforward responses from the
3605
+ * model. A low temperature (~0.2) is usually recommended for
3606
+ * Attributed-Question-Answering use cases.
3607
+ */
3608
+ temperature?: number;
3609
+ /**
3610
+ * Required. Style in which answers should be returned.
3611
+ */
3612
+ answerStyle: 'ANSWER_STYLE_UNSPECIFIED' | 'ABSTRACTIVE' | 'EXTRACTIVE' | 'VERBOSE';
3613
+ /**
3614
+ * Passages provided inline with the request.
3615
+ */
3616
+ inlinePassages?: GroundingPassages;
3617
+ };
3618
+
3619
+ /**
3620
+ * Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata
3621
+ * describes the input video content.
3622
+ * @deprecated
3623
+ */
3624
+ export type VideoMetadata = {
3625
+ /**
3626
+ * Optional. The frame rate of the video sent to the model. If not specified, the
3627
+ * default value will be 1.0.
3628
+ * The fps range is (0.0, 24.0].
3629
+ */
3630
+ fps?: number;
3631
+ /**
3632
+ * Optional. The end offset of the video.
3633
+ */
3634
+ endOffset?: string;
3635
+ /**
3636
+ * Optional. The start offset of the video.
3637
+ */
3638
+ startOffset?: string;
3639
+ };
3640
+
3641
+ /**
3642
+ * The configuration for the multi-speaker setup.
3643
+ */
3644
+ export type MultiSpeakerVoiceConfig = {
3645
+ /**
3646
+ * Required. All the enabled speaker voices.
3647
+ */
3648
+ speakerVoiceConfigs: Array<SpeakerVoiceConfig>;
3649
+ };
3650
+
3651
+ /**
3652
+ * Represents a time interval, encoded as a Timestamp start (inclusive) and a
3653
+ * Timestamp end (exclusive).
3654
+ *
3655
+ * The start must be less than or equal to the end.
3656
+ * When the start equals the end, the interval is empty (matches no time).
3657
+ * When both start and end are unspecified, the interval matches any time.
3658
+ */
3659
+ export type Interval = {
3660
+ /**
3661
+ * Optional. Inclusive start of the interval.
3662
+ *
3663
+ * If specified, a Timestamp matching this interval will have to be the same
3664
+ * or after the start.
3665
+ */
3666
+ startTime?: string;
3667
+ /**
3668
+ * Optional. Exclusive end of the interval.
3669
+ *
3670
+ * If specified, a Timestamp matching this interval will have to be before the
3671
+ * end.
3672
+ */
3673
+ endTime?: string;
3674
+ };
3675
+
3676
+ /**
3677
+ * The output of a batch request. This is returned in the
3678
+ * `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.
3679
+ */
3680
+ export type EmbedContentBatchOutput = {
3681
+ /**
3682
+ * Output only. The file ID of the file containing the responses.
3683
+ * The file will be a JSONL file with a single response per line.
3684
+ * The responses will be `EmbedContentResponse` messages formatted as JSON.
3685
+ * The responses will be written in the same order as the input requests.
3686
+ */
3687
+ readonly responsesFile?: string;
3688
+ /**
3689
+ * Output only. The responses to the requests in the batch. Returned when the batch was
3690
+ * built using inlined requests. The responses will be in the same order as
3691
+ * the input requests.
3692
+ */
3693
+ inlinedResponses?: InlinedEmbedContentResponses;
3694
+ };
3695
+
3696
+ /**
3697
+ * Response for `CreateFile`.
3698
+ */
3699
+ export type CreateFileResponse = {
3700
+ /**
3701
+ * Metadata for the created file.
3702
+ */
3703
+ file?: File;
3704
+ };
3705
+
3706
+ /**
3707
+ * The responses to the requests in the batch.
3708
+ */
3709
+ export type InlinedResponses = {
3710
+ /**
3711
+ * Output only. The responses to the requests in the batch.
3712
+ */
3713
+ readonly inlinedResponses?: Array<InlinedResponse>;
3714
+ };
3715
+
3716
+ /**
3717
+ * A MCPServer is a server that can be called by the model to perform actions.
3718
+ * It is a server that implements the MCP protocol.
3719
+ * Next ID: 5
3720
+ */
3721
+ export type McpServer = {
3722
+ /**
3723
+ * A transport that can stream HTTP requests and responses.
3724
+ */
3725
+ streamableHttpTransport?: StreamableHttpTransport;
3726
+ /**
3727
+ * The name of the MCPServer.
3728
+ */
3729
+ name?: string;
3730
+ };
3731
+
3732
+ /**
3733
+ * Result of executing the `ExecutableCode`.
3734
+ *
3735
+ * Generated only when the `CodeExecution` tool is used.
3736
+ */
3737
+ export type CodeExecutionResult = {
3738
+ /**
3739
+ * Optional. The identifier of the `ExecutableCode` part this result is for.
3740
+ * Only populated if the corresponding `ExecutableCode` has an id.
3741
+ */
3742
+ id?: string;
3743
+ /**
3744
+ * Required. Outcome of the code execution.
3745
+ */
3746
+ outcome: 'OUTCOME_UNSPECIFIED' | 'OUTCOME_OK' | 'OUTCOME_FAILED' | 'OUTCOME_DEADLINE_EXCEEDED';
3747
+ /**
3748
+ * Optional. Contains stdout when code execution is successful, stderr or other
3749
+ * description otherwise.
3750
+ */
3751
+ output?: string;
3752
+ };
3753
+
3754
+ /**
3755
+ * Metadata related to url context retrieval tool.
3756
+ */
3757
+ export type UrlContextMetadata = {
3758
+ /**
3759
+ * List of url context.
3760
+ */
3761
+ urlMetadata?: Array<UrlMetadata>;
3762
+ };
3763
+
3764
+ /**
3765
+ * Segment of the content.
3766
+ */
3767
+ export type GoogleAiGenerativelanguageV1BetaSegment = {
3768
+ /**
3769
+ * The index of a Part object within its parent Content object.
3770
+ */
3771
+ partIndex?: number;
3772
+ /**
3773
+ * End index in the given Part, measured in bytes. Offset from the start of
3774
+ * the Part, exclusive, starting at zero.
3775
+ */
3776
+ endIndex?: number;
3777
+ /**
3778
+ * Start index in the given Part, measured in bytes. Offset from the start of
3779
+ * the Part, inclusive, starting at zero.
3780
+ */
3781
+ startIndex?: number;
3782
+ /**
3783
+ * The text corresponding to the segment from the response.
3784
+ */
3785
+ text?: string;
3786
+ };
3787
+
3788
+ /**
3789
+ * Configuration options for model generation and outputs. Not all parameters
3790
+ * are configurable for every model.
3791
+ */
3792
+ export type GenerationConfig = {
3793
+ /**
3794
+ * Optional. If true, export the logprobs results in response.
3795
+ */
3796
+ responseLogprobs?: boolean;
3797
+ /**
3798
+ * Optional. The maximum number of tokens to include in a response candidate.
3799
+ *
3800
+ * Note: The default value varies by model, see the `Model.output_token_limit`
3801
+ * attribute of the `Model` returned from the `getModel` function.
3802
+ */
3803
+ maxOutputTokens?: number;
3804
+ /**
3805
+ * Optional. The maximum cumulative probability of tokens to consider when sampling.
3806
+ *
3807
+ * The model uses combined Top-k and Top-p (nucleus) sampling.
3808
+ *
3809
+ * Tokens are sorted based on their assigned probabilities so that only the
3810
+ * most likely tokens are considered. Top-k sampling directly limits the
3811
+ * maximum number of tokens to consider, while Nucleus sampling limits the
3812
+ * number of tokens based on the cumulative probability.
3813
+ *
3814
+ * Note: The default value varies by `Model` and is specified by
3815
+ * the`Model.top_p` attribute returned from the `getModel` function. An empty
3816
+ * `top_k` attribute indicates that the model doesn't apply top-k sampling
3817
+ * and doesn't allow setting `top_k` on requests.
3818
+ */
3819
+ topP?: number;
3820
+ /**
3821
+ * Optional. Seed used in decoding. If not set, the request uses a randomly generated
3822
+ * seed.
3823
+ */
3824
+ seed?: number;
3825
+ /**
3826
+ * Optional. Frequency penalty applied to the next token's logprobs, multiplied by the
3827
+ * number of times each token has been seen in the respponse so far.
3828
+ *
3829
+ * A positive penalty will discourage the use of tokens that have already
3830
+ * been used, proportional to the number of times the token has been used:
3831
+ * The more a token is used, the more difficult it is for the model to use
3832
+ * that token again increasing the vocabulary of responses.
3833
+ *
3834
+ * Caution: A _negative_ penalty will encourage the model to reuse tokens
3835
+ * proportional to the number of times the token has been used. Small
3836
+ * negative values will reduce the vocabulary of a response. Larger negative
3837
+ * values will cause the model to start repeating a common token until it
3838
+ * hits the max_output_tokens
3839
+ * limit.
3840
+ */
3841
+ frequencyPenalty?: number;
3842
+ /**
3843
+ * Optional. The speech generation config.
3844
+ */
3845
+ speechConfig?: SpeechConfig;
3846
+ /**
3847
+ * Optional. Controls the randomness of the output.
3848
+ *
3849
+ * Note: The default value varies by model, see the `Model.temperature`
3850
+ * attribute of the `Model` returned from the `getModel` function.
3851
+ *
3852
+ * Values can range from [0.0, 2.0].
3853
+ */
3854
+ temperature?: number;
3855
+ /**
3856
+ * Optional. MIME type of the generated candidate text.
3857
+ * Supported MIME types are:
3858
+ * `text/plain`: (default) Text output.
3859
+ * `application/json`: JSON response in the response candidates.
3860
+ * `text/x.enum`: ENUM as a string response in the response candidates.
3861
+ * Refer to the
3862
+ * [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats)
3863
+ * for a list of all supported text MIME types.
3864
+ */
3865
+ responseMimeType?: string;
3866
+ /**
3867
+ * Optional. An internal detail. Use `responseJsonSchema` rather than this field.
3868
+ */
3869
+ responseJsonSchema?: unknown;
3870
+ /**
3871
+ * Optional. Enables enhanced civic answers. It may not be available for all models.
3872
+ */
3873
+ enableEnhancedCivicAnswers?: boolean;
3874
+ /**
3875
+ * Optional. The maximum number of tokens to consider when sampling.
3876
+ *
3877
+ * Gemini models use Top-p (nucleus) sampling or a combination of Top-k and
3878
+ * nucleus sampling. Top-k sampling considers the set of `top_k` most probable
3879
+ * tokens. Models running with nucleus sampling don't allow top_k setting.
3880
+ *
3881
+ * Note: The default value varies by `Model` and is specified by
3882
+ * the`Model.top_p` attribute returned from the `getModel` function. An empty
3883
+ * `top_k` attribute indicates that the model doesn't apply top-k sampling
3884
+ * and doesn't allow setting `top_k` on requests.
3885
+ */
3886
+ topK?: number;
3887
+ /**
3888
+ * Optional. If specified, the media resolution specified will be used.
3889
+ */
3890
+ mediaResolution?: 'MEDIA_RESOLUTION_UNSPECIFIED' | 'MEDIA_RESOLUTION_LOW' | 'MEDIA_RESOLUTION_MEDIUM' | 'MEDIA_RESOLUTION_HIGH';
3891
+ /**
3892
+ * Optional. Presence penalty applied to the next token's logprobs if the token has
3893
+ * already been seen in the response.
3894
+ *
3895
+ * This penalty is binary on/off and not dependant on the number of times the
3896
+ * token is used (after the first). Use
3897
+ * frequency_penalty
3898
+ * for a penalty that increases with each use.
3899
+ *
3900
+ * A positive penalty will discourage the use of tokens that have already
3901
+ * been used in the response, increasing the vocabulary.
3902
+ *
3903
+ * A negative penalty will encourage the use of tokens that have already been
3904
+ * used in the response, decreasing the vocabulary.
3905
+ */
3906
+ presencePenalty?: number;
3907
+ /**
3908
+ * Optional. Only valid if response_logprobs=True.
3909
+ * This sets the number of top logprobs, including the chosen candidate, to
3910
+ * return at each decoding step in the Candidate.logprobs_result. The
3911
+ * number must be in the range of [0, 20].
3912
+ */
3913
+ logprobs?: number;
3914
+ /**
3915
+ * Optional. Config for image generation.
3916
+ * An error will be returned if this field is set for models that don't
3917
+ * support these config options.
3918
+ */
3919
+ imageConfig?: ImageConfig;
3920
+ /**
3921
+ * Optional. Output schema of the generated response. This is an alternative to
3922
+ * `response_schema` that accepts [JSON Schema](https://json-schema.org/).
3923
+ *
3924
+ * If set, `response_schema` must be omitted, but `response_mime_type` is
3925
+ * required.
3926
+ *
3927
+ * While the full JSON Schema may be sent, not all features are supported.
3928
+ * Specifically, only the following properties are supported:
3929
+ *
3930
+ * - `$id`
3931
+ * - `$defs`
3932
+ * - `$ref`
3933
+ * - `$anchor`
3934
+ * - `type`
3935
+ * - `format`
3936
+ * - `title`
3937
+ * - `description`
3938
+ * - `enum` (for strings and numbers)
3939
+ * - `items`
3940
+ * - `prefixItems`
3941
+ * - `minItems`
3942
+ * - `maxItems`
3943
+ * - `minimum`
3944
+ * - `maximum`
3945
+ * - `anyOf`
3946
+ * - `oneOf` (interpreted the same as `anyOf`)
3947
+ * - `properties`
3948
+ * - `additionalProperties`
3949
+ * - `required`
3950
+ *
3951
+ * The non-standard `propertyOrdering` property may also be set.
3952
+ *
3953
+ * Cyclic references are unrolled to a limited degree and, as such, may only
3954
+ * be used within non-required properties. (Nullable properties are not
3955
+ * sufficient.) If `$ref` is set on a sub-schema, no other properties, except
3956
+ * for than those starting as a `$`, may be set.
3957
+ */
3958
+ _responseJsonSchema?: unknown;
3959
+ /**
3960
+ * Optional. Number of generated responses to return. If unset, this will default
3961
+ * to 1. Please note that this doesn't work for previous generation
3962
+ * models (Gemini 1.0 family)
3963
+ */
3964
+ candidateCount?: number;
3965
+ /**
3966
+ * Optional. The requested modalities of the response. Represents the set of modalities
3967
+ * that the model can return, and should be expected in the response. This is
3968
+ * an exact match to the modalities of the response.
3969
+ *
3970
+ * A model may have multiple combinations of supported modalities. If the
3971
+ * requested modalities do not match any of the supported combinations, an
3972
+ * error will be returned.
3973
+ *
3974
+ * An empty list is equivalent to requesting only text.
3975
+ */
3976
+ responseModalities?: Array<'MODALITY_UNSPECIFIED' | 'TEXT' | 'IMAGE' | 'AUDIO'>;
3977
+ /**
3978
+ * Optional. Config for thinking features.
3979
+ * An error will be returned if this field is set for models that don't
3980
+ * support thinking.
3981
+ */
3982
+ thinkingConfig?: ThinkingConfig;
3983
+ /**
3984
+ * Optional. Output schema of the generated candidate text. Schemas must be a
3985
+ * subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema)
3986
+ * and can be objects, primitives or arrays.
3987
+ *
3988
+ * If set, a compatible `response_mime_type` must also be set.
3989
+ * Compatible MIME types:
3990
+ * `application/json`: Schema for JSON response.
3991
+ * Refer to the [JSON text generation
3992
+ * guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.
3993
+ */
3994
+ responseSchema?: Schema;
3995
+ /**
3996
+ * Optional. The set of character sequences (up to 5) that will stop output generation.
3997
+ * If specified, the API will stop at the first appearance of a
3998
+ * `stop_sequence`. The stop sequence will not be included as part of the
3999
+ * response.
4000
+ */
4001
+ stopSequences?: Array<string>;
4002
+ };
4003
+
4004
+ /**
4005
+ * A `Document` is a collection of `Chunk`s.
4006
+ */
4007
+ export type Document = {
4008
+ /**
4009
+ * Immutable. Identifier. The `Document` resource name. The ID (name excluding the
4010
+ * "fileSearchStores*documents/" prefix) can contain up to 40 characters
4011
+ * that are lowercase alphanumeric or dashes (-). The ID cannot start or end
4012
+ * with a dash. If the name is empty on create, a unique name will be derived
4013
+ * from `display_name` along with a 12 character random suffix. Example:
4014
+ * `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`
4015
+ */
4016
+ name?: string;
4017
+ /**
4018
+ * Optional. The human-readable display name for the `Document`. The display name must
4019
+ * be no more than 512 characters in length, including spaces.
4020
+ * Example: "Semantic Retriever Documentation"
4021
+ */
4022
+ displayName?: string;
4023
+ /**
4024
+ * Output only. The Timestamp of when the `Document` was last updated.
4025
+ */
4026
+ readonly updateTime?: string;
4027
+ /**
4028
+ * Output only. The size of raw bytes ingested into the Document.
4029
+ */
4030
+ readonly sizeBytes?: string;
4031
+ /**
4032
+ * Output only. The mime type of the Document.
4033
+ */
4034
+ readonly mimeType?: string;
4035
+ /**
4036
+ * Optional. User provided custom metadata stored as key-value pairs used for querying.
4037
+ * A `Document` can have a maximum of 20 `CustomMetadata`.
4038
+ */
4039
+ customMetadata?: Array<CustomMetadata>;
4040
+ /**
4041
+ * Output only. The Timestamp of when the `Document` was created.
4042
+ */
4043
+ readonly createTime?: string;
4044
+ /**
4045
+ * Output only. Current state of the `Document`.
4046
+ */
4047
+ state?: 'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_ACTIVE' | 'STATE_FAILED';
4048
+ };
4049
+
4050
+ /**
4051
+ * Candidate for the logprobs token and score.
4052
+ */
4053
+ export type LogprobsResultCandidate = {
4054
+ /**
4055
+ * The candidate's log probability.
4056
+ */
4057
+ logProbability?: number;
4058
+ /**
4059
+ * The candidate’s token string value.
4060
+ */
4061
+ token?: string;
4062
+ /**
4063
+ * The candidate’s token id value.
4064
+ */
4065
+ tokenId?: number;
4066
+ };
4067
+
4068
+ /**
4069
+ * Metadata for a video `File`.
4070
+ */
4071
+ export type VideoFileMetadata = {
4072
+ /**
4073
+ * Duration of the video.
4074
+ */
4075
+ videoDuration?: string;
4076
+ };
4077
+
4078
+ /**
4079
+ * Response for `ListFiles`.
4080
+ */
4081
+ export type ListFilesResponse = {
4082
+ /**
4083
+ * The list of `File`s.
4084
+ */
4085
+ files?: Array<File>;
4086
+ /**
4087
+ * A token that can be sent as a `page_token` into a subsequent `ListFiles`
4088
+ * call.
4089
+ */
4090
+ nextPageToken?: string;
4091
+ };
4092
+
4093
+ /**
4094
+ * Counts the number of tokens in the `prompt` sent to a model.
4095
+ *
4096
+ * Models may tokenize text differently, so each model may return a different
4097
+ * `token_count`.
4098
+ */
4099
+ export type CountTokensRequest = {
4100
+ /**
4101
+ * Optional. The input given to the model as a prompt. This field is ignored when
4102
+ * `generate_content_request` is set.
4103
+ */
4104
+ contents?: Array<Content>;
4105
+ /**
4106
+ * Optional. The overall input given to the `Model`. This includes the prompt as well as
4107
+ * other model steering information like [system
4108
+ * instructions](https://ai.google.dev/gemini-api/docs/system-instructions),
4109
+ * and/or function declarations for [function
4110
+ * calling](https://ai.google.dev/gemini-api/docs/function-calling).
4111
+ * `Model`s/`Content`s and `generate_content_request`s are mutually
4112
+ * exclusive. You can either send `Model` + `Content`s or a
4113
+ * `generate_content_request`, but never both.
4114
+ */
4115
+ generateContentRequest?: GenerateContentRequest;
4116
+ };
4117
+
4118
+ export type TaskType = 'TASK_TYPE_UNSPECIFIED' | 'RETRIEVAL_QUERY' | 'RETRIEVAL_DOCUMENT' | 'SEMANTIC_SIMILARITY' | 'CLASSIFICATION' | 'CLUSTERING' | 'QUESTION_ANSWERING' | 'FACT_VERIFICATION' | 'CODE_RETRIEVAL_QUERY';
4119
+
4120
+ /**
4121
+ * Passage included inline with a grounding configuration.
4122
+ */
4123
+ export type GroundingPassage = {
4124
+ /**
4125
+ * Identifier for the passage for attributing this passage in grounded
4126
+ * answers.
4127
+ */
4128
+ id?: string;
4129
+ /**
4130
+ * Content of the passage.
4131
+ */
4132
+ content?: Content;
4133
+ };
4134
+
4135
+ /**
4136
+ * A grounding chunk from Google Maps. A Maps chunk corresponds to a single
4137
+ * place.
4138
+ */
4139
+ export type Maps = {
4140
+ /**
4141
+ * Title of the place.
4142
+ */
4143
+ title?: string;
4144
+ /**
4145
+ * The ID of the place, in `places/{place_id}` format. A user can use this
4146
+ * ID to look up that place.
4147
+ */
4148
+ placeId?: string;
4149
+ /**
4150
+ * Text description of the place answer.
4151
+ */
4152
+ text?: string;
4153
+ /**
4154
+ * URI reference of the place.
4155
+ */
4156
+ uri?: string;
4157
+ /**
4158
+ * Sources that provide answers about the features of a given place in
4159
+ * Google Maps.
4160
+ */
4161
+ placeAnswerSources?: PlaceAnswerSources;
4162
+ };
4163
+
4164
+ /**
4165
+ * Information about a Generative Language Model.
4166
+ */
4167
+ export type Model = {
4168
+ /**
4169
+ * Required. The resource name of the `Model`. Refer to [Model
4170
+ * variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations)
4171
+ * for all allowed values.
4172
+ *
4173
+ * Format: `models/{model}` with a `{model}` naming convention of:
4174
+ *
4175
+ * * "{base_model_id}-{version}"
4176
+ *
4177
+ * Examples:
4178
+ *
4179
+ * * `models/gemini-1.5-flash-001`
4180
+ */
4181
+ name: string;
4182
+ /**
4183
+ * Required. The version number of the model.
4184
+ *
4185
+ * This represents the major version (`1.0` or `1.5`)
4186
+ */
4187
+ version: string;
4188
+ /**
4189
+ * The model's supported generation methods.
4190
+ *
4191
+ * The corresponding API method names are defined as Pascal case
4192
+ * strings, such as `generateMessage` and `generateContent`.
4193
+ */
4194
+ supportedGenerationMethods?: Array<string>;
4195
+ /**
4196
+ * The maximum temperature this model can use.
4197
+ */
4198
+ maxTemperature?: number;
4199
+ /**
4200
+ * For Top-k sampling.
4201
+ *
4202
+ * Top-k sampling considers the set of `top_k` most probable tokens.
4203
+ * This value specifies default to be used by the backend while making the
4204
+ * call to the model.
4205
+ * If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't
4206
+ * allowed as a generation parameter.
4207
+ */
4208
+ topK?: number;
4209
+ /**
4210
+ * Maximum number of input tokens allowed for this model.
4211
+ */
4212
+ inputTokenLimit?: number;
4213
+ /**
4214
+ * Whether the model supports thinking.
4215
+ */
4216
+ thinking?: boolean;
4217
+ /**
4218
+ * The human-readable name of the model. E.g. "Gemini 1.5 Flash".
4219
+ *
4220
+ * The name can be up to 128 characters long and can consist of any UTF-8
4221
+ * characters.
4222
+ */
4223
+ displayName?: string;
4224
+ /**
4225
+ * Controls the randomness of the output.
4226
+ *
4227
+ * Values can range over `[0.0,max_temperature]`, inclusive. A higher value
4228
+ * will produce responses that are more varied, while a value closer to `0.0`
4229
+ * will typically result in less surprising responses from the model.
4230
+ * This value specifies default to be used by the backend while making the
4231
+ * call to the model.
4232
+ */
4233
+ temperature?: number;
4234
+ /**
4235
+ * A short description of the model.
4236
+ */
4237
+ description?: string;
4238
+ /**
4239
+ * For [Nucleus
4240
+ * sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p).
4241
+ *
4242
+ * Nucleus sampling considers the smallest set of tokens whose probability
4243
+ * sum is at least `top_p`.
4244
+ * This value specifies default to be used by the backend while making the
4245
+ * call to the model.
4246
+ */
4247
+ topP?: number;
4248
+ /**
4249
+ * Maximum number of output tokens available for this model.
4250
+ */
4251
+ outputTokenLimit?: number;
4252
+ };
4253
+
4254
+ /**
4255
+ * User provided metadata about the GroundingFact.
4256
+ */
4257
+ export type GroundingChunkCustomMetadata = {
4258
+ /**
4259
+ * Optional. A list of string values for the metadata.
4260
+ */
4261
+ stringListValue?: GroundingChunkStringList;
4262
+ /**
4263
+ * Optional. The numeric value of the metadata.
4264
+ * The expected range for this value depends on the specific `key` used.
4265
+ */
4266
+ numericValue?: number;
4267
+ /**
4268
+ * The key of the metadata.
4269
+ */
4270
+ key?: string;
4271
+ /**
4272
+ * Optional. The string value of the metadata.
4273
+ */
4274
+ stringValue?: string;
4275
+ };
4276
+
4277
+ /**
4278
+ * Tuned model as a source for training a new model.
4279
+ */
4280
+ export type TunedModelSource = {
4281
+ /**
4282
+ * Immutable. The name of the `TunedModel` to use as the starting point for
4283
+ * training the new model.
4284
+ * Example: `tunedModels/my-tuned-model`
4285
+ */
4286
+ tunedModel?: string;
4287
+ /**
4288
+ * Output only. The name of the base `Model` this `TunedModel` was tuned from.
4289
+ * Example: `models/gemini-1.5-flash-001`
4290
+ */
4291
+ readonly baseModel?: string;
4292
+ };
4293
+
4294
+ /**
4295
+ * A list of floats representing the embedding.
4296
+ */
4297
+ export type Embedding = {
4298
+ /**
4299
+ * The embedding values.
4300
+ */
4301
+ value?: Array<number>;
4302
+ };
4303
+
4304
+ /**
4305
+ * Request for an `AsyncBatchEmbedContent` operation.
4306
+ */
4307
+ export type AsyncBatchEmbedContentRequest = {
4308
+ /**
4309
+ * Required. The batch to create.
4310
+ */
4311
+ batch: EmbedContentBatch;
4312
+ };
4313
+
4314
+ /**
4315
+ * Request to get a text embedding from the model.
4316
+ */
4317
+ export type EmbedTextRequest = {
4318
+ /**
4319
+ * Required. The model name to use with the format model=models/{model}.
4320
+ */
4321
+ model: string;
4322
+ /**
4323
+ * Optional. The free-form input text that the model will turn into an embedding.
4324
+ */
4325
+ text?: string;
4326
+ };
4327
+
4328
+ /**
4329
+ * Context of the a single url retrieval.
4330
+ */
4331
+ export type UrlMetadata = {
4332
+ /**
4333
+ * Retrieved url by the tool.
4334
+ */
4335
+ retrievedUrl?: string;
4336
+ /**
4337
+ * Status of the url retrieval.
4338
+ */
4339
+ urlRetrievalStatus?: 'URL_RETRIEVAL_STATUS_UNSPECIFIED' | 'URL_RETRIEVAL_STATUS_SUCCESS' | 'URL_RETRIEVAL_STATUS_ERROR' | 'URL_RETRIEVAL_STATUS_PAYWALL' | 'URL_RETRIEVAL_STATUS_UNSAFE';
4340
+ };
4341
+
4342
+ /**
4343
+ * Image search for grounding and related configurations.
4344
+ */
4345
+ export type ImageSearch = {
4346
+ [key: string]: unknown;
4347
+ };
4348
+
4349
+ /**
4350
+ * Metadata for LongRunning ImportFile Operations.
4351
+ */
4352
+ export type ImportFileMetadata = {
4353
+ [key: string]: unknown;
4354
+ };
4355
+
4356
+ /**
4357
+ * Response for a `BatchGenerateContent` operation.
4358
+ */
4359
+ export type BatchGenerateContentResponse = {
4360
+ /**
4361
+ * Output only. The output of the batch request.
4362
+ */
4363
+ output?: GenerateContentBatchOutput;
4364
+ };
4365
+
4366
+ /**
4367
+ * The base unit of structured text.
4368
+ *
4369
+ * A `Message` includes an `author` and the `content` of
4370
+ * the `Message`.
4371
+ *
4372
+ * The `author` is used to tag messages when they are fed to the
4373
+ * model as text.
4374
+ */
4375
+ export type Message = {
4376
+ /**
4377
+ * Output only. Citation information for model-generated `content` in this `Message`.
4378
+ *
4379
+ * If this `Message` was generated as output from the model, this field may be
4380
+ * populated with attribution information for any text included in the
4381
+ * `content`. This field is used only on output.
4382
+ */
4383
+ citationMetadata?: CitationMetadata;
4384
+ /**
4385
+ * Optional. The author of this Message.
4386
+ *
4387
+ * This serves as a key for tagging
4388
+ * the content of this Message when it is fed to the model as text.
4389
+ *
4390
+ * The author can be any alphanumeric string.
4391
+ */
4392
+ author?: string;
4393
+ /**
4394
+ * Required. The text content of the structured `Message`.
4395
+ */
4396
+ content: string;
4397
+ };
4398
+
4399
+ /**
4400
+ * This resource represents a long-running operation that is the result of a
4401
+ * network API call.
4402
+ */
4403
+ export type Operation = BaseOperation & {
4404
+ /**
4405
+ * Service-specific metadata associated with the operation. It typically
4406
+ * contains progress information and common metadata such as create time.
4407
+ * Some services might not provide such metadata. Any method that returns a
4408
+ * long-running operation should document the metadata type, if any.
4409
+ */
4410
+ metadata?: {};
4411
+ /**
4412
+ * The normal, successful response of the operation. If the original
4413
+ * method returns no data on success, such as `Delete`, the response is
4414
+ * `google.protobuf.Empty`. If the original method is standard
4415
+ * `Get`/`Create`/`Update`, the response should be the resource. For other
4416
+ * methods, the response should have the type `XxxResponse`, where `Xxx`
4417
+ * is the original method name. For example, if the original method name
4418
+ * is `TakeSnapshot()`, the inferred response type is
4419
+ * `TakeSnapshotResponse`.
4420
+ */
4421
+ response?: {};
4422
+ };
4423
+
4424
+ /**
4425
+ * Tool to retrieve public web data for grounding, powered by Google.
4426
+ */
4427
+ export type GoogleSearchRetrieval = {
4428
+ /**
4429
+ * Specifies the dynamic retrieval configuration for the given source.
4430
+ */
4431
+ dynamicRetrievalConfig?: DynamicRetrievalConfig;
4432
+ };
4433
+
4434
+ /**
4435
+ * Config for speech generation and transcription.
4436
+ */
4437
+ export type SpeechConfig = {
4438
+ /**
4439
+ * Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language
4440
+ * code that the user configured the app to use. Used for speech recognition
4441
+ * and synthesis.
4442
+ *
4443
+ * Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`,
4444
+ * `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`,
4445
+ * `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`,
4446
+ * `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and
4447
+ * `th-TH`.
4448
+ */
4449
+ languageCode?: string;
4450
+ /**
4451
+ * Optional. The configuration for the multi-speaker setup.
4452
+ * It is mutually exclusive with the voice_config field.
4453
+ */
4454
+ multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
4455
+ /**
4456
+ * The configuration in case of single-voice output.
4457
+ */
4458
+ voiceConfig?: VoiceConfig;
4459
+ };
4460
+
4461
+ /**
4462
+ * Request for `RegisterFiles`.
4463
+ */
4464
+ export type RegisterFilesRequest = {
4465
+ /**
4466
+ * Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.
4467
+ */
4468
+ uris: Array<string>;
4469
+ };
4470
+
4471
+ /**
4472
+ * The result output from a `FunctionCall` that contains a string
4473
+ * representing the `FunctionDeclaration.name` and a structured JSON
4474
+ * object containing any output from the function is used as context to
4475
+ * the model. This should contain the result of a`FunctionCall` made
4476
+ * based on model prediction.
4477
+ */
4478
+ export type FunctionResponse = {
4479
+ /**
4480
+ * Required. The function response in JSON object format.
4481
+ * Callers can use any keys of their choice that fit the function's syntax
4482
+ * to return the function output, e.g. "output", "result", etc.
4483
+ * In particular, if the function call failed to execute, the response can
4484
+ * have an "error" key to return error details to the model.
4485
+ */
4486
+ response: {};
4487
+ /**
4488
+ * Optional. The identifier of the function call this response is for. Populated by the
4489
+ * client to match the corresponding function call `id`.
4490
+ */
4491
+ id?: string;
4492
+ /**
4493
+ * Optional. Ordered `Parts` that constitute a function response. Parts may have
4494
+ * different IANA MIME types.
4495
+ */
4496
+ parts?: Array<FunctionResponsePart>;
4497
+ /**
4498
+ * Optional. Specifies how the response should be scheduled in the conversation.
4499
+ * Only applicable to NON_BLOCKING function calls, is ignored otherwise.
4500
+ * Defaults to WHEN_IDLE.
4501
+ */
4502
+ scheduling?: 'SCHEDULING_UNSPECIFIED' | 'SILENT' | 'WHEN_IDLE' | 'INTERRUPT';
4503
+ /**
4504
+ * Required. The name of the function to call.
4505
+ * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
4506
+ * length of 128.
4507
+ */
4508
+ name: string;
4509
+ /**
4510
+ * Optional. Signals that function call continues, and more responses will be
4511
+ * returned, turning the function call into a generator.
4512
+ * Is only applicable to NON_BLOCKING function calls, is ignored otherwise.
4513
+ * If set to false, future responses will not be considered.
4514
+ * It is allowed to return empty `response` with `will_continue=False` to
4515
+ * signal that the function call is finished. This may still trigger the model
4516
+ * generation. To avoid triggering the generation and finish the function
4517
+ * call, additionally set `scheduling` to `SILENT`.
4518
+ */
4519
+ willContinue?: boolean;
4520
+ };
4521
+
4522
+ /**
4523
+ * Code generated by the model that is meant to be executed, and the result
4524
+ * returned to the model.
4525
+ *
4526
+ * Only generated when using the `CodeExecution` tool, in which the code will
4527
+ * be automatically executed, and a corresponding `CodeExecutionResult` will
4528
+ * also be generated.
4529
+ */
4530
+ export type ExecutableCode = {
4531
+ /**
4532
+ * Required. Programming language of the `code`.
4533
+ */
4534
+ language: 'LANGUAGE_UNSPECIFIED' | 'PYTHON';
4535
+ /**
4536
+ * Required. The code to be executed.
4537
+ */
4538
+ code: string;
4539
+ /**
4540
+ * Optional. Unique identifier of the `ExecutableCode` part.
4541
+ * The server returns the `CodeExecutionResult` with the matching `id`.
4542
+ */
4543
+ id?: string;
4544
+ };
4545
+
4546
+ /**
4547
+ * Configures the input to the batch request.
4548
+ */
4549
+ export type InputConfig = {
4550
+ /**
4551
+ * The name of the `File` containing the input requests.
4552
+ */
4553
+ fileName?: string;
4554
+ /**
4555
+ * The requests to be processed in the batch.
4556
+ */
4557
+ requests?: InlinedRequests;
4558
+ };
4559
+
4560
+ /**
4561
+ * The base structured datatype containing multi-part content of a message.
4562
+ *
4563
+ * A `Content` includes a `role` field designating the producer of the `Content`
4564
+ * and a `parts` field containing multi-part data that contains the content of
4565
+ * the message turn.
4566
+ */
4567
+ export type Content = {
4568
+ /**
4569
+ * Ordered `Parts` that constitute a single message. Parts may have different
4570
+ * MIME types.
4571
+ */
4572
+ parts?: Array<Part>;
4573
+ /**
4574
+ * Optional. The producer of the content. Must be either 'user' or 'model'.
4575
+ *
4576
+ * Useful to set for multi-turn conversations, otherwise can be left blank
4577
+ * or unset.
4578
+ */
4579
+ role?: string;
4580
+ };
4581
+
4582
+ /**
4583
+ * Raw media bytes for function response.
4584
+ *
4585
+ * Text should not be sent as raw bytes, use the 'FunctionResponse.response'
4586
+ * field.
4587
+ */
4588
+ export type FunctionResponseBlob = {
4589
+ /**
4590
+ * The IANA standard MIME type of the source data.
4591
+ * Examples:
4592
+ * - image/png
4593
+ * - image/jpeg
4594
+ * If an unsupported MIME type is provided, an error will be returned. For a
4595
+ * complete list of supported types, see [Supported file
4596
+ * formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
4597
+ */
4598
+ mimeType?: string;
4599
+ /**
4600
+ * Raw bytes for media formats.
4601
+ */
4602
+ data?: string;
4603
+ };
4604
+
4605
+ /**
4606
+ * Stub for ToolType (missing in upstream spec)
4607
+ */
4608
+ export type ToolType = string;
4609
+
4610
+ /**
4611
+ * Stub for MediaResolution (missing in upstream spec)
4612
+ */
4613
+ export type MediaResolution = string;
4614
+
4615
+ /**
4616
+ * V1 error format.
4617
+ */
4618
+ export type Xgafv = '1' | '2';
4619
+
4620
+ /**
4621
+ * Data format for response.
4622
+ */
4623
+ export type Alt = 'json' | 'media' | 'proto';
4624
+
4625
+ /**
4626
+ * JSONP
4627
+ */
4628
+ export type Callback = string;
4629
+
4630
+ /**
4631
+ * Returns response with indentations and line breaks.
4632
+ */
4633
+ export type PrettyPrint = boolean;
4634
+
4635
+ export type ListModelsData = {
4636
+ body?: never;
4637
+ path?: never;
4638
+ query?: {
4639
+ /**
4640
+ * Data format for response.
4641
+ */
4642
+ $alt?: 'json' | 'media' | 'proto';
4643
+ /**
4644
+ * JSONP
4645
+ */
4646
+ $callback?: string;
4647
+ /**
4648
+ * Returns response with indentations and line breaks.
4649
+ */
4650
+ $prettyPrint?: boolean;
4651
+ /**
4652
+ * V1 error format.
4653
+ */
4654
+ '$.xgafv'?: '1' | '2';
4655
+ /**
4656
+ * The maximum number of `Models` to return (per page).
4657
+ *
4658
+ * If unspecified, 50 models will be returned per page.
4659
+ * This method returns at most 1000 models per page, even if you pass a larger
4660
+ * page_size.
4661
+ */
4662
+ pageSize?: number;
4663
+ /**
4664
+ * A page token, received from a previous `ListModels` call.
4665
+ *
4666
+ * Provide the `page_token` returned by one request as an argument to the next
4667
+ * request to retrieve the next page.
4668
+ *
4669
+ * When paginating, all other parameters provided to `ListModels` must match
4670
+ * the call that provided the page token.
4671
+ */
4672
+ pageToken?: string;
4673
+ };
4674
+ url: '/v1beta/models';
4675
+ };
4676
+
4677
+ export type ListModelsResponses = {
4678
+ /**
4679
+ * Successful operation
4680
+ */
4681
+ default: ListModelsResponse;
4682
+ };
4683
+
4684
+ export type ListModelsResponse2 = ListModelsResponses[keyof ListModelsResponses];
4685
+
4686
+ export type GenerateContentData = {
4687
+ /**
4688
+ * The request body.
4689
+ */
4690
+ body?: GenerateContentRequest;
4691
+ path: {
4692
+ /**
4693
+ * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
4694
+ */
4695
+ model: string;
4696
+ };
4697
+ query?: {
4698
+ /**
4699
+ * Data format for response.
4700
+ */
4701
+ $alt?: 'json' | 'media' | 'proto';
4702
+ /**
4703
+ * JSONP
4704
+ */
4705
+ $callback?: string;
4706
+ /**
4707
+ * Returns response with indentations and line breaks.
4708
+ */
4709
+ $prettyPrint?: boolean;
4710
+ /**
4711
+ * V1 error format.
4712
+ */
4713
+ '$.xgafv'?: '1' | '2';
4714
+ };
4715
+ url: '/v1beta/models/{model}:generateContent';
4716
+ };
4717
+
4718
+ export type GenerateContentResponses = {
4719
+ /**
4720
+ * Successful operation
4721
+ */
4722
+ default: GenerateContentResponse;
4723
+ };
4724
+
4725
+ export type GenerateContentResponse2 = GenerateContentResponses[keyof GenerateContentResponses];
4726
+
4727
+ export type EmbedContentData = {
4728
+ /**
4729
+ * The request body.
4730
+ */
4731
+ body?: EmbedContentRequest;
4732
+ path: {
4733
+ /**
4734
+ * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
4735
+ */
4736
+ model: string;
4737
+ };
4738
+ query?: {
4739
+ /**
4740
+ * Data format for response.
4741
+ */
4742
+ $alt?: 'json' | 'media' | 'proto';
4743
+ /**
4744
+ * JSONP
4745
+ */
4746
+ $callback?: string;
4747
+ /**
4748
+ * Returns response with indentations and line breaks.
4749
+ */
4750
+ $prettyPrint?: boolean;
4751
+ /**
4752
+ * V1 error format.
4753
+ */
4754
+ '$.xgafv'?: '1' | '2';
4755
+ };
4756
+ url: '/v1beta/models/{model}:embedContent';
4757
+ };
4758
+
4759
+ export type EmbedContentResponses = {
4760
+ /**
4761
+ * Successful operation
4762
+ */
4763
+ default: EmbedContentResponse;
4764
+ };
4765
+
4766
+ export type EmbedContentResponse2 = EmbedContentResponses[keyof EmbedContentResponses];
4767
+
4768
+ export type StreamGenerateContentData = {
4769
+ /**
4770
+ * The request body.
4771
+ */
4772
+ body?: GenerateContentRequest;
4773
+ path: {
4774
+ /**
4775
+ * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
4776
+ */
4777
+ model: string;
4778
+ };
4779
+ query?: {
4780
+ /**
4781
+ * Data format for response.
4782
+ */
4783
+ $alt?: 'json' | 'media' | 'proto';
4784
+ /**
4785
+ * JSONP
4786
+ */
4787
+ $callback?: string;
4788
+ /**
4789
+ * Returns response with indentations and line breaks.
4790
+ */
4791
+ $prettyPrint?: boolean;
4792
+ /**
4793
+ * V1 error format.
4794
+ */
4795
+ '$.xgafv'?: '1' | '2';
4796
+ };
4797
+ url: '/v1beta/models/{model}:streamGenerateContent';
4798
+ };
4799
+
4800
+ export type StreamGenerateContentResponses = {
4801
+ /**
4802
+ * Successful operation
4803
+ */
4804
+ default: GenerateContentResponse;
4805
+ };
4806
+
4807
+ export type StreamGenerateContentResponse = StreamGenerateContentResponses[keyof StreamGenerateContentResponses];
4808
+
4809
+ export type GetModelData = {
4810
+ body?: never;
4811
+ path: {
4812
+ /**
4813
+ * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
4814
+ */
4815
+ model: string;
4816
+ };
4817
+ query?: {
4818
+ /**
4819
+ * Data format for response.
4820
+ */
4821
+ $alt?: 'json' | 'media' | 'proto';
4822
+ /**
4823
+ * JSONP
4824
+ */
4825
+ $callback?: string;
4826
+ /**
4827
+ * Returns response with indentations and line breaks.
4828
+ */
4829
+ $prettyPrint?: boolean;
4830
+ /**
4831
+ * V1 error format.
4832
+ */
4833
+ '$.xgafv'?: '1' | '2';
4834
+ };
4835
+ url: '/v1beta/models/{model}';
4836
+ };
4837
+
4838
+ export type GetModelResponses = {
4839
+ /**
4840
+ * Successful operation
4841
+ */
4842
+ default: Model;
4843
+ };
4844
+
4845
+ export type GetModelResponse = GetModelResponses[keyof GetModelResponses];
4846
+
4847
+ export type ClientOptions = {
4848
+ baseUrl: 'https://generativelanguage.googleapis.com' | (string & {});
4849
+ };