@google/genai 0.14.1 → 0.15.0

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.
@@ -1,3 +1,4 @@
1
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
1
2
  import { GoogleAuthOptions } from 'google-auth-library';
2
3
 
3
4
  /** Marks the end of user activity.
@@ -10,8 +11,17 @@ export declare interface ActivityEnd {
10
11
 
11
12
  /** The different ways of handling user activity. */
12
13
  export declare enum ActivityHandling {
14
+ /**
15
+ * If unspecified, the default behavior is `START_OF_ACTIVITY_INTERRUPTS`.
16
+ */
13
17
  ACTIVITY_HANDLING_UNSPECIFIED = "ACTIVITY_HANDLING_UNSPECIFIED",
18
+ /**
19
+ * If true, start of activity will interrupt the model's response (also called "barge in"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior.
20
+ */
14
21
  START_OF_ACTIVITY_INTERRUPTS = "START_OF_ACTIVITY_INTERRUPTS",
22
+ /**
23
+ * The model's response will not be interrupted.
24
+ */
15
25
  NO_INTERRUPTION = "NO_INTERRUPTION"
16
26
  }
17
27
 
@@ -25,12 +35,33 @@ export declare interface ActivityStart {
25
35
 
26
36
  /** Optional. Adapter size for tuning. */
27
37
  export declare enum AdapterSize {
38
+ /**
39
+ * Adapter size is unspecified.
40
+ */
28
41
  ADAPTER_SIZE_UNSPECIFIED = "ADAPTER_SIZE_UNSPECIFIED",
42
+ /**
43
+ * Adapter size 1.
44
+ */
29
45
  ADAPTER_SIZE_ONE = "ADAPTER_SIZE_ONE",
46
+ /**
47
+ * Adapter size 2.
48
+ */
30
49
  ADAPTER_SIZE_TWO = "ADAPTER_SIZE_TWO",
50
+ /**
51
+ * Adapter size 4.
52
+ */
31
53
  ADAPTER_SIZE_FOUR = "ADAPTER_SIZE_FOUR",
54
+ /**
55
+ * Adapter size 8.
56
+ */
32
57
  ADAPTER_SIZE_EIGHT = "ADAPTER_SIZE_EIGHT",
58
+ /**
59
+ * Adapter size 16.
60
+ */
33
61
  ADAPTER_SIZE_SIXTEEN = "ADAPTER_SIZE_SIXTEEN",
62
+ /**
63
+ * Adapter size 32.
64
+ */
34
65
  ADAPTER_SIZE_THIRTY_TWO = "ADAPTER_SIZE_THIRTY_TWO"
35
66
  }
36
67
 
@@ -166,6 +197,16 @@ export declare interface ApiKeyConfig {
166
197
  apiKeyString?: string;
167
198
  }
168
199
 
200
+ /** Representation of an audio chunk. */
201
+ export declare interface AudioChunk {
202
+ /** Raw byets of audio data. */
203
+ data?: string;
204
+ /** MIME type of the audio chunk. */
205
+ mimeType?: string;
206
+ /** Prompts and config used for generating this audio chunk. */
207
+ sourceMetadata?: LiveMusicSourceMetadata;
208
+ }
209
+
169
210
  /** The audio transcription configuration in Setup. */
170
211
  export declare interface AudioTranscriptionConfig {
171
212
  }
@@ -234,11 +275,29 @@ export declare interface AuthConfigOidcConfig {
234
275
  /** Type of auth scheme. */
235
276
  export declare enum AuthType {
236
277
  AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
278
+ /**
279
+ * No Auth.
280
+ */
237
281
  NO_AUTH = "NO_AUTH",
282
+ /**
283
+ * API Key Auth.
284
+ */
238
285
  API_KEY_AUTH = "API_KEY_AUTH",
286
+ /**
287
+ * HTTP Basic Auth.
288
+ */
239
289
  HTTP_BASIC_AUTH = "HTTP_BASIC_AUTH",
290
+ /**
291
+ * Google Service Account Auth.
292
+ */
240
293
  GOOGLE_SERVICE_ACCOUNT_AUTH = "GOOGLE_SERVICE_ACCOUNT_AUTH",
294
+ /**
295
+ * OAuth auth.
296
+ */
241
297
  OAUTH = "OAUTH",
298
+ /**
299
+ * OpenID Connect (OIDC) Auth.
300
+ */
242
301
  OIDC_AUTH = "OIDC_AUTH"
243
302
  }
244
303
 
@@ -256,6 +315,28 @@ export declare interface AutomaticActivityDetection {
256
315
  silenceDurationMs?: number;
257
316
  }
258
317
 
318
+ /** The configuration for automatic function calling. */
319
+ export declare interface AutomaticFunctionCallingConfig {
320
+ /** Whether to disable automatic function calling.
321
+ If not set or set to False, will enable automatic function calling.
322
+ If set to True, will disable automatic function calling.
323
+ */
324
+ disable?: boolean;
325
+ /** If automatic function calling is enabled,
326
+ maximum number of remote calls for automatic function calling.
327
+ This number should be a positive integer.
328
+ If not set, SDK will set maximum number of remote calls to 10.
329
+ */
330
+ maximumRemoteCalls?: number;
331
+ /** If automatic function calling is enabled,
332
+ whether to ignore call history to the response.
333
+ If not set, SDK will set ignore_call_history to false,
334
+ and will append the call history to
335
+ GenerateContentResponse.automatic_function_calling_history.
336
+ */
337
+ ignoreCallHistory?: boolean;
338
+ }
339
+
259
340
  /**
260
341
  * @license
261
342
  * Copyright 2025 Google LLC
@@ -272,6 +353,22 @@ export declare interface BaseUrlParameters {
272
353
  vertexUrl?: string;
273
354
  }
274
355
 
356
+ /** Defines the function behavior. Defaults to `BLOCKING`. */
357
+ export declare enum Behavior {
358
+ /**
359
+ * This value is unused.
360
+ */
361
+ UNSPECIFIED = "UNSPECIFIED",
362
+ /**
363
+ * If set, the system will wait to receive the function response before continuing the conversation.
364
+ */
365
+ BLOCKING = "BLOCKING",
366
+ /**
367
+ * If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
368
+ */
369
+ NON_BLOCKING = "NON_BLOCKING"
370
+ }
371
+
275
372
  /** Content blob. */
276
373
  declare interface Blob_2 {
277
374
  /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls. */
@@ -287,10 +384,25 @@ export declare type BlobImageUnion = Blob_2;
287
384
 
288
385
  /** Output only. Blocked reason. */
289
386
  export declare enum BlockedReason {
387
+ /**
388
+ * Unspecified blocked reason.
389
+ */
290
390
  BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED",
391
+ /**
392
+ * Candidates blocked due to safety.
393
+ */
291
394
  SAFETY = "SAFETY",
395
+ /**
396
+ * Candidates blocked due to other reason.
397
+ */
292
398
  OTHER = "OTHER",
399
+ /**
400
+ * Candidates blocked due to the terms which are included from the terminology blocklist.
401
+ */
293
402
  BLOCKLIST = "BLOCKLIST",
403
+ /**
404
+ * Candidates blocked due to prohibited content.
405
+ */
294
406
  PROHIBITED_CONTENT = "PROHIBITED_CONTENT"
295
407
  }
296
408
 
@@ -413,6 +525,33 @@ export declare class Caches extends BaseModule {
413
525
  private listInternal;
414
526
  }
415
527
 
528
+ /**
529
+ * CallableTool is an invokable tool that can be executed with external
530
+ * application (e.g., via Model Context Protocol) or local functions with
531
+ * function calling.
532
+ */
533
+ export declare interface CallableTool {
534
+ /**
535
+ * Returns tool that can be called by Gemini.
536
+ */
537
+ tool(): Promise<Tool>;
538
+ /**
539
+ * Executes the callable tool with the given function call arguments and
540
+ * returns the response parts from the tool execution.
541
+ */
542
+ callTool(functionCalls: FunctionCall[]): Promise<Part[]>;
543
+ }
544
+
545
+ /**
546
+ * CallableToolConfig is the configuration for a callable tool.
547
+ */
548
+ export declare interface CallableToolConfig {
549
+ /**
550
+ * Specifies the model's behavior after invoking this tool.
551
+ */
552
+ behavior?: Behavior;
553
+ }
554
+
416
555
  /** A response candidate generated from the model. */
417
556
  export declare interface Candidate {
418
557
  /** Contains the multi-part content of the response.
@@ -431,6 +570,8 @@ export declare interface Candidate {
431
570
  If empty, the model has not stopped generating the tokens.
432
571
  */
433
572
  finishReason?: FinishReason;
573
+ /** Metadata related to url context retrieval tool. */
574
+ urlContextMetadata?: UrlContextMetadata;
434
575
  /** Output only. Average log probability score of the candidate. */
435
576
  avgLogprobs?: number;
436
577
  /** Output only. Metadata specifies sources used to ground generated content. */
@@ -798,6 +939,16 @@ export declare interface CreateCachedContentConfig {
798
939
  /** Configuration for the tools to use. This config is shared for all tools.
799
940
  */
800
941
  toolConfig?: ToolConfig;
942
+ /** The Cloud KMS resource identifier of the customer managed
943
+ encryption key used to protect a resource.
944
+ The key needs to be in the same region as where the compute resource is
945
+ created. See
946
+ https://cloud.google.com/vertex-ai/docs/general/cmek for more
947
+ details. If this is set, then all created CachedContent objects
948
+ will be encrypted with the provided encryption key.
949
+ Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
950
+ */
951
+ kmsKeyName?: string;
801
952
  }
802
953
 
803
954
  /** Parameters for caches.create method. */
@@ -1159,7 +1310,13 @@ export declare interface DynamicRetrievalConfig {
1159
1310
 
1160
1311
  /** Config for the dynamic retrieval config mode. */
1161
1312
  export declare enum DynamicRetrievalConfigMode {
1313
+ /**
1314
+ * Always trigger retrieval.
1315
+ */
1162
1316
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
1317
+ /**
1318
+ * Run retrieval only when system decides it is necessary.
1319
+ */
1163
1320
  MODE_DYNAMIC = "MODE_DYNAMIC"
1164
1321
  }
1165
1322
 
@@ -1338,8 +1495,17 @@ export declare interface Endpoint {
1338
1495
 
1339
1496
  /** End of speech sensitivity. */
1340
1497
  export declare enum EndSensitivity {
1498
+ /**
1499
+ * The default is END_SENSITIVITY_LOW.
1500
+ */
1341
1501
  END_SENSITIVITY_UNSPECIFIED = "END_SENSITIVITY_UNSPECIFIED",
1502
+ /**
1503
+ * Automatic detection ends speech more often.
1504
+ */
1342
1505
  END_SENSITIVITY_HIGH = "END_SENSITIVITY_HIGH",
1506
+ /**
1507
+ * Automatic detection ends speech less often.
1508
+ */
1343
1509
  END_SENSITIVITY_LOW = "END_SENSITIVITY_LOW"
1344
1510
  }
1345
1511
 
@@ -1588,17 +1754,53 @@ export declare interface FileStatus {
1588
1754
  If empty, the model has not stopped generating the tokens.
1589
1755
  */
1590
1756
  export declare enum FinishReason {
1757
+ /**
1758
+ * The finish reason is unspecified.
1759
+ */
1591
1760
  FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED",
1761
+ /**
1762
+ * Token generation reached a natural stopping point or a configured stop sequence.
1763
+ */
1592
1764
  STOP = "STOP",
1765
+ /**
1766
+ * Token generation reached the configured maximum output tokens.
1767
+ */
1593
1768
  MAX_TOKENS = "MAX_TOKENS",
1769
+ /**
1770
+ * Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output.
1771
+ */
1594
1772
  SAFETY = "SAFETY",
1773
+ /**
1774
+ * The token generation stopped because of potential recitation.
1775
+ */
1595
1776
  RECITATION = "RECITATION",
1777
+ /**
1778
+ * The token generation stopped because of using an unsupported language.
1779
+ */
1596
1780
  LANGUAGE = "LANGUAGE",
1781
+ /**
1782
+ * All other reasons that stopped the token generation.
1783
+ */
1597
1784
  OTHER = "OTHER",
1785
+ /**
1786
+ * Token generation stopped because the content contains forbidden terms.
1787
+ */
1598
1788
  BLOCKLIST = "BLOCKLIST",
1789
+ /**
1790
+ * Token generation stopped for potentially containing prohibited content.
1791
+ */
1599
1792
  PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
1793
+ /**
1794
+ * Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
1795
+ */
1600
1796
  SPII = "SPII",
1797
+ /**
1798
+ * The function call generated by the model is invalid.
1799
+ */
1601
1800
  MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
1801
+ /**
1802
+ * Token generation stopped because generated images have safety violations.
1803
+ */
1602
1804
  IMAGE_SAFETY = "IMAGE_SAFETY"
1603
1805
  }
1604
1806
 
@@ -1623,14 +1825,32 @@ export declare interface FunctionCallingConfig {
1623
1825
 
1624
1826
  /** Config for the function calling config mode. */
1625
1827
  export declare enum FunctionCallingConfigMode {
1828
+ /**
1829
+ * The function calling config mode is unspecified. Should not be used.
1830
+ */
1626
1831
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
1832
+ /**
1833
+ * Default model behavior, model decides to predict either function calls or natural language response.
1834
+ */
1627
1835
  AUTO = "AUTO",
1836
+ /**
1837
+ * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
1838
+ */
1628
1839
  ANY = "ANY",
1840
+ /**
1841
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
1842
+ */
1629
1843
  NONE = "NONE"
1630
1844
  }
1631
1845
 
1632
- /** Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client. */
1846
+ /** Defines a function that the model can generate JSON inputs for.
1847
+
1848
+ The inputs are based on `OpenAPI 3.0 specifications
1849
+ <https://spec.openapis.org/oas/v3.0.3>`_.
1850
+ */
1633
1851
  export declare interface FunctionDeclaration {
1852
+ /** Defines the function behavior. */
1853
+ behavior?: Behavior;
1634
1854
  /** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
1635
1855
  description?: string;
1636
1856
  /** Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64. */
@@ -1643,8 +1863,11 @@ export declare interface FunctionDeclaration {
1643
1863
 
1644
1864
  /** A function response. */
1645
1865
  export declare class FunctionResponse {
1646
- /** The id of the function call this response is for. Populated by the client
1647
- to match the corresponding function call `id`. */
1866
+ /** Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. */
1867
+ willContinue?: boolean;
1868
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
1869
+ scheduling?: FunctionResponseScheduling;
1870
+ /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
1648
1871
  id?: string;
1649
1872
  /** Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. */
1650
1873
  name?: string;
@@ -1652,6 +1875,26 @@ export declare class FunctionResponse {
1652
1875
  response?: Record<string, unknown>;
1653
1876
  }
1654
1877
 
1878
+ /** Specifies how the response should be scheduled in the conversation. */
1879
+ export declare enum FunctionResponseScheduling {
1880
+ /**
1881
+ * This value is unused.
1882
+ */
1883
+ SCHEDULING_UNSPECIFIED = "SCHEDULING_UNSPECIFIED",
1884
+ /**
1885
+ * Only add the result to the conversation context, do not interrupt or trigger generation.
1886
+ */
1887
+ SILENT = "SILENT",
1888
+ /**
1889
+ * Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
1890
+ */
1891
+ WHEN_IDLE = "WHEN_IDLE",
1892
+ /**
1893
+ * Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
1894
+ */
1895
+ INTERRUPT = "INTERRUPT"
1896
+ }
1897
+
1655
1898
  /** Optional model configuration parameters.
1656
1899
 
1657
1900
  For more information, see `Content generation parameters
@@ -1777,6 +2020,9 @@ export declare interface GenerateContentConfig {
1777
2020
  model.
1778
2021
  */
1779
2022
  audioTimestamp?: boolean;
2023
+ /** The configuration for automatic function calling.
2024
+ */
2025
+ automaticFunctionCalling?: AutomaticFunctionCallingConfig;
1780
2026
  /** The thinking features configuration.
1781
2027
  */
1782
2028
  thinkingConfig?: ThinkingConfig;
@@ -1806,6 +2052,9 @@ export declare class GenerateContentResponse {
1806
2052
  /** Identifier for each response.
1807
2053
  */
1808
2054
  responseId?: string;
2055
+ /** The history of automatic function calling.
2056
+ */
2057
+ automaticFunctionCallingHistory?: Content[];
1809
2058
  /** Output only. The model version used to generate the response. */
1810
2059
  modelVersion?: string;
1811
2060
  /** Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations. */
@@ -2461,6 +2710,10 @@ export declare interface GoogleRpcStatus {
2461
2710
 
2462
2711
  /** Tool to support Google Search in Model. Powered by Google. */
2463
2712
  export declare interface GoogleSearch {
2713
+ /** Optional. Filter search results to a specific time range.
2714
+ If customers set a start time, they must set an end time (and vice versa).
2715
+ */
2716
+ timeRangeFilter?: Interval;
2464
2717
  }
2465
2718
 
2466
2719
  /** Tool to retrieve public web data for grounding, powered by Google. */
@@ -2535,46 +2788,121 @@ export declare interface GroundingSupport {
2535
2788
 
2536
2789
  /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
2537
2790
  export declare enum HarmBlockMethod {
2791
+ /**
2792
+ * The harm block method is unspecified.
2793
+ */
2538
2794
  HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED",
2795
+ /**
2796
+ * The harm block method uses both probability and severity scores.
2797
+ */
2539
2798
  SEVERITY = "SEVERITY",
2799
+ /**
2800
+ * The harm block method uses the probability score.
2801
+ */
2540
2802
  PROBABILITY = "PROBABILITY"
2541
2803
  }
2542
2804
 
2543
2805
  /** Required. The harm block threshold. */
2544
2806
  export declare enum HarmBlockThreshold {
2807
+ /**
2808
+ * Unspecified harm block threshold.
2809
+ */
2545
2810
  HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
2811
+ /**
2812
+ * Block low threshold and above (i.e. block more).
2813
+ */
2546
2814
  BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
2815
+ /**
2816
+ * Block medium threshold and above.
2817
+ */
2547
2818
  BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
2819
+ /**
2820
+ * Block only high threshold (i.e. block less).
2821
+ */
2548
2822
  BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
2823
+ /**
2824
+ * Block none.
2825
+ */
2549
2826
  BLOCK_NONE = "BLOCK_NONE",
2827
+ /**
2828
+ * Turn off the safety filter.
2829
+ */
2550
2830
  OFF = "OFF"
2551
2831
  }
2552
2832
 
2553
2833
  /** Required. Harm category. */
2554
2834
  export declare enum HarmCategory {
2835
+ /**
2836
+ * The harm category is unspecified.
2837
+ */
2555
2838
  HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED",
2839
+ /**
2840
+ * The harm category is hate speech.
2841
+ */
2556
2842
  HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
2843
+ /**
2844
+ * The harm category is dangerous content.
2845
+ */
2557
2846
  HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
2847
+ /**
2848
+ * The harm category is harassment.
2849
+ */
2558
2850
  HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
2851
+ /**
2852
+ * The harm category is sexually explicit content.
2853
+ */
2559
2854
  HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
2855
+ /**
2856
+ * The harm category is civic integrity.
2857
+ */
2560
2858
  HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
2561
2859
  }
2562
2860
 
2563
2861
  /** Output only. Harm probability levels in the content. */
2564
2862
  export declare enum HarmProbability {
2863
+ /**
2864
+ * Harm probability unspecified.
2865
+ */
2565
2866
  HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED",
2867
+ /**
2868
+ * Negligible level of harm.
2869
+ */
2566
2870
  NEGLIGIBLE = "NEGLIGIBLE",
2871
+ /**
2872
+ * Low level of harm.
2873
+ */
2567
2874
  LOW = "LOW",
2875
+ /**
2876
+ * Medium level of harm.
2877
+ */
2568
2878
  MEDIUM = "MEDIUM",
2879
+ /**
2880
+ * High level of harm.
2881
+ */
2569
2882
  HIGH = "HIGH"
2570
2883
  }
2571
2884
 
2572
2885
  /** Output only. Harm severity levels in the content. */
2573
2886
  export declare enum HarmSeverity {
2887
+ /**
2888
+ * Harm severity unspecified.
2889
+ */
2574
2890
  HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED",
2891
+ /**
2892
+ * Negligible level of harm severity.
2893
+ */
2575
2894
  HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
2895
+ /**
2896
+ * Low level of harm severity.
2897
+ */
2576
2898
  HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
2899
+ /**
2900
+ * Medium level of harm severity.
2901
+ */
2577
2902
  HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
2903
+ /**
2904
+ * High level of harm severity.
2905
+ */
2578
2906
  HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
2579
2907
  }
2580
2908
 
@@ -2675,25 +3003,81 @@ export declare enum ImagePromptLanguage {
2675
3003
  hi = "hi"
2676
3004
  }
2677
3005
 
3006
+ /** Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
3007
+
3008
+ The start time must be less than or equal to the end time.
3009
+ When the start equals the end time, the interval is an empty interval.
3010
+ (matches no time)
3011
+ When both start and end are unspecified, the interval matches any time.
3012
+ */
3013
+ export declare interface Interval {
3014
+ /** The start time of the interval. */
3015
+ startTime?: string;
3016
+ /** The end time of the interval. */
3017
+ endTime?: string;
3018
+ }
3019
+
2678
3020
  /** Output only. The detailed state of the job. */
2679
3021
  export declare enum JobState {
3022
+ /**
3023
+ * The job state is unspecified.
3024
+ */
2680
3025
  JOB_STATE_UNSPECIFIED = "JOB_STATE_UNSPECIFIED",
3026
+ /**
3027
+ * The job has been just created or resumed and processing has not yet begun.
3028
+ */
2681
3029
  JOB_STATE_QUEUED = "JOB_STATE_QUEUED",
3030
+ /**
3031
+ * The service is preparing to run the job.
3032
+ */
2682
3033
  JOB_STATE_PENDING = "JOB_STATE_PENDING",
3034
+ /**
3035
+ * The job is in progress.
3036
+ */
2683
3037
  JOB_STATE_RUNNING = "JOB_STATE_RUNNING",
3038
+ /**
3039
+ * The job completed successfully.
3040
+ */
2684
3041
  JOB_STATE_SUCCEEDED = "JOB_STATE_SUCCEEDED",
3042
+ /**
3043
+ * The job failed.
3044
+ */
2685
3045
  JOB_STATE_FAILED = "JOB_STATE_FAILED",
3046
+ /**
3047
+ * The job is being cancelled. From this state the job may only go to either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
3048
+ */
2686
3049
  JOB_STATE_CANCELLING = "JOB_STATE_CANCELLING",
3050
+ /**
3051
+ * The job has been cancelled.
3052
+ */
2687
3053
  JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED",
3054
+ /**
3055
+ * The job has been stopped, and can be resumed.
3056
+ */
2688
3057
  JOB_STATE_PAUSED = "JOB_STATE_PAUSED",
3058
+ /**
3059
+ * The job has expired.
3060
+ */
2689
3061
  JOB_STATE_EXPIRED = "JOB_STATE_EXPIRED",
3062
+ /**
3063
+ * The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state.
3064
+ */
2690
3065
  JOB_STATE_UPDATING = "JOB_STATE_UPDATING",
3066
+ /**
3067
+ * The job is partially succeeded, some results may be missing due to errors.
3068
+ */
2691
3069
  JOB_STATE_PARTIALLY_SUCCEEDED = "JOB_STATE_PARTIALLY_SUCCEEDED"
2692
3070
  }
2693
3071
 
2694
3072
  /** Required. Programming language of the `code`. */
2695
3073
  export declare enum Language {
3074
+ /**
3075
+ * Unspecified language. This value should not be used.
3076
+ */
2696
3077
  LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
3078
+ /**
3079
+ * Python >= 3.10, with numpy and simpy available.
3080
+ */
2697
3081
  PYTHON = "PYTHON"
2698
3082
  }
2699
3083
 
@@ -2834,12 +3218,14 @@ export declare class Live {
2834
3218
  private readonly apiClient;
2835
3219
  private readonly auth;
2836
3220
  private readonly webSocketFactory;
3221
+ readonly music: LiveMusic;
2837
3222
  constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
2838
3223
  /**
2839
3224
  Establishes a connection to the specified model with the given
2840
3225
  configuration and returns a Session object representing that connection.
2841
3226
 
2842
- @experimental
3227
+ @experimental Built-in MCP support is a preview feature, may change in
3228
+ future versions.
2843
3229
 
2844
3230
  @remarks
2845
3231
 
@@ -2877,6 +3263,7 @@ export declare class Live {
2877
3263
  ```
2878
3264
  */
2879
3265
  connect(params: types.LiveConnectParameters): Promise<Session>;
3266
+ private isCallableTool;
2880
3267
  }
2881
3268
 
2882
3269
  /** Callbacks for the live API. */
@@ -3010,6 +3397,9 @@ export declare interface LiveClientSetup {
3010
3397
  specified for the output audio.
3011
3398
  */
3012
3399
  outputAudioTranscription?: AudioTranscriptionConfig;
3400
+ /** Configures the proactivity of the model. This allows the model to respond proactively to
3401
+ the input and to ignore irrelevant input. */
3402
+ proactivity?: ProactivityConfig;
3013
3403
  }
3014
3404
 
3015
3405
  /** Client generated response to a `ToolCall` received from the server.
@@ -3067,6 +3457,8 @@ export declare interface LiveConnectConfig {
3067
3457
  /** The speech generation configuration.
3068
3458
  */
3069
3459
  speechConfig?: SpeechConfig;
3460
+ /** If enabled, the model will detect emotions and adapt its responses accordingly. */
3461
+ enableAffectiveDialog?: boolean;
3070
3462
  /** The user provided system instructions for the model.
3071
3463
  Note: only text should be used in parts and content in each part will be
3072
3464
  in a separate paragraph. */
@@ -3094,6 +3486,9 @@ export declare interface LiveConnectConfig {
3094
3486
 
3095
3487
  If included, server will compress context window to fit into given length. */
3096
3488
  contextWindowCompression?: ContextWindowCompressionConfig;
3489
+ /** Configures the proactivity of the model. This allows the model to respond proactively to
3490
+ the input and to ignore irrelevant input. */
3491
+ proactivity?: ProactivityConfig;
3097
3492
  }
3098
3493
 
3099
3494
  /** Parameters for connecting to the live API. */
@@ -3108,6 +3503,288 @@ export declare interface LiveConnectParameters {
3108
3503
  config?: LiveConnectConfig;
3109
3504
  }
3110
3505
 
3506
+ /**
3507
+ LiveMusic class encapsulates the configuration for live music
3508
+ generation via Lyria Live models.
3509
+
3510
+ @experimental
3511
+ */
3512
+ declare class LiveMusic {
3513
+ private readonly apiClient;
3514
+ private readonly auth;
3515
+ private readonly webSocketFactory;
3516
+ constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
3517
+ /**
3518
+ Establishes a connection to the specified model and returns a
3519
+ LiveMusicSession object representing that connection.
3520
+
3521
+ @experimental
3522
+
3523
+ @remarks
3524
+
3525
+ @param params - The parameters for establishing a connection to the model.
3526
+ @return A live session.
3527
+
3528
+ @example
3529
+ ```ts
3530
+ let model = 'models/lyria-realtime-exp';
3531
+ const session = await ai.live.music.connect({
3532
+ model: model,
3533
+ callbacks: {
3534
+ onmessage: (e: MessageEvent) => {
3535
+ console.log('Received message from the server: %s\n', debug(e.data));
3536
+ },
3537
+ onerror: (e: ErrorEvent) => {
3538
+ console.log('Error occurred: %s\n', debug(e.error));
3539
+ },
3540
+ onclose: (e: CloseEvent) => {
3541
+ console.log('Connection closed.');
3542
+ },
3543
+ },
3544
+ });
3545
+ ```
3546
+ */
3547
+ connect(params: types.LiveMusicConnectParameters): Promise<LiveMusicSession>;
3548
+ }
3549
+
3550
+ /** Callbacks for the realtime music API. */
3551
+ export declare interface LiveMusicCallbacks {
3552
+ /**
3553
+ * Called when a message is received from the server.
3554
+ */
3555
+ onmessage: (e: LiveMusicServerMessage) => void;
3556
+ /**
3557
+ * Called when an error occurs.
3558
+ */
3559
+ onerror?: ((e: ErrorEvent) => void) | null;
3560
+ /**
3561
+ * Called when the websocket connection is closed.
3562
+ */
3563
+ onclose?: ((e: CloseEvent) => void) | null;
3564
+ }
3565
+
3566
+ /** User input to start or steer the music. */
3567
+ export declare interface LiveMusicClientContent {
3568
+ /** Weighted prompts as the model input. */
3569
+ weightedPrompts?: WeightedPrompt[];
3570
+ }
3571
+
3572
+ /** Messages sent by the client in the LiveMusicClientMessage call. */
3573
+ export declare interface LiveMusicClientMessage {
3574
+ /** Message to be sent in the first (and only in the first) `LiveMusicClientMessage`.
3575
+ Clients should wait for a `LiveMusicSetupComplete` message before
3576
+ sending any additional messages. */
3577
+ setup?: LiveMusicClientSetup;
3578
+ /** User input to influence music generation. */
3579
+ clientContent?: LiveMusicClientContent;
3580
+ /** Configuration for music generation. */
3581
+ musicGenerationConfig?: LiveMusicGenerationConfig;
3582
+ /** Playback control signal for the music generation. */
3583
+ playbackControl?: LiveMusicPlaybackControl;
3584
+ }
3585
+
3586
+ /** Message to be sent by the system when connecting to the API. */
3587
+ export declare interface LiveMusicClientSetup {
3588
+ /** The model's resource name. Format: `models/{model}`. */
3589
+ model?: string;
3590
+ }
3591
+
3592
+ /** Parameters for connecting to the live API. */
3593
+ export declare interface LiveMusicConnectParameters {
3594
+ /** The model's resource name. */
3595
+ model: string;
3596
+ /** Callbacks invoked on server events. */
3597
+ callbacks: LiveMusicCallbacks;
3598
+ }
3599
+
3600
+ /** A prompt that was filtered with the reason. */
3601
+ export declare interface LiveMusicFilteredPrompt {
3602
+ /** The text prompt that was filtered. */
3603
+ text?: string;
3604
+ /** The reason the prompt was filtered. */
3605
+ filteredReason?: string;
3606
+ }
3607
+
3608
+ /** Configuration for music generation. */
3609
+ export declare interface LiveMusicGenerationConfig {
3610
+ /** Controls the variance in audio generation. Higher values produce
3611
+ higher variance. Range is [0.0, 3.0]. */
3612
+ temperature?: number;
3613
+ /** Controls how the model selects tokens for output. Samples the topK
3614
+ tokens with the highest probabilities. Range is [1, 1000]. */
3615
+ topK?: number;
3616
+ /** Seeds audio generation. If not set, the request uses a randomly
3617
+ generated seed. */
3618
+ seed?: number;
3619
+ /** Controls how closely the model follows prompts.
3620
+ Higher guidance follows more closely, but will make transitions more
3621
+ abrupt. Range is [0.0, 6.0]. */
3622
+ guidance?: number;
3623
+ /** Beats per minute. Range is [60, 200]. */
3624
+ bpm?: number;
3625
+ /** Density of sounds. Range is [0.0, 1.0]. */
3626
+ density?: number;
3627
+ /** Brightness of the music. Range is [0.0, 1.0]. */
3628
+ brightness?: number;
3629
+ /** Scale of the generated music. */
3630
+ scale?: Scale;
3631
+ /** Whether the audio output should contain bass. */
3632
+ muteBass?: boolean;
3633
+ /** Whether the audio output should contain drums. */
3634
+ muteDrums?: boolean;
3635
+ /** Whether the audio output should contain only bass and drums. */
3636
+ onlyBassAndDrums?: boolean;
3637
+ /** The mode of music generation. Default mode is QUALITY. */
3638
+ musicGenerationMode?: MusicGenerationMode;
3639
+ }
3640
+
3641
+ /** The playback control signal to apply to the music generation. */
3642
+ export declare enum LiveMusicPlaybackControl {
3643
+ /**
3644
+ * This value is unused.
3645
+ */
3646
+ PLAYBACK_CONTROL_UNSPECIFIED = "PLAYBACK_CONTROL_UNSPECIFIED",
3647
+ /**
3648
+ * Start generating the music.
3649
+ */
3650
+ PLAY = "PLAY",
3651
+ /**
3652
+ * Hold the music generation. Use PLAY to resume from the current position.
3653
+ */
3654
+ PAUSE = "PAUSE",
3655
+ /**
3656
+ * Stop the music generation and reset the context (prompts retained).
3657
+ Use PLAY to restart the music generation.
3658
+ */
3659
+ STOP = "STOP",
3660
+ /**
3661
+ * Reset the context of the music generation without stopping it.
3662
+ Retains the current prompts and config.
3663
+ */
3664
+ RESET_CONTEXT = "RESET_CONTEXT"
3665
+ }
3666
+
3667
+ /** Server update generated by the model in response to client messages.
3668
+
3669
+ Content is generated as quickly as possible, and not in real time.
3670
+ Clients may choose to buffer and play it out in real time.
3671
+ */
3672
+ export declare interface LiveMusicServerContent {
3673
+ /** The audio chunks that the model has generated. */
3674
+ audioChunks?: AudioChunk[];
3675
+ }
3676
+
3677
+ /** Response message for the LiveMusicClientMessage call. */
3678
+ export declare class LiveMusicServerMessage {
3679
+ /** Message sent in response to a `LiveMusicClientSetup` message from the client.
3680
+ Clients should wait for this message before sending any additional messages. */
3681
+ setupComplete?: LiveMusicServerSetupComplete;
3682
+ /** Content generated by the model in response to client messages. */
3683
+ serverContent?: LiveMusicServerContent;
3684
+ /** A prompt that was filtered with the reason. */
3685
+ filteredPrompt?: LiveMusicFilteredPrompt;
3686
+ /**
3687
+ * Returns the first audio chunk from the server content, if present.
3688
+ *
3689
+ * @remarks
3690
+ * If there are no audio chunks in the response, undefined will be returned.
3691
+ */
3692
+ get audioChunk(): AudioChunk | undefined;
3693
+ }
3694
+
3695
+ /** Sent in response to a `LiveMusicClientSetup` message from the client. */
3696
+ export declare interface LiveMusicServerSetupComplete {
3697
+ }
3698
+
3699
+ /**
3700
+ Represents a connection to the API.
3701
+
3702
+ @experimental
3703
+ */
3704
+ declare class LiveMusicSession {
3705
+ readonly conn: WebSocket_2;
3706
+ private readonly apiClient;
3707
+ constructor(conn: WebSocket_2, apiClient: ApiClient);
3708
+ /**
3709
+ Sets inputs to steer music generation. Updates the session's current
3710
+ weighted prompts.
3711
+
3712
+ @param params - Contains one property, `weightedPrompts`.
3713
+
3714
+ - `weightedPrompts` to send to the model; weights are normalized to
3715
+ sum to 1.0.
3716
+
3717
+ @experimental
3718
+ */
3719
+ setClientContent(params: types.LiveMusicSetClientContentParameters): Promise<void>;
3720
+ /**
3721
+ Sets a configuration to the model. Updates the session's current
3722
+ music generation config.
3723
+
3724
+ @param params - Contains one property, `musicGenerationConfig`.
3725
+
3726
+ - `musicGenerationConfig` to set in the model. Passing an empty or
3727
+ undefined config to the model will reset the config to defaults.
3728
+
3729
+ @experimental
3730
+ */
3731
+ setMusicGenerationConfig(params: types.LiveMusicSetConfigParameters): Promise<void>;
3732
+ private sendPlaybackControl;
3733
+ /**
3734
+ * Start the music stream.
3735
+ *
3736
+ * @experimental
3737
+ */
3738
+ play(): void;
3739
+ /**
3740
+ * Temporarily halt the music stream. Use `play` to resume from the current
3741
+ * position.
3742
+ *
3743
+ * @experimental
3744
+ */
3745
+ pause(): void;
3746
+ /**
3747
+ * Stop the music stream and reset the state. Retains the current prompts
3748
+ * and config.
3749
+ *
3750
+ * @experimental
3751
+ */
3752
+ stop(): void;
3753
+ /**
3754
+ * Resets the context of the music generation without stopping it.
3755
+ * Retains the current prompts and config.
3756
+ *
3757
+ * @experimental
3758
+ */
3759
+ resetContext(): void;
3760
+ /**
3761
+ Terminates the WebSocket connection.
3762
+
3763
+ @experimental
3764
+ */
3765
+ close(): void;
3766
+ }
3767
+
3768
+ /** Parameters for setting client content for the live API. */
3769
+ export declare interface LiveMusicSetClientContentParameters {
3770
+ /** A map of text prompts to weights to use for the generation request. */
3771
+ weightedPrompts: WeightedPrompt[];
3772
+ }
3773
+
3774
+ /** Parameters for setting config for the live API. */
3775
+ export declare interface LiveMusicSetConfigParameters {
3776
+ /** Configuration for music generation. */
3777
+ musicGenerationConfig: LiveMusicGenerationConfig;
3778
+ }
3779
+
3780
+ /** Prompts and config used for generating this audio chunk. */
3781
+ export declare interface LiveMusicSourceMetadata {
3782
+ /** Weighted prompts for generating this audio chunk. */
3783
+ clientContent?: LiveMusicClientContent;
3784
+ /** Music generation config for generating this audio chunk. */
3785
+ musicGenerationConfig?: LiveMusicGenerationConfig;
3786
+ }
3787
+
3111
3788
  /** Parameters for sending client content to the live API. */
3112
3789
  export declare interface LiveSendClientContentParameters {
3113
3790
  /** Client content to send to the session. */
@@ -3182,6 +3859,8 @@ export declare interface LiveServerContent {
3182
3859
  model turn.
3183
3860
  */
3184
3861
  outputTranscription?: Transcription;
3862
+ /** Metadata related to url context retrieval tool. */
3863
+ urlContextMetadata?: UrlContextMetadata;
3185
3864
  }
3186
3865
 
3187
3866
  /** Server will not be able to service client soon. */
@@ -3331,29 +4010,83 @@ export declare enum MaskReferenceMode {
3331
4010
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
3332
4011
  }
3333
4012
 
4013
+ /**
4014
+ * Creates a McpCallableTool from MCP clients and an optional config.
4015
+ *
4016
+ * The callable tool can invoke the MCP clients with given function call
4017
+ * arguments. (often for automatic function calling).
4018
+ * Use the config to modify tool parameters such as behavior.
4019
+ *
4020
+ * @experimental Built-in MCP support is a preview feature, may change in future
4021
+ * versions.
4022
+ */
4023
+ export declare function mcpToTool(...args: [...Client[], CallableToolConfig | Client]): CallableTool;
4024
+
3334
4025
  /** Server content modalities. */
3335
4026
  export declare enum MediaModality {
4027
+ /**
4028
+ * The modality is unspecified.
4029
+ */
3336
4030
  MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
4031
+ /**
4032
+ * Plain text.
4033
+ */
3337
4034
  TEXT = "TEXT",
4035
+ /**
4036
+ * Images.
4037
+ */
3338
4038
  IMAGE = "IMAGE",
4039
+ /**
4040
+ * Video.
4041
+ */
3339
4042
  VIDEO = "VIDEO",
4043
+ /**
4044
+ * Audio.
4045
+ */
3340
4046
  AUDIO = "AUDIO",
4047
+ /**
4048
+ * Document, e.g. PDF.
4049
+ */
3341
4050
  DOCUMENT = "DOCUMENT"
3342
4051
  }
3343
4052
 
3344
4053
  /** The media resolution to use. */
3345
4054
  export declare enum MediaResolution {
4055
+ /**
4056
+ * Media resolution has not been set
4057
+ */
3346
4058
  MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
4059
+ /**
4060
+ * Media resolution set to low (64 tokens).
4061
+ */
3347
4062
  MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
4063
+ /**
4064
+ * Media resolution set to medium (256 tokens).
4065
+ */
3348
4066
  MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
4067
+ /**
4068
+ * Media resolution set to high (zoomed reframing with 256 tokens).
4069
+ */
3349
4070
  MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
3350
4071
  }
3351
4072
 
3352
4073
  /** Server content modalities. */
3353
4074
  export declare enum Modality {
4075
+ /**
4076
+ * The modality is unspecified.
4077
+ */
3354
4078
  MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
4079
+ /**
4080
+ * Indicates the model should return text
4081
+ */
3355
4082
  TEXT = "TEXT",
4083
+ /**
4084
+ * Indicates the model should return images.
4085
+ */
3356
4086
  IMAGE = "IMAGE",
4087
+ /**
4088
+ * Indicates the model should return images.
4089
+ */
3357
4090
  AUDIO = "AUDIO"
3358
4091
  }
3359
4092
 
@@ -3367,7 +4100,13 @@ export declare interface ModalityTokenCount {
3367
4100
 
3368
4101
  /** The mode of the predictor to be used in dynamic retrieval. */
3369
4102
  export declare enum Mode {
4103
+ /**
4104
+ * Always trigger retrieval.
4105
+ */
3370
4106
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
4107
+ /**
4108
+ * Run retrieval only when system decides it is necessary.
4109
+ */
3371
4110
  MODE_DYNAMIC = "MODE_DYNAMIC"
3372
4111
  }
3373
4112
 
@@ -3488,6 +4227,14 @@ export declare class Models extends BaseModule {
3488
4227
  * ```
3489
4228
  */
3490
4229
  generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
4230
+ /**
4231
+ * Transforms the CallableTools in the parameters to be simply Tools, it
4232
+ * copies the params into a new object and replaces the tools, it does not
4233
+ * modify the original params.
4234
+ */
4235
+ private transformCallableTools;
4236
+ private initAfcToolsMap;
4237
+ private processAfcStream;
3491
4238
  /**
3492
4239
  * Generates an image based on a text description and configuration.
3493
4240
  *
@@ -3705,6 +4452,30 @@ export declare interface ModelSelectionConfig {
3705
4452
  featureSelectionPreference?: FeatureSelectionPreference;
3706
4453
  }
3707
4454
 
4455
+ /** The configuration for the multi-speaker setup. */
4456
+ export declare interface MultiSpeakerVoiceConfig {
4457
+ /** The configuration for the speaker to use. */
4458
+ speakerVoiceConfigs?: SpeakerVoiceConfig[];
4459
+ }
4460
+
4461
+ /** The mode of music generation. */
4462
+ export declare enum MusicGenerationMode {
4463
+ /**
4464
+ * This value is unused.
4465
+ */
4466
+ MUSIC_GENERATION_MODE_UNSPECIFIED = "MUSIC_GENERATION_MODE_UNSPECIFIED",
4467
+ /**
4468
+ * Steer text prompts to regions of latent space with higher quality
4469
+ music.
4470
+ */
4471
+ QUALITY = "QUALITY",
4472
+ /**
4473
+ * Steer text prompts to regions of latent space with a larger diversity
4474
+ of music.
4475
+ */
4476
+ DIVERSITY = "DIVERSITY"
4477
+ }
4478
+
3708
4479
  /** A long-running operation. */
3709
4480
  export declare interface Operation {
3710
4481
  /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
@@ -3746,9 +4517,21 @@ export declare class Operations extends BaseModule {
3746
4517
  */
3747
4518
  /** Required. Outcome of the code execution. */
3748
4519
  export declare enum Outcome {
4520
+ /**
4521
+ * Unspecified status. This value should not be used.
4522
+ */
3749
4523
  OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED",
4524
+ /**
4525
+ * Code execution completed successfully.
4526
+ */
3750
4527
  OUTCOME_OK = "OUTCOME_OK",
4528
+ /**
4529
+ * Code execution finished but with a failure. `stderr` should contain the reason.
4530
+ */
3751
4531
  OUTCOME_FAILED = "OUTCOME_FAILED",
4532
+ /**
4533
+ * Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
4534
+ */
3752
4535
  OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
3753
4536
  }
3754
4537
 
@@ -3929,11 +4712,18 @@ export declare enum PersonGeneration {
3929
4712
 
3930
4713
  /** The configuration for the prebuilt speaker to use. */
3931
4714
  export declare interface PrebuiltVoiceConfig {
3932
- /** The name of the prebuilt voice to use.
3933
- */
4715
+ /** The name of the prebuilt voice to use. */
3934
4716
  voiceName?: string;
3935
4717
  }
3936
4718
 
4719
+ /** Config for proactivity features. */
4720
+ export declare interface ProactivityConfig {
4721
+ /** If enabled, the model can reject responding to the last prompt. For
4722
+ example, this allows the model to ignore out of context speech or to stay
4723
+ silent if the user did not make a request, yet. */
4724
+ proactiveAudio?: boolean;
4725
+ }
4726
+
3937
4727
  /** Specifies the context retrieval config. */
3938
4728
  export declare interface RagRetrievalConfig {
3939
4729
  /** Optional. Config for filters. */
@@ -4114,6 +4904,62 @@ export declare interface SafetySetting {
4114
4904
  threshold?: HarmBlockThreshold;
4115
4905
  }
4116
4906
 
4907
+ /** Scale of the generated music. */
4908
+ export declare enum Scale {
4909
+ /**
4910
+ * Default value. This value is unused.
4911
+ */
4912
+ SCALE_UNSPECIFIED = "SCALE_UNSPECIFIED",
4913
+ /**
4914
+ * C major or A minor.
4915
+ */
4916
+ C_MAJOR_A_MINOR = "C_MAJOR_A_MINOR",
4917
+ /**
4918
+ * Db major or Bb minor.
4919
+ */
4920
+ D_FLAT_MAJOR_B_FLAT_MINOR = "D_FLAT_MAJOR_B_FLAT_MINOR",
4921
+ /**
4922
+ * D major or B minor.
4923
+ */
4924
+ D_MAJOR_B_MINOR = "D_MAJOR_B_MINOR",
4925
+ /**
4926
+ * Eb major or C minor
4927
+ */
4928
+ E_FLAT_MAJOR_C_MINOR = "E_FLAT_MAJOR_C_MINOR",
4929
+ /**
4930
+ * E major or Db minor.
4931
+ */
4932
+ E_MAJOR_D_FLAT_MINOR = "E_MAJOR_D_FLAT_MINOR",
4933
+ /**
4934
+ * F major or D minor.
4935
+ */
4936
+ F_MAJOR_D_MINOR = "F_MAJOR_D_MINOR",
4937
+ /**
4938
+ * Gb major or Eb minor.
4939
+ */
4940
+ G_FLAT_MAJOR_E_FLAT_MINOR = "G_FLAT_MAJOR_E_FLAT_MINOR",
4941
+ /**
4942
+ * G major or E minor.
4943
+ */
4944
+ G_MAJOR_E_MINOR = "G_MAJOR_E_MINOR",
4945
+ /**
4946
+ * Ab major or F minor.
4947
+ */
4948
+ A_FLAT_MAJOR_F_MINOR = "A_FLAT_MAJOR_F_MINOR",
4949
+ /**
4950
+ * A major or Gb minor.
4951
+ */
4952
+ A_MAJOR_G_FLAT_MINOR = "A_MAJOR_G_FLAT_MINOR",
4953
+ /**
4954
+ * Bb major or G minor.
4955
+ */
4956
+ B_FLAT_MAJOR_G_MINOR = "B_FLAT_MAJOR_G_MINOR",
4957
+ /**
4958
+ * B major or Ab minor.
4959
+ */
4960
+ B_MAJOR_A_FLAT_MINOR = "B_MAJOR_A_FLAT_MINOR"
4961
+ }
4962
+
4117
4963
  /** Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. */
4118
4964
  export declare interface Schema {
4119
4965
  /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
@@ -4162,7 +5008,7 @@ export declare interface Schema {
4162
5008
  type?: Type;
4163
5009
  }
4164
5010
 
4165
- export declare type SchemaUnion = Schema;
5011
+ export declare type SchemaUnion = Schema | unknown;
4166
5012
 
4167
5013
  /** Google search entry point. */
4168
5014
  export declare interface SearchEntryPoint {
@@ -4378,11 +5224,24 @@ export declare interface SlidingWindow {
4378
5224
  targetTokens?: string;
4379
5225
  }
4380
5226
 
5227
+ /** The configuration for the speaker to use. */
5228
+ export declare interface SpeakerVoiceConfig {
5229
+ /** The name of the speaker to use. Should be the same as in the
5230
+ prompt. */
5231
+ speaker?: string;
5232
+ /** The configuration for the voice to use. */
5233
+ voiceConfig?: VoiceConfig;
5234
+ }
5235
+
4381
5236
  /** The speech generation configuration. */
4382
5237
  export declare interface SpeechConfig {
4383
5238
  /** The configuration for the speaker to use.
4384
5239
  */
4385
5240
  voiceConfig?: VoiceConfig;
5241
+ /** The configuration for the multi-speaker setup.
5242
+ It is mutually exclusive with the voice_config field.
5243
+ */
5244
+ multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
4386
5245
  /** Language code (ISO 639. e.g. en-US) for the speech synthesization.
4387
5246
  Only available for Live API.
4388
5247
  */
@@ -4393,8 +5252,17 @@ export declare type SpeechConfigUnion = SpeechConfig | string;
4393
5252
 
4394
5253
  /** Start of speech sensitivity. */
4395
5254
  export declare enum StartSensitivity {
5255
+ /**
5256
+ * The default is START_SENSITIVITY_LOW.
5257
+ */
4396
5258
  START_SENSITIVITY_UNSPECIFIED = "START_SENSITIVITY_UNSPECIFIED",
5259
+ /**
5260
+ * Automatic detection will detect the start of speech more often.
5261
+ */
4397
5262
  START_SENSITIVITY_HIGH = "START_SENSITIVITY_HIGH",
5263
+ /**
5264
+ * Automatic detection will detect the start of speech less often.
5265
+ */
4398
5266
  START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
4399
5267
  }
4400
5268
 
@@ -4589,6 +5457,8 @@ export declare interface TokensInfo {
4589
5457
 
4590
5458
  /** Tool details of a tool that the model may use to generate a response. */
4591
5459
  export declare interface Tool {
5460
+ /** List of function declarations that the tool supports. */
5461
+ functionDeclarations?: FunctionDeclaration[];
4592
5462
  /** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. */
4593
5463
  retrieval?: Retrieval;
4594
5464
  /** Optional. Google Search tool type. Specialized retrieval tool
@@ -4602,10 +5472,10 @@ export declare interface Tool {
4602
5472
  /** Optional. Google Maps tool type. Specialized retrieval tool
4603
5473
  that is powered by Google Maps. */
4604
5474
  googleMaps?: GoogleMaps;
5475
+ /** Optional. Tool to support URL context retrieval. */
5476
+ urlContext?: UrlContext;
4605
5477
  /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services. */
4606
5478
  codeExecution?: ToolCodeExecution;
4607
- /** Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 128 function declarations can be provided. */
4608
- functionDeclarations?: FunctionDeclaration[];
4609
5479
  }
4610
5480
 
4611
5481
  /** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. */
@@ -4623,12 +5493,23 @@ export declare interface ToolConfig {
4623
5493
  retrievalConfig?: RetrievalConfig;
4624
5494
  }
4625
5495
 
4626
- export declare type ToolListUnion = Tool[];
5496
+ export declare type ToolListUnion = ToolUnion[];
5497
+
5498
+ export declare type ToolUnion = Tool | CallableTool;
4627
5499
 
4628
5500
  /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
4629
5501
  export declare enum TrafficType {
5502
+ /**
5503
+ * Unspecified request traffic type.
5504
+ */
4630
5505
  TRAFFIC_TYPE_UNSPECIFIED = "TRAFFIC_TYPE_UNSPECIFIED",
5506
+ /**
5507
+ * Type for Pay-As-You-Go traffic.
5508
+ */
4631
5509
  ON_DEMAND = "ON_DEMAND",
5510
+ /**
5511
+ * Type for Provisioned Throughput traffic.
5512
+ */
4632
5513
  PROVISIONED_THROUGHPUT = "PROVISIONED_THROUGHPUT"
4633
5514
  }
4634
5515
 
@@ -4791,19 +5672,49 @@ export declare interface TuningValidationDataset {
4791
5672
 
4792
5673
  /** Options about which input is included in the user's turn. */
4793
5674
  export declare enum TurnCoverage {
5675
+ /**
5676
+ * If unspecified, the default behavior is `TURN_INCLUDES_ONLY_ACTIVITY`.
5677
+ */
4794
5678
  TURN_COVERAGE_UNSPECIFIED = "TURN_COVERAGE_UNSPECIFIED",
5679
+ /**
5680
+ * The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior.
5681
+ */
4795
5682
  TURN_INCLUDES_ONLY_ACTIVITY = "TURN_INCLUDES_ONLY_ACTIVITY",
5683
+ /**
5684
+ * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
5685
+ */
4796
5686
  TURN_INCLUDES_ALL_INPUT = "TURN_INCLUDES_ALL_INPUT"
4797
5687
  }
4798
5688
 
4799
5689
  /** Optional. The type of the data. */
4800
5690
  export declare enum Type {
5691
+ /**
5692
+ * Not specified, should not be used.
5693
+ */
4801
5694
  TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
5695
+ /**
5696
+ * OpenAPI string type
5697
+ */
4802
5698
  STRING = "STRING",
5699
+ /**
5700
+ * OpenAPI number type
5701
+ */
4803
5702
  NUMBER = "NUMBER",
5703
+ /**
5704
+ * OpenAPI integer type
5705
+ */
4804
5706
  INTEGER = "INTEGER",
5707
+ /**
5708
+ * OpenAPI boolean type
5709
+ */
4805
5710
  BOOLEAN = "BOOLEAN",
5711
+ /**
5712
+ * OpenAPI array type
5713
+ */
4806
5714
  ARRAY = "ARRAY",
5715
+ /**
5716
+ * OpenAPI object type
5717
+ */
4807
5718
  OBJECT = "OBJECT"
4808
5719
  }
4809
5720
 
@@ -4823,9 +5734,9 @@ declare namespace types {
4823
5734
  HarmCategory,
4824
5735
  HarmBlockMethod,
4825
5736
  HarmBlockThreshold,
5737
+ Type,
4826
5738
  Mode,
4827
5739
  AuthType,
4828
- Type,
4829
5740
  FinishReason,
4830
5741
  HarmProbability,
4831
5742
  HarmSeverity,
@@ -4836,8 +5747,10 @@ declare namespace types {
4836
5747
  JobState,
4837
5748
  AdapterSize,
4838
5749
  FeatureSelectionPreference,
5750
+ Behavior,
4839
5751
  DynamicRetrievalConfigMode,
4840
5752
  FunctionCallingConfigMode,
5753
+ UrlRetrievalStatus,
4841
5754
  SafetyFilterLevel,
4842
5755
  PersonGeneration,
4843
5756
  ImagePromptLanguage,
@@ -4852,8 +5765,12 @@ declare namespace types {
4852
5765
  EndSensitivity,
4853
5766
  ActivityHandling,
4854
5767
  TurnCoverage,
4855
- Blob_2 as Blob,
5768
+ FunctionResponseScheduling,
5769
+ Scale,
5770
+ MusicGenerationMode,
5771
+ LiveMusicPlaybackControl,
4856
5772
  VideoMetadata,
5773
+ Blob_2 as Blob,
4857
5774
  CodeExecutionResult,
4858
5775
  ExecutableCode,
4859
5776
  FileData,
@@ -4864,6 +5781,9 @@ declare namespace types {
4864
5781
  HttpOptions,
4865
5782
  ModelSelectionConfig,
4866
5783
  SafetySetting,
5784
+ Schema,
5785
+ FunctionDeclaration,
5786
+ Interval,
4867
5787
  GoogleSearch,
4868
5788
  DynamicRetrievalConfig,
4869
5789
  GoogleSearchRetrieval,
@@ -4875,6 +5795,7 @@ declare namespace types {
4875
5795
  AuthConfigOidcConfig,
4876
5796
  AuthConfig,
4877
5797
  GoogleMaps,
5798
+ UrlContext,
4878
5799
  VertexAISearch,
4879
5800
  VertexRagStoreRagResource,
4880
5801
  RagRetrievalConfigFilter,
@@ -4886,8 +5807,6 @@ declare namespace types {
4886
5807
  VertexRagStore,
4887
5808
  Retrieval,
4888
5809
  ToolCodeExecution,
4889
- Schema,
4890
- FunctionDeclaration,
4891
5810
  Tool,
4892
5811
  FunctionCallingConfig,
4893
5812
  LatLng,
@@ -4895,7 +5814,10 @@ declare namespace types {
4895
5814
  ToolConfig,
4896
5815
  PrebuiltVoiceConfig,
4897
5816
  VoiceConfig,
5817
+ SpeakerVoiceConfig,
5818
+ MultiSpeakerVoiceConfig,
4898
5819
  SpeechConfig,
5820
+ AutomaticFunctionCallingConfig,
4899
5821
  ThinkingConfig,
4900
5822
  GenerationConfigRoutingConfigAutoRoutingMode,
4901
5823
  GenerationConfigRoutingConfigManualRoutingMode,
@@ -4905,6 +5827,8 @@ declare namespace types {
4905
5827
  GoogleTypeDate,
4906
5828
  Citation,
4907
5829
  CitationMetadata,
5830
+ UrlMetadata,
5831
+ UrlContextMetadata,
4908
5832
  GroundingChunkRetrievedContext,
4909
5833
  GroundingChunkWeb,
4910
5834
  GroundingChunk,
@@ -5023,7 +5947,6 @@ declare namespace types {
5023
5947
  CreateFileParameters,
5024
5948
  HttpResponse,
5025
5949
  LiveCallbacks,
5026
- UploadFileParameters,
5027
5950
  CreateFileResponse,
5028
5951
  GetFileConfig,
5029
5952
  GetFileParameters,
@@ -5065,6 +5988,7 @@ declare namespace types {
5065
5988
  SlidingWindow,
5066
5989
  ContextWindowCompressionConfig,
5067
5990
  AudioTranscriptionConfig,
5991
+ ProactivityConfig,
5068
5992
  LiveClientSetup,
5069
5993
  LiveClientContent,
5070
5994
  ActivityStart,
@@ -5079,6 +6003,24 @@ declare namespace types {
5079
6003
  SendMessageParameters,
5080
6004
  LiveSendClientContentParameters,
5081
6005
  LiveSendToolResponseParameters,
6006
+ LiveMusicClientSetup,
6007
+ WeightedPrompt,
6008
+ LiveMusicClientContent,
6009
+ LiveMusicGenerationConfig,
6010
+ LiveMusicClientMessage,
6011
+ LiveMusicServerSetupComplete,
6012
+ LiveMusicSourceMetadata,
6013
+ AudioChunk,
6014
+ LiveMusicServerContent,
6015
+ LiveMusicFilteredPrompt,
6016
+ LiveMusicServerMessage,
6017
+ LiveMusicCallbacks,
6018
+ UploadFileParameters,
6019
+ CallableTool,
6020
+ CallableToolConfig,
6021
+ LiveMusicConnectParameters,
6022
+ LiveMusicSetConfigParameters,
6023
+ LiveMusicSetClientContentParameters,
5082
6024
  OperationGetParameters,
5083
6025
  BlobImageUnion,
5084
6026
  PartUnion,
@@ -5087,6 +6029,7 @@ declare namespace types {
5087
6029
  ContentListUnion,
5088
6030
  SchemaUnion,
5089
6031
  SpeechConfigUnion,
6032
+ ToolUnion,
5090
6033
  ToolListUnion,
5091
6034
  DownloadableFileUnion
5092
6035
  }
@@ -5233,6 +6176,40 @@ export declare class UpscaleImageResponse {
5233
6176
  generatedImages?: GeneratedImage[];
5234
6177
  }
5235
6178
 
6179
+ /** Tool to support URL context retrieval. */
6180
+ export declare interface UrlContext {
6181
+ }
6182
+
6183
+ /** Metadata related to url context retrieval tool. */
6184
+ export declare interface UrlContextMetadata {
6185
+ /** List of url context. */
6186
+ urlMetadata?: UrlMetadata[];
6187
+ }
6188
+
6189
+ /** Context for a single url retrieval. */
6190
+ export declare interface UrlMetadata {
6191
+ /** The URL retrieved by the tool. */
6192
+ retrievedUrl?: string;
6193
+ /** Status of the url retrieval. */
6194
+ urlRetrievalStatus?: UrlRetrievalStatus;
6195
+ }
6196
+
6197
+ /** Status of the url retrieval. */
6198
+ export declare enum UrlRetrievalStatus {
6199
+ /**
6200
+ * Default value. This value is unused
6201
+ */
6202
+ URL_RETRIEVAL_STATUS_UNSPECIFIED = "URL_RETRIEVAL_STATUS_UNSPECIFIED",
6203
+ /**
6204
+ * Url retrieval is successful.
6205
+ */
6206
+ URL_RETRIEVAL_STATUS_SUCCESS = "URL_RETRIEVAL_STATUS_SUCCESS",
6207
+ /**
6208
+ * Url retrieval is failed due to error.
6209
+ */
6210
+ URL_RETRIEVAL_STATUS_ERROR = "URL_RETRIEVAL_STATUS_ERROR"
6211
+ }
6212
+
5236
6213
  /** Usage metadata about response(s). */
5237
6214
  export declare interface UsageMetadata {
5238
6215
  /** Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. */
@@ -5300,8 +6277,11 @@ export declare interface Video {
5300
6277
  mimeType?: string;
5301
6278
  }
5302
6279
 
5303
- /** Metadata describes the input video content. */
6280
+ /** Describes how the video in the Part should be used by the model. */
5304
6281
  export declare interface VideoMetadata {
6282
+ /** The frame rate of the video sent to the model. If not specified, the
6283
+ default value will be 1.0. The fps range is (0.0, 24.0]. */
6284
+ fps?: number;
5305
6285
  /** Optional. The end offset of the video. */
5306
6286
  endOffset?: string;
5307
6287
  /** Optional. The start offset of the video. */
@@ -5349,4 +6329,17 @@ declare interface WebSocketFactory {
5349
6329
  create(url: string, headers: Record<string, string>, callbacks: WebSocketCallbacks): WebSocket_2;
5350
6330
  }
5351
6331
 
6332
+ /** Maps a prompt to a relative weight to steer music generation. */
6333
+ export declare interface WeightedPrompt {
6334
+ /** Text prompt. */
6335
+ text?: string;
6336
+ /** Weight of the prompt. The weight is used to control the relative
6337
+ importance of the prompt. Higher weights are more important than lower
6338
+ weights.
6339
+
6340
+ Weight must not be 0. Weights of all weighted_prompts in this
6341
+ LiveMusicClientContent message will be normalized. */
6342
+ weight?: number;
6343
+ }
6344
+
5352
6345
  export { }