@google/genai 0.14.0 → 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.
- package/README.md +15 -5
- package/dist/genai.d.ts +1009 -16
- package/dist/index.js +5183 -2470
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5182 -2471
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.js +9813 -7101
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +14542 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/node.d.ts +1009 -16
- package/dist/web/index.mjs +9816 -7105
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +1009 -16
- package/package.json +13 -6
package/dist/genai.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
1647
|
-
|
|
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. */
|
|
@@ -2449,6 +2698,10 @@ export declare interface GoogleRpcStatus {
|
|
|
2449
2698
|
|
|
2450
2699
|
/** Tool to support Google Search in Model. Powered by Google. */
|
|
2451
2700
|
export declare interface GoogleSearch {
|
|
2701
|
+
/** Optional. Filter search results to a specific time range.
|
|
2702
|
+
If customers set a start time, they must set an end time (and vice versa).
|
|
2703
|
+
*/
|
|
2704
|
+
timeRangeFilter?: Interval;
|
|
2452
2705
|
}
|
|
2453
2706
|
|
|
2454
2707
|
/** Tool to retrieve public web data for grounding, powered by Google. */
|
|
@@ -2523,46 +2776,121 @@ export declare interface GroundingSupport {
|
|
|
2523
2776
|
|
|
2524
2777
|
/** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
|
|
2525
2778
|
export declare enum HarmBlockMethod {
|
|
2779
|
+
/**
|
|
2780
|
+
* The harm block method is unspecified.
|
|
2781
|
+
*/
|
|
2526
2782
|
HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED",
|
|
2783
|
+
/**
|
|
2784
|
+
* The harm block method uses both probability and severity scores.
|
|
2785
|
+
*/
|
|
2527
2786
|
SEVERITY = "SEVERITY",
|
|
2787
|
+
/**
|
|
2788
|
+
* The harm block method uses the probability score.
|
|
2789
|
+
*/
|
|
2528
2790
|
PROBABILITY = "PROBABILITY"
|
|
2529
2791
|
}
|
|
2530
2792
|
|
|
2531
2793
|
/** Required. The harm block threshold. */
|
|
2532
2794
|
export declare enum HarmBlockThreshold {
|
|
2795
|
+
/**
|
|
2796
|
+
* Unspecified harm block threshold.
|
|
2797
|
+
*/
|
|
2533
2798
|
HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
2799
|
+
/**
|
|
2800
|
+
* Block low threshold and above (i.e. block more).
|
|
2801
|
+
*/
|
|
2534
2802
|
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
2803
|
+
/**
|
|
2804
|
+
* Block medium threshold and above.
|
|
2805
|
+
*/
|
|
2535
2806
|
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
2807
|
+
/**
|
|
2808
|
+
* Block only high threshold (i.e. block less).
|
|
2809
|
+
*/
|
|
2536
2810
|
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
|
|
2811
|
+
/**
|
|
2812
|
+
* Block none.
|
|
2813
|
+
*/
|
|
2537
2814
|
BLOCK_NONE = "BLOCK_NONE",
|
|
2815
|
+
/**
|
|
2816
|
+
* Turn off the safety filter.
|
|
2817
|
+
*/
|
|
2538
2818
|
OFF = "OFF"
|
|
2539
2819
|
}
|
|
2540
2820
|
|
|
2541
2821
|
/** Required. Harm category. */
|
|
2542
2822
|
export declare enum HarmCategory {
|
|
2823
|
+
/**
|
|
2824
|
+
* The harm category is unspecified.
|
|
2825
|
+
*/
|
|
2543
2826
|
HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED",
|
|
2827
|
+
/**
|
|
2828
|
+
* The harm category is hate speech.
|
|
2829
|
+
*/
|
|
2544
2830
|
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
|
|
2831
|
+
/**
|
|
2832
|
+
* The harm category is dangerous content.
|
|
2833
|
+
*/
|
|
2545
2834
|
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
2835
|
+
/**
|
|
2836
|
+
* The harm category is harassment.
|
|
2837
|
+
*/
|
|
2546
2838
|
HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
|
|
2839
|
+
/**
|
|
2840
|
+
* The harm category is sexually explicit content.
|
|
2841
|
+
*/
|
|
2547
2842
|
HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
2843
|
+
/**
|
|
2844
|
+
* The harm category is civic integrity.
|
|
2845
|
+
*/
|
|
2548
2846
|
HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
2549
2847
|
}
|
|
2550
2848
|
|
|
2551
2849
|
/** Output only. Harm probability levels in the content. */
|
|
2552
2850
|
export declare enum HarmProbability {
|
|
2851
|
+
/**
|
|
2852
|
+
* Harm probability unspecified.
|
|
2853
|
+
*/
|
|
2553
2854
|
HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED",
|
|
2855
|
+
/**
|
|
2856
|
+
* Negligible level of harm.
|
|
2857
|
+
*/
|
|
2554
2858
|
NEGLIGIBLE = "NEGLIGIBLE",
|
|
2859
|
+
/**
|
|
2860
|
+
* Low level of harm.
|
|
2861
|
+
*/
|
|
2555
2862
|
LOW = "LOW",
|
|
2863
|
+
/**
|
|
2864
|
+
* Medium level of harm.
|
|
2865
|
+
*/
|
|
2556
2866
|
MEDIUM = "MEDIUM",
|
|
2867
|
+
/**
|
|
2868
|
+
* High level of harm.
|
|
2869
|
+
*/
|
|
2557
2870
|
HIGH = "HIGH"
|
|
2558
2871
|
}
|
|
2559
2872
|
|
|
2560
2873
|
/** Output only. Harm severity levels in the content. */
|
|
2561
2874
|
export declare enum HarmSeverity {
|
|
2875
|
+
/**
|
|
2876
|
+
* Harm severity unspecified.
|
|
2877
|
+
*/
|
|
2562
2878
|
HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED",
|
|
2879
|
+
/**
|
|
2880
|
+
* Negligible level of harm severity.
|
|
2881
|
+
*/
|
|
2563
2882
|
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
|
|
2883
|
+
/**
|
|
2884
|
+
* Low level of harm severity.
|
|
2885
|
+
*/
|
|
2564
2886
|
HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
|
|
2887
|
+
/**
|
|
2888
|
+
* Medium level of harm severity.
|
|
2889
|
+
*/
|
|
2565
2890
|
HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
|
|
2891
|
+
/**
|
|
2892
|
+
* High level of harm severity.
|
|
2893
|
+
*/
|
|
2566
2894
|
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
|
|
2567
2895
|
}
|
|
2568
2896
|
|
|
@@ -2663,25 +2991,81 @@ export declare enum ImagePromptLanguage {
|
|
|
2663
2991
|
hi = "hi"
|
|
2664
2992
|
}
|
|
2665
2993
|
|
|
2994
|
+
/** Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
|
|
2995
|
+
|
|
2996
|
+
The start time must be less than or equal to the end time.
|
|
2997
|
+
When the start equals the end time, the interval is an empty interval.
|
|
2998
|
+
(matches no time)
|
|
2999
|
+
When both start and end are unspecified, the interval matches any time.
|
|
3000
|
+
*/
|
|
3001
|
+
export declare interface Interval {
|
|
3002
|
+
/** The start time of the interval. */
|
|
3003
|
+
startTime?: string;
|
|
3004
|
+
/** The end time of the interval. */
|
|
3005
|
+
endTime?: string;
|
|
3006
|
+
}
|
|
3007
|
+
|
|
2666
3008
|
/** Output only. The detailed state of the job. */
|
|
2667
3009
|
export declare enum JobState {
|
|
3010
|
+
/**
|
|
3011
|
+
* The job state is unspecified.
|
|
3012
|
+
*/
|
|
2668
3013
|
JOB_STATE_UNSPECIFIED = "JOB_STATE_UNSPECIFIED",
|
|
3014
|
+
/**
|
|
3015
|
+
* The job has been just created or resumed and processing has not yet begun.
|
|
3016
|
+
*/
|
|
2669
3017
|
JOB_STATE_QUEUED = "JOB_STATE_QUEUED",
|
|
3018
|
+
/**
|
|
3019
|
+
* The service is preparing to run the job.
|
|
3020
|
+
*/
|
|
2670
3021
|
JOB_STATE_PENDING = "JOB_STATE_PENDING",
|
|
3022
|
+
/**
|
|
3023
|
+
* The job is in progress.
|
|
3024
|
+
*/
|
|
2671
3025
|
JOB_STATE_RUNNING = "JOB_STATE_RUNNING",
|
|
3026
|
+
/**
|
|
3027
|
+
* The job completed successfully.
|
|
3028
|
+
*/
|
|
2672
3029
|
JOB_STATE_SUCCEEDED = "JOB_STATE_SUCCEEDED",
|
|
3030
|
+
/**
|
|
3031
|
+
* The job failed.
|
|
3032
|
+
*/
|
|
2673
3033
|
JOB_STATE_FAILED = "JOB_STATE_FAILED",
|
|
3034
|
+
/**
|
|
3035
|
+
* 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`.
|
|
3036
|
+
*/
|
|
2674
3037
|
JOB_STATE_CANCELLING = "JOB_STATE_CANCELLING",
|
|
3038
|
+
/**
|
|
3039
|
+
* The job has been cancelled.
|
|
3040
|
+
*/
|
|
2675
3041
|
JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED",
|
|
3042
|
+
/**
|
|
3043
|
+
* The job has been stopped, and can be resumed.
|
|
3044
|
+
*/
|
|
2676
3045
|
JOB_STATE_PAUSED = "JOB_STATE_PAUSED",
|
|
3046
|
+
/**
|
|
3047
|
+
* The job has expired.
|
|
3048
|
+
*/
|
|
2677
3049
|
JOB_STATE_EXPIRED = "JOB_STATE_EXPIRED",
|
|
3050
|
+
/**
|
|
3051
|
+
* The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state.
|
|
3052
|
+
*/
|
|
2678
3053
|
JOB_STATE_UPDATING = "JOB_STATE_UPDATING",
|
|
3054
|
+
/**
|
|
3055
|
+
* The job is partially succeeded, some results may be missing due to errors.
|
|
3056
|
+
*/
|
|
2679
3057
|
JOB_STATE_PARTIALLY_SUCCEEDED = "JOB_STATE_PARTIALLY_SUCCEEDED"
|
|
2680
3058
|
}
|
|
2681
3059
|
|
|
2682
3060
|
/** Required. Programming language of the `code`. */
|
|
2683
3061
|
export declare enum Language {
|
|
3062
|
+
/**
|
|
3063
|
+
* Unspecified language. This value should not be used.
|
|
3064
|
+
*/
|
|
2684
3065
|
LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
|
|
3066
|
+
/**
|
|
3067
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
3068
|
+
*/
|
|
2685
3069
|
PYTHON = "PYTHON"
|
|
2686
3070
|
}
|
|
2687
3071
|
|
|
@@ -2822,12 +3206,14 @@ export declare class Live {
|
|
|
2822
3206
|
private readonly apiClient;
|
|
2823
3207
|
private readonly auth;
|
|
2824
3208
|
private readonly webSocketFactory;
|
|
3209
|
+
readonly music: LiveMusic;
|
|
2825
3210
|
constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
|
|
2826
3211
|
/**
|
|
2827
3212
|
Establishes a connection to the specified model with the given
|
|
2828
3213
|
configuration and returns a Session object representing that connection.
|
|
2829
3214
|
|
|
2830
|
-
@experimental
|
|
3215
|
+
@experimental Built-in MCP support is a preview feature, may change in
|
|
3216
|
+
future versions.
|
|
2831
3217
|
|
|
2832
3218
|
@remarks
|
|
2833
3219
|
|
|
@@ -2865,6 +3251,7 @@ export declare class Live {
|
|
|
2865
3251
|
```
|
|
2866
3252
|
*/
|
|
2867
3253
|
connect(params: types.LiveConnectParameters): Promise<Session>;
|
|
3254
|
+
private isCallableTool;
|
|
2868
3255
|
}
|
|
2869
3256
|
|
|
2870
3257
|
/** Callbacks for the live API. */
|
|
@@ -2998,6 +3385,9 @@ export declare interface LiveClientSetup {
|
|
|
2998
3385
|
specified for the output audio.
|
|
2999
3386
|
*/
|
|
3000
3387
|
outputAudioTranscription?: AudioTranscriptionConfig;
|
|
3388
|
+
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
3389
|
+
the input and to ignore irrelevant input. */
|
|
3390
|
+
proactivity?: ProactivityConfig;
|
|
3001
3391
|
}
|
|
3002
3392
|
|
|
3003
3393
|
/** Client generated response to a `ToolCall` received from the server.
|
|
@@ -3055,6 +3445,8 @@ export declare interface LiveConnectConfig {
|
|
|
3055
3445
|
/** The speech generation configuration.
|
|
3056
3446
|
*/
|
|
3057
3447
|
speechConfig?: SpeechConfig;
|
|
3448
|
+
/** If enabled, the model will detect emotions and adapt its responses accordingly. */
|
|
3449
|
+
enableAffectiveDialog?: boolean;
|
|
3058
3450
|
/** The user provided system instructions for the model.
|
|
3059
3451
|
Note: only text should be used in parts and content in each part will be
|
|
3060
3452
|
in a separate paragraph. */
|
|
@@ -3082,6 +3474,9 @@ export declare interface LiveConnectConfig {
|
|
|
3082
3474
|
|
|
3083
3475
|
If included, server will compress context window to fit into given length. */
|
|
3084
3476
|
contextWindowCompression?: ContextWindowCompressionConfig;
|
|
3477
|
+
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
3478
|
+
the input and to ignore irrelevant input. */
|
|
3479
|
+
proactivity?: ProactivityConfig;
|
|
3085
3480
|
}
|
|
3086
3481
|
|
|
3087
3482
|
/** Parameters for connecting to the live API. */
|
|
@@ -3096,6 +3491,288 @@ export declare interface LiveConnectParameters {
|
|
|
3096
3491
|
config?: LiveConnectConfig;
|
|
3097
3492
|
}
|
|
3098
3493
|
|
|
3494
|
+
/**
|
|
3495
|
+
LiveMusic class encapsulates the configuration for live music
|
|
3496
|
+
generation via Lyria Live models.
|
|
3497
|
+
|
|
3498
|
+
@experimental
|
|
3499
|
+
*/
|
|
3500
|
+
declare class LiveMusic {
|
|
3501
|
+
private readonly apiClient;
|
|
3502
|
+
private readonly auth;
|
|
3503
|
+
private readonly webSocketFactory;
|
|
3504
|
+
constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
|
|
3505
|
+
/**
|
|
3506
|
+
Establishes a connection to the specified model and returns a
|
|
3507
|
+
LiveMusicSession object representing that connection.
|
|
3508
|
+
|
|
3509
|
+
@experimental
|
|
3510
|
+
|
|
3511
|
+
@remarks
|
|
3512
|
+
|
|
3513
|
+
@param params - The parameters for establishing a connection to the model.
|
|
3514
|
+
@return A live session.
|
|
3515
|
+
|
|
3516
|
+
@example
|
|
3517
|
+
```ts
|
|
3518
|
+
let model = 'models/lyria-realtime-exp';
|
|
3519
|
+
const session = await ai.live.music.connect({
|
|
3520
|
+
model: model,
|
|
3521
|
+
callbacks: {
|
|
3522
|
+
onmessage: (e: MessageEvent) => {
|
|
3523
|
+
console.log('Received message from the server: %s\n', debug(e.data));
|
|
3524
|
+
},
|
|
3525
|
+
onerror: (e: ErrorEvent) => {
|
|
3526
|
+
console.log('Error occurred: %s\n', debug(e.error));
|
|
3527
|
+
},
|
|
3528
|
+
onclose: (e: CloseEvent) => {
|
|
3529
|
+
console.log('Connection closed.');
|
|
3530
|
+
},
|
|
3531
|
+
},
|
|
3532
|
+
});
|
|
3533
|
+
```
|
|
3534
|
+
*/
|
|
3535
|
+
connect(params: types.LiveMusicConnectParameters): Promise<LiveMusicSession>;
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
/** Callbacks for the realtime music API. */
|
|
3539
|
+
export declare interface LiveMusicCallbacks {
|
|
3540
|
+
/**
|
|
3541
|
+
* Called when a message is received from the server.
|
|
3542
|
+
*/
|
|
3543
|
+
onmessage: (e: LiveMusicServerMessage) => void;
|
|
3544
|
+
/**
|
|
3545
|
+
* Called when an error occurs.
|
|
3546
|
+
*/
|
|
3547
|
+
onerror?: ((e: ErrorEvent) => void) | null;
|
|
3548
|
+
/**
|
|
3549
|
+
* Called when the websocket connection is closed.
|
|
3550
|
+
*/
|
|
3551
|
+
onclose?: ((e: CloseEvent) => void) | null;
|
|
3552
|
+
}
|
|
3553
|
+
|
|
3554
|
+
/** User input to start or steer the music. */
|
|
3555
|
+
export declare interface LiveMusicClientContent {
|
|
3556
|
+
/** Weighted prompts as the model input. */
|
|
3557
|
+
weightedPrompts?: WeightedPrompt[];
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
/** Messages sent by the client in the LiveMusicClientMessage call. */
|
|
3561
|
+
export declare interface LiveMusicClientMessage {
|
|
3562
|
+
/** Message to be sent in the first (and only in the first) `LiveMusicClientMessage`.
|
|
3563
|
+
Clients should wait for a `LiveMusicSetupComplete` message before
|
|
3564
|
+
sending any additional messages. */
|
|
3565
|
+
setup?: LiveMusicClientSetup;
|
|
3566
|
+
/** User input to influence music generation. */
|
|
3567
|
+
clientContent?: LiveMusicClientContent;
|
|
3568
|
+
/** Configuration for music generation. */
|
|
3569
|
+
musicGenerationConfig?: LiveMusicGenerationConfig;
|
|
3570
|
+
/** Playback control signal for the music generation. */
|
|
3571
|
+
playbackControl?: LiveMusicPlaybackControl;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
/** Message to be sent by the system when connecting to the API. */
|
|
3575
|
+
export declare interface LiveMusicClientSetup {
|
|
3576
|
+
/** The model's resource name. Format: `models/{model}`. */
|
|
3577
|
+
model?: string;
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
/** Parameters for connecting to the live API. */
|
|
3581
|
+
export declare interface LiveMusicConnectParameters {
|
|
3582
|
+
/** The model's resource name. */
|
|
3583
|
+
model: string;
|
|
3584
|
+
/** Callbacks invoked on server events. */
|
|
3585
|
+
callbacks: LiveMusicCallbacks;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
/** A prompt that was filtered with the reason. */
|
|
3589
|
+
export declare interface LiveMusicFilteredPrompt {
|
|
3590
|
+
/** The text prompt that was filtered. */
|
|
3591
|
+
text?: string;
|
|
3592
|
+
/** The reason the prompt was filtered. */
|
|
3593
|
+
filteredReason?: string;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
/** Configuration for music generation. */
|
|
3597
|
+
export declare interface LiveMusicGenerationConfig {
|
|
3598
|
+
/** Controls the variance in audio generation. Higher values produce
|
|
3599
|
+
higher variance. Range is [0.0, 3.0]. */
|
|
3600
|
+
temperature?: number;
|
|
3601
|
+
/** Controls how the model selects tokens for output. Samples the topK
|
|
3602
|
+
tokens with the highest probabilities. Range is [1, 1000]. */
|
|
3603
|
+
topK?: number;
|
|
3604
|
+
/** Seeds audio generation. If not set, the request uses a randomly
|
|
3605
|
+
generated seed. */
|
|
3606
|
+
seed?: number;
|
|
3607
|
+
/** Controls how closely the model follows prompts.
|
|
3608
|
+
Higher guidance follows more closely, but will make transitions more
|
|
3609
|
+
abrupt. Range is [0.0, 6.0]. */
|
|
3610
|
+
guidance?: number;
|
|
3611
|
+
/** Beats per minute. Range is [60, 200]. */
|
|
3612
|
+
bpm?: number;
|
|
3613
|
+
/** Density of sounds. Range is [0.0, 1.0]. */
|
|
3614
|
+
density?: number;
|
|
3615
|
+
/** Brightness of the music. Range is [0.0, 1.0]. */
|
|
3616
|
+
brightness?: number;
|
|
3617
|
+
/** Scale of the generated music. */
|
|
3618
|
+
scale?: Scale;
|
|
3619
|
+
/** Whether the audio output should contain bass. */
|
|
3620
|
+
muteBass?: boolean;
|
|
3621
|
+
/** Whether the audio output should contain drums. */
|
|
3622
|
+
muteDrums?: boolean;
|
|
3623
|
+
/** Whether the audio output should contain only bass and drums. */
|
|
3624
|
+
onlyBassAndDrums?: boolean;
|
|
3625
|
+
/** The mode of music generation. Default mode is QUALITY. */
|
|
3626
|
+
musicGenerationMode?: MusicGenerationMode;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
/** The playback control signal to apply to the music generation. */
|
|
3630
|
+
export declare enum LiveMusicPlaybackControl {
|
|
3631
|
+
/**
|
|
3632
|
+
* This value is unused.
|
|
3633
|
+
*/
|
|
3634
|
+
PLAYBACK_CONTROL_UNSPECIFIED = "PLAYBACK_CONTROL_UNSPECIFIED",
|
|
3635
|
+
/**
|
|
3636
|
+
* Start generating the music.
|
|
3637
|
+
*/
|
|
3638
|
+
PLAY = "PLAY",
|
|
3639
|
+
/**
|
|
3640
|
+
* Hold the music generation. Use PLAY to resume from the current position.
|
|
3641
|
+
*/
|
|
3642
|
+
PAUSE = "PAUSE",
|
|
3643
|
+
/**
|
|
3644
|
+
* Stop the music generation and reset the context (prompts retained).
|
|
3645
|
+
Use PLAY to restart the music generation.
|
|
3646
|
+
*/
|
|
3647
|
+
STOP = "STOP",
|
|
3648
|
+
/**
|
|
3649
|
+
* Reset the context of the music generation without stopping it.
|
|
3650
|
+
Retains the current prompts and config.
|
|
3651
|
+
*/
|
|
3652
|
+
RESET_CONTEXT = "RESET_CONTEXT"
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
/** Server update generated by the model in response to client messages.
|
|
3656
|
+
|
|
3657
|
+
Content is generated as quickly as possible, and not in real time.
|
|
3658
|
+
Clients may choose to buffer and play it out in real time.
|
|
3659
|
+
*/
|
|
3660
|
+
export declare interface LiveMusicServerContent {
|
|
3661
|
+
/** The audio chunks that the model has generated. */
|
|
3662
|
+
audioChunks?: AudioChunk[];
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
/** Response message for the LiveMusicClientMessage call. */
|
|
3666
|
+
export declare class LiveMusicServerMessage {
|
|
3667
|
+
/** Message sent in response to a `LiveMusicClientSetup` message from the client.
|
|
3668
|
+
Clients should wait for this message before sending any additional messages. */
|
|
3669
|
+
setupComplete?: LiveMusicServerSetupComplete;
|
|
3670
|
+
/** Content generated by the model in response to client messages. */
|
|
3671
|
+
serverContent?: LiveMusicServerContent;
|
|
3672
|
+
/** A prompt that was filtered with the reason. */
|
|
3673
|
+
filteredPrompt?: LiveMusicFilteredPrompt;
|
|
3674
|
+
/**
|
|
3675
|
+
* Returns the first audio chunk from the server content, if present.
|
|
3676
|
+
*
|
|
3677
|
+
* @remarks
|
|
3678
|
+
* If there are no audio chunks in the response, undefined will be returned.
|
|
3679
|
+
*/
|
|
3680
|
+
get audioChunk(): AudioChunk | undefined;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
/** Sent in response to a `LiveMusicClientSetup` message from the client. */
|
|
3684
|
+
export declare interface LiveMusicServerSetupComplete {
|
|
3685
|
+
}
|
|
3686
|
+
|
|
3687
|
+
/**
|
|
3688
|
+
Represents a connection to the API.
|
|
3689
|
+
|
|
3690
|
+
@experimental
|
|
3691
|
+
*/
|
|
3692
|
+
declare class LiveMusicSession {
|
|
3693
|
+
readonly conn: WebSocket_2;
|
|
3694
|
+
private readonly apiClient;
|
|
3695
|
+
constructor(conn: WebSocket_2, apiClient: ApiClient);
|
|
3696
|
+
/**
|
|
3697
|
+
Sets inputs to steer music generation. Updates the session's current
|
|
3698
|
+
weighted prompts.
|
|
3699
|
+
|
|
3700
|
+
@param params - Contains one property, `weightedPrompts`.
|
|
3701
|
+
|
|
3702
|
+
- `weightedPrompts` to send to the model; weights are normalized to
|
|
3703
|
+
sum to 1.0.
|
|
3704
|
+
|
|
3705
|
+
@experimental
|
|
3706
|
+
*/
|
|
3707
|
+
setClientContent(params: types.LiveMusicSetClientContentParameters): Promise<void>;
|
|
3708
|
+
/**
|
|
3709
|
+
Sets a configuration to the model. Updates the session's current
|
|
3710
|
+
music generation config.
|
|
3711
|
+
|
|
3712
|
+
@param params - Contains one property, `musicGenerationConfig`.
|
|
3713
|
+
|
|
3714
|
+
- `musicGenerationConfig` to set in the model. Passing an empty or
|
|
3715
|
+
undefined config to the model will reset the config to defaults.
|
|
3716
|
+
|
|
3717
|
+
@experimental
|
|
3718
|
+
*/
|
|
3719
|
+
setMusicGenerationConfig(params: types.LiveMusicSetConfigParameters): Promise<void>;
|
|
3720
|
+
private sendPlaybackControl;
|
|
3721
|
+
/**
|
|
3722
|
+
* Start the music stream.
|
|
3723
|
+
*
|
|
3724
|
+
* @experimental
|
|
3725
|
+
*/
|
|
3726
|
+
play(): void;
|
|
3727
|
+
/**
|
|
3728
|
+
* Temporarily halt the music stream. Use `play` to resume from the current
|
|
3729
|
+
* position.
|
|
3730
|
+
*
|
|
3731
|
+
* @experimental
|
|
3732
|
+
*/
|
|
3733
|
+
pause(): void;
|
|
3734
|
+
/**
|
|
3735
|
+
* Stop the music stream and reset the state. Retains the current prompts
|
|
3736
|
+
* and config.
|
|
3737
|
+
*
|
|
3738
|
+
* @experimental
|
|
3739
|
+
*/
|
|
3740
|
+
stop(): void;
|
|
3741
|
+
/**
|
|
3742
|
+
* Resets the context of the music generation without stopping it.
|
|
3743
|
+
* Retains the current prompts and config.
|
|
3744
|
+
*
|
|
3745
|
+
* @experimental
|
|
3746
|
+
*/
|
|
3747
|
+
resetContext(): void;
|
|
3748
|
+
/**
|
|
3749
|
+
Terminates the WebSocket connection.
|
|
3750
|
+
|
|
3751
|
+
@experimental
|
|
3752
|
+
*/
|
|
3753
|
+
close(): void;
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
/** Parameters for setting client content for the live API. */
|
|
3757
|
+
export declare interface LiveMusicSetClientContentParameters {
|
|
3758
|
+
/** A map of text prompts to weights to use for the generation request. */
|
|
3759
|
+
weightedPrompts: WeightedPrompt[];
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
/** Parameters for setting config for the live API. */
|
|
3763
|
+
export declare interface LiveMusicSetConfigParameters {
|
|
3764
|
+
/** Configuration for music generation. */
|
|
3765
|
+
musicGenerationConfig: LiveMusicGenerationConfig;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
/** Prompts and config used for generating this audio chunk. */
|
|
3769
|
+
export declare interface LiveMusicSourceMetadata {
|
|
3770
|
+
/** Weighted prompts for generating this audio chunk. */
|
|
3771
|
+
clientContent?: LiveMusicClientContent;
|
|
3772
|
+
/** Music generation config for generating this audio chunk. */
|
|
3773
|
+
musicGenerationConfig?: LiveMusicGenerationConfig;
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3099
3776
|
/** Parameters for sending client content to the live API. */
|
|
3100
3777
|
export declare interface LiveSendClientContentParameters {
|
|
3101
3778
|
/** Client content to send to the session. */
|
|
@@ -3170,6 +3847,8 @@ export declare interface LiveServerContent {
|
|
|
3170
3847
|
model turn.
|
|
3171
3848
|
*/
|
|
3172
3849
|
outputTranscription?: Transcription;
|
|
3850
|
+
/** Metadata related to url context retrieval tool. */
|
|
3851
|
+
urlContextMetadata?: UrlContextMetadata;
|
|
3173
3852
|
}
|
|
3174
3853
|
|
|
3175
3854
|
/** Server will not be able to service client soon. */
|
|
@@ -3319,29 +3998,83 @@ export declare enum MaskReferenceMode {
|
|
|
3319
3998
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
3320
3999
|
}
|
|
3321
4000
|
|
|
4001
|
+
/**
|
|
4002
|
+
* Creates a McpCallableTool from MCP clients and an optional config.
|
|
4003
|
+
*
|
|
4004
|
+
* The callable tool can invoke the MCP clients with given function call
|
|
4005
|
+
* arguments. (often for automatic function calling).
|
|
4006
|
+
* Use the config to modify tool parameters such as behavior.
|
|
4007
|
+
*
|
|
4008
|
+
* @experimental Built-in MCP support is a preview feature, may change in future
|
|
4009
|
+
* versions.
|
|
4010
|
+
*/
|
|
4011
|
+
export declare function mcpToTool(...args: [...Client[], CallableToolConfig | Client]): CallableTool;
|
|
4012
|
+
|
|
3322
4013
|
/** Server content modalities. */
|
|
3323
4014
|
export declare enum MediaModality {
|
|
4015
|
+
/**
|
|
4016
|
+
* The modality is unspecified.
|
|
4017
|
+
*/
|
|
3324
4018
|
MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
|
|
4019
|
+
/**
|
|
4020
|
+
* Plain text.
|
|
4021
|
+
*/
|
|
3325
4022
|
TEXT = "TEXT",
|
|
4023
|
+
/**
|
|
4024
|
+
* Images.
|
|
4025
|
+
*/
|
|
3326
4026
|
IMAGE = "IMAGE",
|
|
4027
|
+
/**
|
|
4028
|
+
* Video.
|
|
4029
|
+
*/
|
|
3327
4030
|
VIDEO = "VIDEO",
|
|
4031
|
+
/**
|
|
4032
|
+
* Audio.
|
|
4033
|
+
*/
|
|
3328
4034
|
AUDIO = "AUDIO",
|
|
4035
|
+
/**
|
|
4036
|
+
* Document, e.g. PDF.
|
|
4037
|
+
*/
|
|
3329
4038
|
DOCUMENT = "DOCUMENT"
|
|
3330
4039
|
}
|
|
3331
4040
|
|
|
3332
4041
|
/** The media resolution to use. */
|
|
3333
4042
|
export declare enum MediaResolution {
|
|
4043
|
+
/**
|
|
4044
|
+
* Media resolution has not been set
|
|
4045
|
+
*/
|
|
3334
4046
|
MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
|
|
4047
|
+
/**
|
|
4048
|
+
* Media resolution set to low (64 tokens).
|
|
4049
|
+
*/
|
|
3335
4050
|
MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
|
|
4051
|
+
/**
|
|
4052
|
+
* Media resolution set to medium (256 tokens).
|
|
4053
|
+
*/
|
|
3336
4054
|
MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
|
|
4055
|
+
/**
|
|
4056
|
+
* Media resolution set to high (zoomed reframing with 256 tokens).
|
|
4057
|
+
*/
|
|
3337
4058
|
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
3338
4059
|
}
|
|
3339
4060
|
|
|
3340
4061
|
/** Server content modalities. */
|
|
3341
4062
|
export declare enum Modality {
|
|
4063
|
+
/**
|
|
4064
|
+
* The modality is unspecified.
|
|
4065
|
+
*/
|
|
3342
4066
|
MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
|
|
4067
|
+
/**
|
|
4068
|
+
* Indicates the model should return text
|
|
4069
|
+
*/
|
|
3343
4070
|
TEXT = "TEXT",
|
|
4071
|
+
/**
|
|
4072
|
+
* Indicates the model should return images.
|
|
4073
|
+
*/
|
|
3344
4074
|
IMAGE = "IMAGE",
|
|
4075
|
+
/**
|
|
4076
|
+
* Indicates the model should return images.
|
|
4077
|
+
*/
|
|
3345
4078
|
AUDIO = "AUDIO"
|
|
3346
4079
|
}
|
|
3347
4080
|
|
|
@@ -3355,7 +4088,13 @@ export declare interface ModalityTokenCount {
|
|
|
3355
4088
|
|
|
3356
4089
|
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
3357
4090
|
export declare enum Mode {
|
|
4091
|
+
/**
|
|
4092
|
+
* Always trigger retrieval.
|
|
4093
|
+
*/
|
|
3358
4094
|
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
4095
|
+
/**
|
|
4096
|
+
* Run retrieval only when system decides it is necessary.
|
|
4097
|
+
*/
|
|
3359
4098
|
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
3360
4099
|
}
|
|
3361
4100
|
|
|
@@ -3476,6 +4215,14 @@ export declare class Models extends BaseModule {
|
|
|
3476
4215
|
* ```
|
|
3477
4216
|
*/
|
|
3478
4217
|
generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
|
|
4218
|
+
/**
|
|
4219
|
+
* Transforms the CallableTools in the parameters to be simply Tools, it
|
|
4220
|
+
* copies the params into a new object and replaces the tools, it does not
|
|
4221
|
+
* modify the original params.
|
|
4222
|
+
*/
|
|
4223
|
+
private transformCallableTools;
|
|
4224
|
+
private initAfcToolsMap;
|
|
4225
|
+
private processAfcStream;
|
|
3479
4226
|
/**
|
|
3480
4227
|
* Generates an image based on a text description and configuration.
|
|
3481
4228
|
*
|
|
@@ -3693,6 +4440,30 @@ export declare interface ModelSelectionConfig {
|
|
|
3693
4440
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
3694
4441
|
}
|
|
3695
4442
|
|
|
4443
|
+
/** The configuration for the multi-speaker setup. */
|
|
4444
|
+
export declare interface MultiSpeakerVoiceConfig {
|
|
4445
|
+
/** The configuration for the speaker to use. */
|
|
4446
|
+
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
4447
|
+
}
|
|
4448
|
+
|
|
4449
|
+
/** The mode of music generation. */
|
|
4450
|
+
export declare enum MusicGenerationMode {
|
|
4451
|
+
/**
|
|
4452
|
+
* This value is unused.
|
|
4453
|
+
*/
|
|
4454
|
+
MUSIC_GENERATION_MODE_UNSPECIFIED = "MUSIC_GENERATION_MODE_UNSPECIFIED",
|
|
4455
|
+
/**
|
|
4456
|
+
* Steer text prompts to regions of latent space with higher quality
|
|
4457
|
+
music.
|
|
4458
|
+
*/
|
|
4459
|
+
QUALITY = "QUALITY",
|
|
4460
|
+
/**
|
|
4461
|
+
* Steer text prompts to regions of latent space with a larger diversity
|
|
4462
|
+
of music.
|
|
4463
|
+
*/
|
|
4464
|
+
DIVERSITY = "DIVERSITY"
|
|
4465
|
+
}
|
|
4466
|
+
|
|
3696
4467
|
/** A long-running operation. */
|
|
3697
4468
|
export declare interface Operation {
|
|
3698
4469
|
/** 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}`. */
|
|
@@ -3734,9 +4505,21 @@ export declare class Operations extends BaseModule {
|
|
|
3734
4505
|
*/
|
|
3735
4506
|
/** Required. Outcome of the code execution. */
|
|
3736
4507
|
export declare enum Outcome {
|
|
4508
|
+
/**
|
|
4509
|
+
* Unspecified status. This value should not be used.
|
|
4510
|
+
*/
|
|
3737
4511
|
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED",
|
|
4512
|
+
/**
|
|
4513
|
+
* Code execution completed successfully.
|
|
4514
|
+
*/
|
|
3738
4515
|
OUTCOME_OK = "OUTCOME_OK",
|
|
4516
|
+
/**
|
|
4517
|
+
* Code execution finished but with a failure. `stderr` should contain the reason.
|
|
4518
|
+
*/
|
|
3739
4519
|
OUTCOME_FAILED = "OUTCOME_FAILED",
|
|
4520
|
+
/**
|
|
4521
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
4522
|
+
*/
|
|
3740
4523
|
OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
|
|
3741
4524
|
}
|
|
3742
4525
|
|
|
@@ -3917,11 +4700,18 @@ export declare enum PersonGeneration {
|
|
|
3917
4700
|
|
|
3918
4701
|
/** The configuration for the prebuilt speaker to use. */
|
|
3919
4702
|
export declare interface PrebuiltVoiceConfig {
|
|
3920
|
-
/** The name of the prebuilt voice to use.
|
|
3921
|
-
*/
|
|
4703
|
+
/** The name of the prebuilt voice to use. */
|
|
3922
4704
|
voiceName?: string;
|
|
3923
4705
|
}
|
|
3924
4706
|
|
|
4707
|
+
/** Config for proactivity features. */
|
|
4708
|
+
export declare interface ProactivityConfig {
|
|
4709
|
+
/** If enabled, the model can reject responding to the last prompt. For
|
|
4710
|
+
example, this allows the model to ignore out of context speech or to stay
|
|
4711
|
+
silent if the user did not make a request, yet. */
|
|
4712
|
+
proactiveAudio?: boolean;
|
|
4713
|
+
}
|
|
4714
|
+
|
|
3925
4715
|
/** Specifies the context retrieval config. */
|
|
3926
4716
|
export declare interface RagRetrievalConfig {
|
|
3927
4717
|
/** Optional. Config for filters. */
|
|
@@ -4102,6 +4892,62 @@ export declare interface SafetySetting {
|
|
|
4102
4892
|
threshold?: HarmBlockThreshold;
|
|
4103
4893
|
}
|
|
4104
4894
|
|
|
4895
|
+
/** Scale of the generated music. */
|
|
4896
|
+
export declare enum Scale {
|
|
4897
|
+
/**
|
|
4898
|
+
* Default value. This value is unused.
|
|
4899
|
+
*/
|
|
4900
|
+
SCALE_UNSPECIFIED = "SCALE_UNSPECIFIED",
|
|
4901
|
+
/**
|
|
4902
|
+
* C major or A minor.
|
|
4903
|
+
*/
|
|
4904
|
+
C_MAJOR_A_MINOR = "C_MAJOR_A_MINOR",
|
|
4905
|
+
/**
|
|
4906
|
+
* Db major or Bb minor.
|
|
4907
|
+
*/
|
|
4908
|
+
D_FLAT_MAJOR_B_FLAT_MINOR = "D_FLAT_MAJOR_B_FLAT_MINOR",
|
|
4909
|
+
/**
|
|
4910
|
+
* D major or B minor.
|
|
4911
|
+
*/
|
|
4912
|
+
D_MAJOR_B_MINOR = "D_MAJOR_B_MINOR",
|
|
4913
|
+
/**
|
|
4914
|
+
* Eb major or C minor
|
|
4915
|
+
*/
|
|
4916
|
+
E_FLAT_MAJOR_C_MINOR = "E_FLAT_MAJOR_C_MINOR",
|
|
4917
|
+
/**
|
|
4918
|
+
* E major or Db minor.
|
|
4919
|
+
*/
|
|
4920
|
+
E_MAJOR_D_FLAT_MINOR = "E_MAJOR_D_FLAT_MINOR",
|
|
4921
|
+
/**
|
|
4922
|
+
* F major or D minor.
|
|
4923
|
+
*/
|
|
4924
|
+
F_MAJOR_D_MINOR = "F_MAJOR_D_MINOR",
|
|
4925
|
+
/**
|
|
4926
|
+
* Gb major or Eb minor.
|
|
4927
|
+
*/
|
|
4928
|
+
G_FLAT_MAJOR_E_FLAT_MINOR = "G_FLAT_MAJOR_E_FLAT_MINOR",
|
|
4929
|
+
/**
|
|
4930
|
+
* G major or E minor.
|
|
4931
|
+
*/
|
|
4932
|
+
G_MAJOR_E_MINOR = "G_MAJOR_E_MINOR",
|
|
4933
|
+
/**
|
|
4934
|
+
* Ab major or F minor.
|
|
4935
|
+
*/
|
|
4936
|
+
A_FLAT_MAJOR_F_MINOR = "A_FLAT_MAJOR_F_MINOR",
|
|
4937
|
+
/**
|
|
4938
|
+
* A major or Gb minor.
|
|
4939
|
+
*/
|
|
4940
|
+
A_MAJOR_G_FLAT_MINOR = "A_MAJOR_G_FLAT_MINOR",
|
|
4941
|
+
/**
|
|
4942
|
+
* Bb major or G minor.
|
|
4943
|
+
*/
|
|
4944
|
+
B_FLAT_MAJOR_G_MINOR = "B_FLAT_MAJOR_G_MINOR",
|
|
4945
|
+
/**
|
|
4946
|
+
* B major or Ab minor.
|
|
4947
|
+
*/
|
|
4948
|
+
B_MAJOR_A_FLAT_MINOR = "B_MAJOR_A_FLAT_MINOR"
|
|
4949
|
+
}
|
|
4950
|
+
|
|
4105
4951
|
/** 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. */
|
|
4106
4952
|
export declare interface Schema {
|
|
4107
4953
|
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
@@ -4150,7 +4996,7 @@ export declare interface Schema {
|
|
|
4150
4996
|
type?: Type;
|
|
4151
4997
|
}
|
|
4152
4998
|
|
|
4153
|
-
export declare type SchemaUnion = Schema;
|
|
4999
|
+
export declare type SchemaUnion = Schema | unknown;
|
|
4154
5000
|
|
|
4155
5001
|
/** Google search entry point. */
|
|
4156
5002
|
export declare interface SearchEntryPoint {
|
|
@@ -4366,11 +5212,24 @@ export declare interface SlidingWindow {
|
|
|
4366
5212
|
targetTokens?: string;
|
|
4367
5213
|
}
|
|
4368
5214
|
|
|
5215
|
+
/** The configuration for the speaker to use. */
|
|
5216
|
+
export declare interface SpeakerVoiceConfig {
|
|
5217
|
+
/** The name of the speaker to use. Should be the same as in the
|
|
5218
|
+
prompt. */
|
|
5219
|
+
speaker?: string;
|
|
5220
|
+
/** The configuration for the voice to use. */
|
|
5221
|
+
voiceConfig?: VoiceConfig;
|
|
5222
|
+
}
|
|
5223
|
+
|
|
4369
5224
|
/** The speech generation configuration. */
|
|
4370
5225
|
export declare interface SpeechConfig {
|
|
4371
5226
|
/** The configuration for the speaker to use.
|
|
4372
5227
|
*/
|
|
4373
5228
|
voiceConfig?: VoiceConfig;
|
|
5229
|
+
/** The configuration for the multi-speaker setup.
|
|
5230
|
+
It is mutually exclusive with the voice_config field.
|
|
5231
|
+
*/
|
|
5232
|
+
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
4374
5233
|
/** Language code (ISO 639. e.g. en-US) for the speech synthesization.
|
|
4375
5234
|
Only available for Live API.
|
|
4376
5235
|
*/
|
|
@@ -4381,8 +5240,17 @@ export declare type SpeechConfigUnion = SpeechConfig | string;
|
|
|
4381
5240
|
|
|
4382
5241
|
/** Start of speech sensitivity. */
|
|
4383
5242
|
export declare enum StartSensitivity {
|
|
5243
|
+
/**
|
|
5244
|
+
* The default is START_SENSITIVITY_LOW.
|
|
5245
|
+
*/
|
|
4384
5246
|
START_SENSITIVITY_UNSPECIFIED = "START_SENSITIVITY_UNSPECIFIED",
|
|
5247
|
+
/**
|
|
5248
|
+
* Automatic detection will detect the start of speech more often.
|
|
5249
|
+
*/
|
|
4385
5250
|
START_SENSITIVITY_HIGH = "START_SENSITIVITY_HIGH",
|
|
5251
|
+
/**
|
|
5252
|
+
* Automatic detection will detect the start of speech less often.
|
|
5253
|
+
*/
|
|
4386
5254
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
4387
5255
|
}
|
|
4388
5256
|
|
|
@@ -4577,6 +5445,8 @@ export declare interface TokensInfo {
|
|
|
4577
5445
|
|
|
4578
5446
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
4579
5447
|
export declare interface Tool {
|
|
5448
|
+
/** List of function declarations that the tool supports. */
|
|
5449
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
4580
5450
|
/** 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. */
|
|
4581
5451
|
retrieval?: Retrieval;
|
|
4582
5452
|
/** Optional. Google Search tool type. Specialized retrieval tool
|
|
@@ -4590,10 +5460,10 @@ export declare interface Tool {
|
|
|
4590
5460
|
/** Optional. Google Maps tool type. Specialized retrieval tool
|
|
4591
5461
|
that is powered by Google Maps. */
|
|
4592
5462
|
googleMaps?: GoogleMaps;
|
|
5463
|
+
/** Optional. Tool to support URL context retrieval. */
|
|
5464
|
+
urlContext?: UrlContext;
|
|
4593
5465
|
/** 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. */
|
|
4594
5466
|
codeExecution?: ToolCodeExecution;
|
|
4595
|
-
/** 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. */
|
|
4596
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
4597
5467
|
}
|
|
4598
5468
|
|
|
4599
5469
|
/** 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. */
|
|
@@ -4611,12 +5481,23 @@ export declare interface ToolConfig {
|
|
|
4611
5481
|
retrievalConfig?: RetrievalConfig;
|
|
4612
5482
|
}
|
|
4613
5483
|
|
|
4614
|
-
export declare type ToolListUnion =
|
|
5484
|
+
export declare type ToolListUnion = ToolUnion[];
|
|
5485
|
+
|
|
5486
|
+
export declare type ToolUnion = Tool | CallableTool;
|
|
4615
5487
|
|
|
4616
5488
|
/** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
|
|
4617
5489
|
export declare enum TrafficType {
|
|
5490
|
+
/**
|
|
5491
|
+
* Unspecified request traffic type.
|
|
5492
|
+
*/
|
|
4618
5493
|
TRAFFIC_TYPE_UNSPECIFIED = "TRAFFIC_TYPE_UNSPECIFIED",
|
|
5494
|
+
/**
|
|
5495
|
+
* Type for Pay-As-You-Go traffic.
|
|
5496
|
+
*/
|
|
4619
5497
|
ON_DEMAND = "ON_DEMAND",
|
|
5498
|
+
/**
|
|
5499
|
+
* Type for Provisioned Throughput traffic.
|
|
5500
|
+
*/
|
|
4620
5501
|
PROVISIONED_THROUGHPUT = "PROVISIONED_THROUGHPUT"
|
|
4621
5502
|
}
|
|
4622
5503
|
|
|
@@ -4779,19 +5660,49 @@ export declare interface TuningValidationDataset {
|
|
|
4779
5660
|
|
|
4780
5661
|
/** Options about which input is included in the user's turn. */
|
|
4781
5662
|
export declare enum TurnCoverage {
|
|
5663
|
+
/**
|
|
5664
|
+
* If unspecified, the default behavior is `TURN_INCLUDES_ONLY_ACTIVITY`.
|
|
5665
|
+
*/
|
|
4782
5666
|
TURN_COVERAGE_UNSPECIFIED = "TURN_COVERAGE_UNSPECIFIED",
|
|
5667
|
+
/**
|
|
5668
|
+
* The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior.
|
|
5669
|
+
*/
|
|
4783
5670
|
TURN_INCLUDES_ONLY_ACTIVITY = "TURN_INCLUDES_ONLY_ACTIVITY",
|
|
5671
|
+
/**
|
|
5672
|
+
* The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
|
|
5673
|
+
*/
|
|
4784
5674
|
TURN_INCLUDES_ALL_INPUT = "TURN_INCLUDES_ALL_INPUT"
|
|
4785
5675
|
}
|
|
4786
5676
|
|
|
4787
5677
|
/** Optional. The type of the data. */
|
|
4788
5678
|
export declare enum Type {
|
|
5679
|
+
/**
|
|
5680
|
+
* Not specified, should not be used.
|
|
5681
|
+
*/
|
|
4789
5682
|
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
5683
|
+
/**
|
|
5684
|
+
* OpenAPI string type
|
|
5685
|
+
*/
|
|
4790
5686
|
STRING = "STRING",
|
|
5687
|
+
/**
|
|
5688
|
+
* OpenAPI number type
|
|
5689
|
+
*/
|
|
4791
5690
|
NUMBER = "NUMBER",
|
|
5691
|
+
/**
|
|
5692
|
+
* OpenAPI integer type
|
|
5693
|
+
*/
|
|
4792
5694
|
INTEGER = "INTEGER",
|
|
5695
|
+
/**
|
|
5696
|
+
* OpenAPI boolean type
|
|
5697
|
+
*/
|
|
4793
5698
|
BOOLEAN = "BOOLEAN",
|
|
5699
|
+
/**
|
|
5700
|
+
* OpenAPI array type
|
|
5701
|
+
*/
|
|
4794
5702
|
ARRAY = "ARRAY",
|
|
5703
|
+
/**
|
|
5704
|
+
* OpenAPI object type
|
|
5705
|
+
*/
|
|
4795
5706
|
OBJECT = "OBJECT"
|
|
4796
5707
|
}
|
|
4797
5708
|
|
|
@@ -4811,9 +5722,9 @@ declare namespace types {
|
|
|
4811
5722
|
HarmCategory,
|
|
4812
5723
|
HarmBlockMethod,
|
|
4813
5724
|
HarmBlockThreshold,
|
|
5725
|
+
Type,
|
|
4814
5726
|
Mode,
|
|
4815
5727
|
AuthType,
|
|
4816
|
-
Type,
|
|
4817
5728
|
FinishReason,
|
|
4818
5729
|
HarmProbability,
|
|
4819
5730
|
HarmSeverity,
|
|
@@ -4824,8 +5735,10 @@ declare namespace types {
|
|
|
4824
5735
|
JobState,
|
|
4825
5736
|
AdapterSize,
|
|
4826
5737
|
FeatureSelectionPreference,
|
|
5738
|
+
Behavior,
|
|
4827
5739
|
DynamicRetrievalConfigMode,
|
|
4828
5740
|
FunctionCallingConfigMode,
|
|
5741
|
+
UrlRetrievalStatus,
|
|
4829
5742
|
SafetyFilterLevel,
|
|
4830
5743
|
PersonGeneration,
|
|
4831
5744
|
ImagePromptLanguage,
|
|
@@ -4840,8 +5753,12 @@ declare namespace types {
|
|
|
4840
5753
|
EndSensitivity,
|
|
4841
5754
|
ActivityHandling,
|
|
4842
5755
|
TurnCoverage,
|
|
4843
|
-
|
|
5756
|
+
FunctionResponseScheduling,
|
|
5757
|
+
Scale,
|
|
5758
|
+
MusicGenerationMode,
|
|
5759
|
+
LiveMusicPlaybackControl,
|
|
4844
5760
|
VideoMetadata,
|
|
5761
|
+
Blob_2 as Blob,
|
|
4845
5762
|
CodeExecutionResult,
|
|
4846
5763
|
ExecutableCode,
|
|
4847
5764
|
FileData,
|
|
@@ -4852,6 +5769,9 @@ declare namespace types {
|
|
|
4852
5769
|
HttpOptions,
|
|
4853
5770
|
ModelSelectionConfig,
|
|
4854
5771
|
SafetySetting,
|
|
5772
|
+
Schema,
|
|
5773
|
+
FunctionDeclaration,
|
|
5774
|
+
Interval,
|
|
4855
5775
|
GoogleSearch,
|
|
4856
5776
|
DynamicRetrievalConfig,
|
|
4857
5777
|
GoogleSearchRetrieval,
|
|
@@ -4863,6 +5783,7 @@ declare namespace types {
|
|
|
4863
5783
|
AuthConfigOidcConfig,
|
|
4864
5784
|
AuthConfig,
|
|
4865
5785
|
GoogleMaps,
|
|
5786
|
+
UrlContext,
|
|
4866
5787
|
VertexAISearch,
|
|
4867
5788
|
VertexRagStoreRagResource,
|
|
4868
5789
|
RagRetrievalConfigFilter,
|
|
@@ -4874,8 +5795,6 @@ declare namespace types {
|
|
|
4874
5795
|
VertexRagStore,
|
|
4875
5796
|
Retrieval,
|
|
4876
5797
|
ToolCodeExecution,
|
|
4877
|
-
Schema,
|
|
4878
|
-
FunctionDeclaration,
|
|
4879
5798
|
Tool,
|
|
4880
5799
|
FunctionCallingConfig,
|
|
4881
5800
|
LatLng,
|
|
@@ -4883,7 +5802,10 @@ declare namespace types {
|
|
|
4883
5802
|
ToolConfig,
|
|
4884
5803
|
PrebuiltVoiceConfig,
|
|
4885
5804
|
VoiceConfig,
|
|
5805
|
+
SpeakerVoiceConfig,
|
|
5806
|
+
MultiSpeakerVoiceConfig,
|
|
4886
5807
|
SpeechConfig,
|
|
5808
|
+
AutomaticFunctionCallingConfig,
|
|
4887
5809
|
ThinkingConfig,
|
|
4888
5810
|
GenerationConfigRoutingConfigAutoRoutingMode,
|
|
4889
5811
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
@@ -4893,6 +5815,8 @@ declare namespace types {
|
|
|
4893
5815
|
GoogleTypeDate,
|
|
4894
5816
|
Citation,
|
|
4895
5817
|
CitationMetadata,
|
|
5818
|
+
UrlMetadata,
|
|
5819
|
+
UrlContextMetadata,
|
|
4896
5820
|
GroundingChunkRetrievedContext,
|
|
4897
5821
|
GroundingChunkWeb,
|
|
4898
5822
|
GroundingChunk,
|
|
@@ -5011,7 +5935,6 @@ declare namespace types {
|
|
|
5011
5935
|
CreateFileParameters,
|
|
5012
5936
|
HttpResponse,
|
|
5013
5937
|
LiveCallbacks,
|
|
5014
|
-
UploadFileParameters,
|
|
5015
5938
|
CreateFileResponse,
|
|
5016
5939
|
GetFileConfig,
|
|
5017
5940
|
GetFileParameters,
|
|
@@ -5053,6 +5976,7 @@ declare namespace types {
|
|
|
5053
5976
|
SlidingWindow,
|
|
5054
5977
|
ContextWindowCompressionConfig,
|
|
5055
5978
|
AudioTranscriptionConfig,
|
|
5979
|
+
ProactivityConfig,
|
|
5056
5980
|
LiveClientSetup,
|
|
5057
5981
|
LiveClientContent,
|
|
5058
5982
|
ActivityStart,
|
|
@@ -5067,6 +5991,24 @@ declare namespace types {
|
|
|
5067
5991
|
SendMessageParameters,
|
|
5068
5992
|
LiveSendClientContentParameters,
|
|
5069
5993
|
LiveSendToolResponseParameters,
|
|
5994
|
+
LiveMusicClientSetup,
|
|
5995
|
+
WeightedPrompt,
|
|
5996
|
+
LiveMusicClientContent,
|
|
5997
|
+
LiveMusicGenerationConfig,
|
|
5998
|
+
LiveMusicClientMessage,
|
|
5999
|
+
LiveMusicServerSetupComplete,
|
|
6000
|
+
LiveMusicSourceMetadata,
|
|
6001
|
+
AudioChunk,
|
|
6002
|
+
LiveMusicServerContent,
|
|
6003
|
+
LiveMusicFilteredPrompt,
|
|
6004
|
+
LiveMusicServerMessage,
|
|
6005
|
+
LiveMusicCallbacks,
|
|
6006
|
+
UploadFileParameters,
|
|
6007
|
+
CallableTool,
|
|
6008
|
+
CallableToolConfig,
|
|
6009
|
+
LiveMusicConnectParameters,
|
|
6010
|
+
LiveMusicSetConfigParameters,
|
|
6011
|
+
LiveMusicSetClientContentParameters,
|
|
5070
6012
|
OperationGetParameters,
|
|
5071
6013
|
BlobImageUnion,
|
|
5072
6014
|
PartUnion,
|
|
@@ -5075,6 +6017,7 @@ declare namespace types {
|
|
|
5075
6017
|
ContentListUnion,
|
|
5076
6018
|
SchemaUnion,
|
|
5077
6019
|
SpeechConfigUnion,
|
|
6020
|
+
ToolUnion,
|
|
5078
6021
|
ToolListUnion,
|
|
5079
6022
|
DownloadableFileUnion
|
|
5080
6023
|
}
|
|
@@ -5221,6 +6164,40 @@ export declare class UpscaleImageResponse {
|
|
|
5221
6164
|
generatedImages?: GeneratedImage[];
|
|
5222
6165
|
}
|
|
5223
6166
|
|
|
6167
|
+
/** Tool to support URL context retrieval. */
|
|
6168
|
+
export declare interface UrlContext {
|
|
6169
|
+
}
|
|
6170
|
+
|
|
6171
|
+
/** Metadata related to url context retrieval tool. */
|
|
6172
|
+
export declare interface UrlContextMetadata {
|
|
6173
|
+
/** List of url context. */
|
|
6174
|
+
urlMetadata?: UrlMetadata[];
|
|
6175
|
+
}
|
|
6176
|
+
|
|
6177
|
+
/** Context for a single url retrieval. */
|
|
6178
|
+
export declare interface UrlMetadata {
|
|
6179
|
+
/** The URL retrieved by the tool. */
|
|
6180
|
+
retrievedUrl?: string;
|
|
6181
|
+
/** Status of the url retrieval. */
|
|
6182
|
+
urlRetrievalStatus?: UrlRetrievalStatus;
|
|
6183
|
+
}
|
|
6184
|
+
|
|
6185
|
+
/** Status of the url retrieval. */
|
|
6186
|
+
export declare enum UrlRetrievalStatus {
|
|
6187
|
+
/**
|
|
6188
|
+
* Default value. This value is unused
|
|
6189
|
+
*/
|
|
6190
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED = "URL_RETRIEVAL_STATUS_UNSPECIFIED",
|
|
6191
|
+
/**
|
|
6192
|
+
* Url retrieval is successful.
|
|
6193
|
+
*/
|
|
6194
|
+
URL_RETRIEVAL_STATUS_SUCCESS = "URL_RETRIEVAL_STATUS_SUCCESS",
|
|
6195
|
+
/**
|
|
6196
|
+
* Url retrieval is failed due to error.
|
|
6197
|
+
*/
|
|
6198
|
+
URL_RETRIEVAL_STATUS_ERROR = "URL_RETRIEVAL_STATUS_ERROR"
|
|
6199
|
+
}
|
|
6200
|
+
|
|
5224
6201
|
/** Usage metadata about response(s). */
|
|
5225
6202
|
export declare interface UsageMetadata {
|
|
5226
6203
|
/** 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. */
|
|
@@ -5288,8 +6265,11 @@ export declare interface Video {
|
|
|
5288
6265
|
mimeType?: string;
|
|
5289
6266
|
}
|
|
5290
6267
|
|
|
5291
|
-
/**
|
|
6268
|
+
/** Describes how the video in the Part should be used by the model. */
|
|
5292
6269
|
export declare interface VideoMetadata {
|
|
6270
|
+
/** The frame rate of the video sent to the model. If not specified, the
|
|
6271
|
+
default value will be 1.0. The fps range is (0.0, 24.0]. */
|
|
6272
|
+
fps?: number;
|
|
5293
6273
|
/** Optional. The end offset of the video. */
|
|
5294
6274
|
endOffset?: string;
|
|
5295
6275
|
/** Optional. The start offset of the video. */
|
|
@@ -5337,4 +6317,17 @@ declare interface WebSocketFactory {
|
|
|
5337
6317
|
create(url: string, headers: Record<string, string>, callbacks: WebSocketCallbacks): WebSocket_2;
|
|
5338
6318
|
}
|
|
5339
6319
|
|
|
6320
|
+
/** Maps a prompt to a relative weight to steer music generation. */
|
|
6321
|
+
export declare interface WeightedPrompt {
|
|
6322
|
+
/** Text prompt. */
|
|
6323
|
+
text?: string;
|
|
6324
|
+
/** Weight of the prompt. The weight is used to control the relative
|
|
6325
|
+
importance of the prompt. Higher weights are more important than lower
|
|
6326
|
+
weights.
|
|
6327
|
+
|
|
6328
|
+
Weight must not be 0. Weights of all weighted_prompts in this
|
|
6329
|
+
LiveMusicClientContent message will be normalized. */
|
|
6330
|
+
weight?: number;
|
|
6331
|
+
}
|
|
6332
|
+
|
|
5340
6333
|
export { }
|