@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/web/web.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. */
|
|
@@ -2454,6 +2703,10 @@ export declare interface GoogleRpcStatus {
|
|
|
2454
2703
|
|
|
2455
2704
|
/** Tool to support Google Search in Model. Powered by Google. */
|
|
2456
2705
|
export declare interface GoogleSearch {
|
|
2706
|
+
/** Optional. Filter search results to a specific time range.
|
|
2707
|
+
If customers set a start time, they must set an end time (and vice versa).
|
|
2708
|
+
*/
|
|
2709
|
+
timeRangeFilter?: Interval;
|
|
2457
2710
|
}
|
|
2458
2711
|
|
|
2459
2712
|
/** Tool to retrieve public web data for grounding, powered by Google. */
|
|
@@ -2528,46 +2781,121 @@ export declare interface GroundingSupport {
|
|
|
2528
2781
|
|
|
2529
2782
|
/** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
|
|
2530
2783
|
export declare enum HarmBlockMethod {
|
|
2784
|
+
/**
|
|
2785
|
+
* The harm block method is unspecified.
|
|
2786
|
+
*/
|
|
2531
2787
|
HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED",
|
|
2788
|
+
/**
|
|
2789
|
+
* The harm block method uses both probability and severity scores.
|
|
2790
|
+
*/
|
|
2532
2791
|
SEVERITY = "SEVERITY",
|
|
2792
|
+
/**
|
|
2793
|
+
* The harm block method uses the probability score.
|
|
2794
|
+
*/
|
|
2533
2795
|
PROBABILITY = "PROBABILITY"
|
|
2534
2796
|
}
|
|
2535
2797
|
|
|
2536
2798
|
/** Required. The harm block threshold. */
|
|
2537
2799
|
export declare enum HarmBlockThreshold {
|
|
2800
|
+
/**
|
|
2801
|
+
* Unspecified harm block threshold.
|
|
2802
|
+
*/
|
|
2538
2803
|
HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
2804
|
+
/**
|
|
2805
|
+
* Block low threshold and above (i.e. block more).
|
|
2806
|
+
*/
|
|
2539
2807
|
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
2808
|
+
/**
|
|
2809
|
+
* Block medium threshold and above.
|
|
2810
|
+
*/
|
|
2540
2811
|
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
2812
|
+
/**
|
|
2813
|
+
* Block only high threshold (i.e. block less).
|
|
2814
|
+
*/
|
|
2541
2815
|
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
|
|
2816
|
+
/**
|
|
2817
|
+
* Block none.
|
|
2818
|
+
*/
|
|
2542
2819
|
BLOCK_NONE = "BLOCK_NONE",
|
|
2820
|
+
/**
|
|
2821
|
+
* Turn off the safety filter.
|
|
2822
|
+
*/
|
|
2543
2823
|
OFF = "OFF"
|
|
2544
2824
|
}
|
|
2545
2825
|
|
|
2546
2826
|
/** Required. Harm category. */
|
|
2547
2827
|
export declare enum HarmCategory {
|
|
2828
|
+
/**
|
|
2829
|
+
* The harm category is unspecified.
|
|
2830
|
+
*/
|
|
2548
2831
|
HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED",
|
|
2832
|
+
/**
|
|
2833
|
+
* The harm category is hate speech.
|
|
2834
|
+
*/
|
|
2549
2835
|
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
|
|
2836
|
+
/**
|
|
2837
|
+
* The harm category is dangerous content.
|
|
2838
|
+
*/
|
|
2550
2839
|
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
2840
|
+
/**
|
|
2841
|
+
* The harm category is harassment.
|
|
2842
|
+
*/
|
|
2551
2843
|
HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
|
|
2844
|
+
/**
|
|
2845
|
+
* The harm category is sexually explicit content.
|
|
2846
|
+
*/
|
|
2552
2847
|
HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
2848
|
+
/**
|
|
2849
|
+
* The harm category is civic integrity.
|
|
2850
|
+
*/
|
|
2553
2851
|
HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
2554
2852
|
}
|
|
2555
2853
|
|
|
2556
2854
|
/** Output only. Harm probability levels in the content. */
|
|
2557
2855
|
export declare enum HarmProbability {
|
|
2856
|
+
/**
|
|
2857
|
+
* Harm probability unspecified.
|
|
2858
|
+
*/
|
|
2558
2859
|
HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED",
|
|
2860
|
+
/**
|
|
2861
|
+
* Negligible level of harm.
|
|
2862
|
+
*/
|
|
2559
2863
|
NEGLIGIBLE = "NEGLIGIBLE",
|
|
2864
|
+
/**
|
|
2865
|
+
* Low level of harm.
|
|
2866
|
+
*/
|
|
2560
2867
|
LOW = "LOW",
|
|
2868
|
+
/**
|
|
2869
|
+
* Medium level of harm.
|
|
2870
|
+
*/
|
|
2561
2871
|
MEDIUM = "MEDIUM",
|
|
2872
|
+
/**
|
|
2873
|
+
* High level of harm.
|
|
2874
|
+
*/
|
|
2562
2875
|
HIGH = "HIGH"
|
|
2563
2876
|
}
|
|
2564
2877
|
|
|
2565
2878
|
/** Output only. Harm severity levels in the content. */
|
|
2566
2879
|
export declare enum HarmSeverity {
|
|
2880
|
+
/**
|
|
2881
|
+
* Harm severity unspecified.
|
|
2882
|
+
*/
|
|
2567
2883
|
HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED",
|
|
2884
|
+
/**
|
|
2885
|
+
* Negligible level of harm severity.
|
|
2886
|
+
*/
|
|
2568
2887
|
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
|
|
2888
|
+
/**
|
|
2889
|
+
* Low level of harm severity.
|
|
2890
|
+
*/
|
|
2569
2891
|
HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
|
|
2892
|
+
/**
|
|
2893
|
+
* Medium level of harm severity.
|
|
2894
|
+
*/
|
|
2570
2895
|
HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
|
|
2896
|
+
/**
|
|
2897
|
+
* High level of harm severity.
|
|
2898
|
+
*/
|
|
2571
2899
|
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
|
|
2572
2900
|
}
|
|
2573
2901
|
|
|
@@ -2668,25 +2996,81 @@ export declare enum ImagePromptLanguage {
|
|
|
2668
2996
|
hi = "hi"
|
|
2669
2997
|
}
|
|
2670
2998
|
|
|
2999
|
+
/** Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
|
|
3000
|
+
|
|
3001
|
+
The start time must be less than or equal to the end time.
|
|
3002
|
+
When the start equals the end time, the interval is an empty interval.
|
|
3003
|
+
(matches no time)
|
|
3004
|
+
When both start and end are unspecified, the interval matches any time.
|
|
3005
|
+
*/
|
|
3006
|
+
export declare interface Interval {
|
|
3007
|
+
/** The start time of the interval. */
|
|
3008
|
+
startTime?: string;
|
|
3009
|
+
/** The end time of the interval. */
|
|
3010
|
+
endTime?: string;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2671
3013
|
/** Output only. The detailed state of the job. */
|
|
2672
3014
|
export declare enum JobState {
|
|
3015
|
+
/**
|
|
3016
|
+
* The job state is unspecified.
|
|
3017
|
+
*/
|
|
2673
3018
|
JOB_STATE_UNSPECIFIED = "JOB_STATE_UNSPECIFIED",
|
|
3019
|
+
/**
|
|
3020
|
+
* The job has been just created or resumed and processing has not yet begun.
|
|
3021
|
+
*/
|
|
2674
3022
|
JOB_STATE_QUEUED = "JOB_STATE_QUEUED",
|
|
3023
|
+
/**
|
|
3024
|
+
* The service is preparing to run the job.
|
|
3025
|
+
*/
|
|
2675
3026
|
JOB_STATE_PENDING = "JOB_STATE_PENDING",
|
|
3027
|
+
/**
|
|
3028
|
+
* The job is in progress.
|
|
3029
|
+
*/
|
|
2676
3030
|
JOB_STATE_RUNNING = "JOB_STATE_RUNNING",
|
|
3031
|
+
/**
|
|
3032
|
+
* The job completed successfully.
|
|
3033
|
+
*/
|
|
2677
3034
|
JOB_STATE_SUCCEEDED = "JOB_STATE_SUCCEEDED",
|
|
3035
|
+
/**
|
|
3036
|
+
* The job failed.
|
|
3037
|
+
*/
|
|
2678
3038
|
JOB_STATE_FAILED = "JOB_STATE_FAILED",
|
|
3039
|
+
/**
|
|
3040
|
+
* 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`.
|
|
3041
|
+
*/
|
|
2679
3042
|
JOB_STATE_CANCELLING = "JOB_STATE_CANCELLING",
|
|
3043
|
+
/**
|
|
3044
|
+
* The job has been cancelled.
|
|
3045
|
+
*/
|
|
2680
3046
|
JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED",
|
|
3047
|
+
/**
|
|
3048
|
+
* The job has been stopped, and can be resumed.
|
|
3049
|
+
*/
|
|
2681
3050
|
JOB_STATE_PAUSED = "JOB_STATE_PAUSED",
|
|
3051
|
+
/**
|
|
3052
|
+
* The job has expired.
|
|
3053
|
+
*/
|
|
2682
3054
|
JOB_STATE_EXPIRED = "JOB_STATE_EXPIRED",
|
|
3055
|
+
/**
|
|
3056
|
+
* The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state.
|
|
3057
|
+
*/
|
|
2683
3058
|
JOB_STATE_UPDATING = "JOB_STATE_UPDATING",
|
|
3059
|
+
/**
|
|
3060
|
+
* The job is partially succeeded, some results may be missing due to errors.
|
|
3061
|
+
*/
|
|
2684
3062
|
JOB_STATE_PARTIALLY_SUCCEEDED = "JOB_STATE_PARTIALLY_SUCCEEDED"
|
|
2685
3063
|
}
|
|
2686
3064
|
|
|
2687
3065
|
/** Required. Programming language of the `code`. */
|
|
2688
3066
|
export declare enum Language {
|
|
3067
|
+
/**
|
|
3068
|
+
* Unspecified language. This value should not be used.
|
|
3069
|
+
*/
|
|
2689
3070
|
LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
|
|
3071
|
+
/**
|
|
3072
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
3073
|
+
*/
|
|
2690
3074
|
PYTHON = "PYTHON"
|
|
2691
3075
|
}
|
|
2692
3076
|
|
|
@@ -2827,12 +3211,14 @@ export declare class Live {
|
|
|
2827
3211
|
private readonly apiClient;
|
|
2828
3212
|
private readonly auth;
|
|
2829
3213
|
private readonly webSocketFactory;
|
|
3214
|
+
readonly music: LiveMusic;
|
|
2830
3215
|
constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
|
|
2831
3216
|
/**
|
|
2832
3217
|
Establishes a connection to the specified model with the given
|
|
2833
3218
|
configuration and returns a Session object representing that connection.
|
|
2834
3219
|
|
|
2835
|
-
@experimental
|
|
3220
|
+
@experimental Built-in MCP support is a preview feature, may change in
|
|
3221
|
+
future versions.
|
|
2836
3222
|
|
|
2837
3223
|
@remarks
|
|
2838
3224
|
|
|
@@ -2870,6 +3256,7 @@ export declare class Live {
|
|
|
2870
3256
|
```
|
|
2871
3257
|
*/
|
|
2872
3258
|
connect(params: types.LiveConnectParameters): Promise<Session>;
|
|
3259
|
+
private isCallableTool;
|
|
2873
3260
|
}
|
|
2874
3261
|
|
|
2875
3262
|
/** Callbacks for the live API. */
|
|
@@ -3003,6 +3390,9 @@ export declare interface LiveClientSetup {
|
|
|
3003
3390
|
specified for the output audio.
|
|
3004
3391
|
*/
|
|
3005
3392
|
outputAudioTranscription?: AudioTranscriptionConfig;
|
|
3393
|
+
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
3394
|
+
the input and to ignore irrelevant input. */
|
|
3395
|
+
proactivity?: ProactivityConfig;
|
|
3006
3396
|
}
|
|
3007
3397
|
|
|
3008
3398
|
/** Client generated response to a `ToolCall` received from the server.
|
|
@@ -3060,6 +3450,8 @@ export declare interface LiveConnectConfig {
|
|
|
3060
3450
|
/** The speech generation configuration.
|
|
3061
3451
|
*/
|
|
3062
3452
|
speechConfig?: SpeechConfig;
|
|
3453
|
+
/** If enabled, the model will detect emotions and adapt its responses accordingly. */
|
|
3454
|
+
enableAffectiveDialog?: boolean;
|
|
3063
3455
|
/** The user provided system instructions for the model.
|
|
3064
3456
|
Note: only text should be used in parts and content in each part will be
|
|
3065
3457
|
in a separate paragraph. */
|
|
@@ -3087,6 +3479,9 @@ export declare interface LiveConnectConfig {
|
|
|
3087
3479
|
|
|
3088
3480
|
If included, server will compress context window to fit into given length. */
|
|
3089
3481
|
contextWindowCompression?: ContextWindowCompressionConfig;
|
|
3482
|
+
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
3483
|
+
the input and to ignore irrelevant input. */
|
|
3484
|
+
proactivity?: ProactivityConfig;
|
|
3090
3485
|
}
|
|
3091
3486
|
|
|
3092
3487
|
/** Parameters for connecting to the live API. */
|
|
@@ -3101,6 +3496,288 @@ export declare interface LiveConnectParameters {
|
|
|
3101
3496
|
config?: LiveConnectConfig;
|
|
3102
3497
|
}
|
|
3103
3498
|
|
|
3499
|
+
/**
|
|
3500
|
+
LiveMusic class encapsulates the configuration for live music
|
|
3501
|
+
generation via Lyria Live models.
|
|
3502
|
+
|
|
3503
|
+
@experimental
|
|
3504
|
+
*/
|
|
3505
|
+
declare class LiveMusic {
|
|
3506
|
+
private readonly apiClient;
|
|
3507
|
+
private readonly auth;
|
|
3508
|
+
private readonly webSocketFactory;
|
|
3509
|
+
constructor(apiClient: ApiClient, auth: Auth, webSocketFactory: WebSocketFactory);
|
|
3510
|
+
/**
|
|
3511
|
+
Establishes a connection to the specified model and returns a
|
|
3512
|
+
LiveMusicSession object representing that connection.
|
|
3513
|
+
|
|
3514
|
+
@experimental
|
|
3515
|
+
|
|
3516
|
+
@remarks
|
|
3517
|
+
|
|
3518
|
+
@param params - The parameters for establishing a connection to the model.
|
|
3519
|
+
@return A live session.
|
|
3520
|
+
|
|
3521
|
+
@example
|
|
3522
|
+
```ts
|
|
3523
|
+
let model = 'models/lyria-realtime-exp';
|
|
3524
|
+
const session = await ai.live.music.connect({
|
|
3525
|
+
model: model,
|
|
3526
|
+
callbacks: {
|
|
3527
|
+
onmessage: (e: MessageEvent) => {
|
|
3528
|
+
console.log('Received message from the server: %s\n', debug(e.data));
|
|
3529
|
+
},
|
|
3530
|
+
onerror: (e: ErrorEvent) => {
|
|
3531
|
+
console.log('Error occurred: %s\n', debug(e.error));
|
|
3532
|
+
},
|
|
3533
|
+
onclose: (e: CloseEvent) => {
|
|
3534
|
+
console.log('Connection closed.');
|
|
3535
|
+
},
|
|
3536
|
+
},
|
|
3537
|
+
});
|
|
3538
|
+
```
|
|
3539
|
+
*/
|
|
3540
|
+
connect(params: types.LiveMusicConnectParameters): Promise<LiveMusicSession>;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
/** Callbacks for the realtime music API. */
|
|
3544
|
+
export declare interface LiveMusicCallbacks {
|
|
3545
|
+
/**
|
|
3546
|
+
* Called when a message is received from the server.
|
|
3547
|
+
*/
|
|
3548
|
+
onmessage: (e: LiveMusicServerMessage) => void;
|
|
3549
|
+
/**
|
|
3550
|
+
* Called when an error occurs.
|
|
3551
|
+
*/
|
|
3552
|
+
onerror?: ((e: ErrorEvent) => void) | null;
|
|
3553
|
+
/**
|
|
3554
|
+
* Called when the websocket connection is closed.
|
|
3555
|
+
*/
|
|
3556
|
+
onclose?: ((e: CloseEvent) => void) | null;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
/** User input to start or steer the music. */
|
|
3560
|
+
export declare interface LiveMusicClientContent {
|
|
3561
|
+
/** Weighted prompts as the model input. */
|
|
3562
|
+
weightedPrompts?: WeightedPrompt[];
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
/** Messages sent by the client in the LiveMusicClientMessage call. */
|
|
3566
|
+
export declare interface LiveMusicClientMessage {
|
|
3567
|
+
/** Message to be sent in the first (and only in the first) `LiveMusicClientMessage`.
|
|
3568
|
+
Clients should wait for a `LiveMusicSetupComplete` message before
|
|
3569
|
+
sending any additional messages. */
|
|
3570
|
+
setup?: LiveMusicClientSetup;
|
|
3571
|
+
/** User input to influence music generation. */
|
|
3572
|
+
clientContent?: LiveMusicClientContent;
|
|
3573
|
+
/** Configuration for music generation. */
|
|
3574
|
+
musicGenerationConfig?: LiveMusicGenerationConfig;
|
|
3575
|
+
/** Playback control signal for the music generation. */
|
|
3576
|
+
playbackControl?: LiveMusicPlaybackControl;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
/** Message to be sent by the system when connecting to the API. */
|
|
3580
|
+
export declare interface LiveMusicClientSetup {
|
|
3581
|
+
/** The model's resource name. Format: `models/{model}`. */
|
|
3582
|
+
model?: string;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
/** Parameters for connecting to the live API. */
|
|
3586
|
+
export declare interface LiveMusicConnectParameters {
|
|
3587
|
+
/** The model's resource name. */
|
|
3588
|
+
model: string;
|
|
3589
|
+
/** Callbacks invoked on server events. */
|
|
3590
|
+
callbacks: LiveMusicCallbacks;
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
/** A prompt that was filtered with the reason. */
|
|
3594
|
+
export declare interface LiveMusicFilteredPrompt {
|
|
3595
|
+
/** The text prompt that was filtered. */
|
|
3596
|
+
text?: string;
|
|
3597
|
+
/** The reason the prompt was filtered. */
|
|
3598
|
+
filteredReason?: string;
|
|
3599
|
+
}
|
|
3600
|
+
|
|
3601
|
+
/** Configuration for music generation. */
|
|
3602
|
+
export declare interface LiveMusicGenerationConfig {
|
|
3603
|
+
/** Controls the variance in audio generation. Higher values produce
|
|
3604
|
+
higher variance. Range is [0.0, 3.0]. */
|
|
3605
|
+
temperature?: number;
|
|
3606
|
+
/** Controls how the model selects tokens for output. Samples the topK
|
|
3607
|
+
tokens with the highest probabilities. Range is [1, 1000]. */
|
|
3608
|
+
topK?: number;
|
|
3609
|
+
/** Seeds audio generation. If not set, the request uses a randomly
|
|
3610
|
+
generated seed. */
|
|
3611
|
+
seed?: number;
|
|
3612
|
+
/** Controls how closely the model follows prompts.
|
|
3613
|
+
Higher guidance follows more closely, but will make transitions more
|
|
3614
|
+
abrupt. Range is [0.0, 6.0]. */
|
|
3615
|
+
guidance?: number;
|
|
3616
|
+
/** Beats per minute. Range is [60, 200]. */
|
|
3617
|
+
bpm?: number;
|
|
3618
|
+
/** Density of sounds. Range is [0.0, 1.0]. */
|
|
3619
|
+
density?: number;
|
|
3620
|
+
/** Brightness of the music. Range is [0.0, 1.0]. */
|
|
3621
|
+
brightness?: number;
|
|
3622
|
+
/** Scale of the generated music. */
|
|
3623
|
+
scale?: Scale;
|
|
3624
|
+
/** Whether the audio output should contain bass. */
|
|
3625
|
+
muteBass?: boolean;
|
|
3626
|
+
/** Whether the audio output should contain drums. */
|
|
3627
|
+
muteDrums?: boolean;
|
|
3628
|
+
/** Whether the audio output should contain only bass and drums. */
|
|
3629
|
+
onlyBassAndDrums?: boolean;
|
|
3630
|
+
/** The mode of music generation. Default mode is QUALITY. */
|
|
3631
|
+
musicGenerationMode?: MusicGenerationMode;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
/** The playback control signal to apply to the music generation. */
|
|
3635
|
+
export declare enum LiveMusicPlaybackControl {
|
|
3636
|
+
/**
|
|
3637
|
+
* This value is unused.
|
|
3638
|
+
*/
|
|
3639
|
+
PLAYBACK_CONTROL_UNSPECIFIED = "PLAYBACK_CONTROL_UNSPECIFIED",
|
|
3640
|
+
/**
|
|
3641
|
+
* Start generating the music.
|
|
3642
|
+
*/
|
|
3643
|
+
PLAY = "PLAY",
|
|
3644
|
+
/**
|
|
3645
|
+
* Hold the music generation. Use PLAY to resume from the current position.
|
|
3646
|
+
*/
|
|
3647
|
+
PAUSE = "PAUSE",
|
|
3648
|
+
/**
|
|
3649
|
+
* Stop the music generation and reset the context (prompts retained).
|
|
3650
|
+
Use PLAY to restart the music generation.
|
|
3651
|
+
*/
|
|
3652
|
+
STOP = "STOP",
|
|
3653
|
+
/**
|
|
3654
|
+
* Reset the context of the music generation without stopping it.
|
|
3655
|
+
Retains the current prompts and config.
|
|
3656
|
+
*/
|
|
3657
|
+
RESET_CONTEXT = "RESET_CONTEXT"
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
/** Server update generated by the model in response to client messages.
|
|
3661
|
+
|
|
3662
|
+
Content is generated as quickly as possible, and not in real time.
|
|
3663
|
+
Clients may choose to buffer and play it out in real time.
|
|
3664
|
+
*/
|
|
3665
|
+
export declare interface LiveMusicServerContent {
|
|
3666
|
+
/** The audio chunks that the model has generated. */
|
|
3667
|
+
audioChunks?: AudioChunk[];
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
/** Response message for the LiveMusicClientMessage call. */
|
|
3671
|
+
export declare class LiveMusicServerMessage {
|
|
3672
|
+
/** Message sent in response to a `LiveMusicClientSetup` message from the client.
|
|
3673
|
+
Clients should wait for this message before sending any additional messages. */
|
|
3674
|
+
setupComplete?: LiveMusicServerSetupComplete;
|
|
3675
|
+
/** Content generated by the model in response to client messages. */
|
|
3676
|
+
serverContent?: LiveMusicServerContent;
|
|
3677
|
+
/** A prompt that was filtered with the reason. */
|
|
3678
|
+
filteredPrompt?: LiveMusicFilteredPrompt;
|
|
3679
|
+
/**
|
|
3680
|
+
* Returns the first audio chunk from the server content, if present.
|
|
3681
|
+
*
|
|
3682
|
+
* @remarks
|
|
3683
|
+
* If there are no audio chunks in the response, undefined will be returned.
|
|
3684
|
+
*/
|
|
3685
|
+
get audioChunk(): AudioChunk | undefined;
|
|
3686
|
+
}
|
|
3687
|
+
|
|
3688
|
+
/** Sent in response to a `LiveMusicClientSetup` message from the client. */
|
|
3689
|
+
export declare interface LiveMusicServerSetupComplete {
|
|
3690
|
+
}
|
|
3691
|
+
|
|
3692
|
+
/**
|
|
3693
|
+
Represents a connection to the API.
|
|
3694
|
+
|
|
3695
|
+
@experimental
|
|
3696
|
+
*/
|
|
3697
|
+
declare class LiveMusicSession {
|
|
3698
|
+
readonly conn: WebSocket_2;
|
|
3699
|
+
private readonly apiClient;
|
|
3700
|
+
constructor(conn: WebSocket_2, apiClient: ApiClient);
|
|
3701
|
+
/**
|
|
3702
|
+
Sets inputs to steer music generation. Updates the session's current
|
|
3703
|
+
weighted prompts.
|
|
3704
|
+
|
|
3705
|
+
@param params - Contains one property, `weightedPrompts`.
|
|
3706
|
+
|
|
3707
|
+
- `weightedPrompts` to send to the model; weights are normalized to
|
|
3708
|
+
sum to 1.0.
|
|
3709
|
+
|
|
3710
|
+
@experimental
|
|
3711
|
+
*/
|
|
3712
|
+
setClientContent(params: types.LiveMusicSetClientContentParameters): Promise<void>;
|
|
3713
|
+
/**
|
|
3714
|
+
Sets a configuration to the model. Updates the session's current
|
|
3715
|
+
music generation config.
|
|
3716
|
+
|
|
3717
|
+
@param params - Contains one property, `musicGenerationConfig`.
|
|
3718
|
+
|
|
3719
|
+
- `musicGenerationConfig` to set in the model. Passing an empty or
|
|
3720
|
+
undefined config to the model will reset the config to defaults.
|
|
3721
|
+
|
|
3722
|
+
@experimental
|
|
3723
|
+
*/
|
|
3724
|
+
setMusicGenerationConfig(params: types.LiveMusicSetConfigParameters): Promise<void>;
|
|
3725
|
+
private sendPlaybackControl;
|
|
3726
|
+
/**
|
|
3727
|
+
* Start the music stream.
|
|
3728
|
+
*
|
|
3729
|
+
* @experimental
|
|
3730
|
+
*/
|
|
3731
|
+
play(): void;
|
|
3732
|
+
/**
|
|
3733
|
+
* Temporarily halt the music stream. Use `play` to resume from the current
|
|
3734
|
+
* position.
|
|
3735
|
+
*
|
|
3736
|
+
* @experimental
|
|
3737
|
+
*/
|
|
3738
|
+
pause(): void;
|
|
3739
|
+
/**
|
|
3740
|
+
* Stop the music stream and reset the state. Retains the current prompts
|
|
3741
|
+
* and config.
|
|
3742
|
+
*
|
|
3743
|
+
* @experimental
|
|
3744
|
+
*/
|
|
3745
|
+
stop(): void;
|
|
3746
|
+
/**
|
|
3747
|
+
* Resets the context of the music generation without stopping it.
|
|
3748
|
+
* Retains the current prompts and config.
|
|
3749
|
+
*
|
|
3750
|
+
* @experimental
|
|
3751
|
+
*/
|
|
3752
|
+
resetContext(): void;
|
|
3753
|
+
/**
|
|
3754
|
+
Terminates the WebSocket connection.
|
|
3755
|
+
|
|
3756
|
+
@experimental
|
|
3757
|
+
*/
|
|
3758
|
+
close(): void;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
/** Parameters for setting client content for the live API. */
|
|
3762
|
+
export declare interface LiveMusicSetClientContentParameters {
|
|
3763
|
+
/** A map of text prompts to weights to use for the generation request. */
|
|
3764
|
+
weightedPrompts: WeightedPrompt[];
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
/** Parameters for setting config for the live API. */
|
|
3768
|
+
export declare interface LiveMusicSetConfigParameters {
|
|
3769
|
+
/** Configuration for music generation. */
|
|
3770
|
+
musicGenerationConfig: LiveMusicGenerationConfig;
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
/** Prompts and config used for generating this audio chunk. */
|
|
3774
|
+
export declare interface LiveMusicSourceMetadata {
|
|
3775
|
+
/** Weighted prompts for generating this audio chunk. */
|
|
3776
|
+
clientContent?: LiveMusicClientContent;
|
|
3777
|
+
/** Music generation config for generating this audio chunk. */
|
|
3778
|
+
musicGenerationConfig?: LiveMusicGenerationConfig;
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3104
3781
|
/** Parameters for sending client content to the live API. */
|
|
3105
3782
|
export declare interface LiveSendClientContentParameters {
|
|
3106
3783
|
/** Client content to send to the session. */
|
|
@@ -3175,6 +3852,8 @@ export declare interface LiveServerContent {
|
|
|
3175
3852
|
model turn.
|
|
3176
3853
|
*/
|
|
3177
3854
|
outputTranscription?: Transcription;
|
|
3855
|
+
/** Metadata related to url context retrieval tool. */
|
|
3856
|
+
urlContextMetadata?: UrlContextMetadata;
|
|
3178
3857
|
}
|
|
3179
3858
|
|
|
3180
3859
|
/** Server will not be able to service client soon. */
|
|
@@ -3324,29 +4003,83 @@ export declare enum MaskReferenceMode {
|
|
|
3324
4003
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
3325
4004
|
}
|
|
3326
4005
|
|
|
4006
|
+
/**
|
|
4007
|
+
* Creates a McpCallableTool from MCP clients and an optional config.
|
|
4008
|
+
*
|
|
4009
|
+
* The callable tool can invoke the MCP clients with given function call
|
|
4010
|
+
* arguments. (often for automatic function calling).
|
|
4011
|
+
* Use the config to modify tool parameters such as behavior.
|
|
4012
|
+
*
|
|
4013
|
+
* @experimental Built-in MCP support is a preview feature, may change in future
|
|
4014
|
+
* versions.
|
|
4015
|
+
*/
|
|
4016
|
+
export declare function mcpToTool(...args: [...Client[], CallableToolConfig | Client]): CallableTool;
|
|
4017
|
+
|
|
3327
4018
|
/** Server content modalities. */
|
|
3328
4019
|
export declare enum MediaModality {
|
|
4020
|
+
/**
|
|
4021
|
+
* The modality is unspecified.
|
|
4022
|
+
*/
|
|
3329
4023
|
MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
|
|
4024
|
+
/**
|
|
4025
|
+
* Plain text.
|
|
4026
|
+
*/
|
|
3330
4027
|
TEXT = "TEXT",
|
|
4028
|
+
/**
|
|
4029
|
+
* Images.
|
|
4030
|
+
*/
|
|
3331
4031
|
IMAGE = "IMAGE",
|
|
4032
|
+
/**
|
|
4033
|
+
* Video.
|
|
4034
|
+
*/
|
|
3332
4035
|
VIDEO = "VIDEO",
|
|
4036
|
+
/**
|
|
4037
|
+
* Audio.
|
|
4038
|
+
*/
|
|
3333
4039
|
AUDIO = "AUDIO",
|
|
4040
|
+
/**
|
|
4041
|
+
* Document, e.g. PDF.
|
|
4042
|
+
*/
|
|
3334
4043
|
DOCUMENT = "DOCUMENT"
|
|
3335
4044
|
}
|
|
3336
4045
|
|
|
3337
4046
|
/** The media resolution to use. */
|
|
3338
4047
|
export declare enum MediaResolution {
|
|
4048
|
+
/**
|
|
4049
|
+
* Media resolution has not been set
|
|
4050
|
+
*/
|
|
3339
4051
|
MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
|
|
4052
|
+
/**
|
|
4053
|
+
* Media resolution set to low (64 tokens).
|
|
4054
|
+
*/
|
|
3340
4055
|
MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
|
|
4056
|
+
/**
|
|
4057
|
+
* Media resolution set to medium (256 tokens).
|
|
4058
|
+
*/
|
|
3341
4059
|
MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
|
|
4060
|
+
/**
|
|
4061
|
+
* Media resolution set to high (zoomed reframing with 256 tokens).
|
|
4062
|
+
*/
|
|
3342
4063
|
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
3343
4064
|
}
|
|
3344
4065
|
|
|
3345
4066
|
/** Server content modalities. */
|
|
3346
4067
|
export declare enum Modality {
|
|
4068
|
+
/**
|
|
4069
|
+
* The modality is unspecified.
|
|
4070
|
+
*/
|
|
3347
4071
|
MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
|
|
4072
|
+
/**
|
|
4073
|
+
* Indicates the model should return text
|
|
4074
|
+
*/
|
|
3348
4075
|
TEXT = "TEXT",
|
|
4076
|
+
/**
|
|
4077
|
+
* Indicates the model should return images.
|
|
4078
|
+
*/
|
|
3349
4079
|
IMAGE = "IMAGE",
|
|
4080
|
+
/**
|
|
4081
|
+
* Indicates the model should return images.
|
|
4082
|
+
*/
|
|
3350
4083
|
AUDIO = "AUDIO"
|
|
3351
4084
|
}
|
|
3352
4085
|
|
|
@@ -3360,7 +4093,13 @@ export declare interface ModalityTokenCount {
|
|
|
3360
4093
|
|
|
3361
4094
|
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
3362
4095
|
export declare enum Mode {
|
|
4096
|
+
/**
|
|
4097
|
+
* Always trigger retrieval.
|
|
4098
|
+
*/
|
|
3363
4099
|
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
4100
|
+
/**
|
|
4101
|
+
* Run retrieval only when system decides it is necessary.
|
|
4102
|
+
*/
|
|
3364
4103
|
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
3365
4104
|
}
|
|
3366
4105
|
|
|
@@ -3481,6 +4220,14 @@ export declare class Models extends BaseModule {
|
|
|
3481
4220
|
* ```
|
|
3482
4221
|
*/
|
|
3483
4222
|
generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
|
|
4223
|
+
/**
|
|
4224
|
+
* Transforms the CallableTools in the parameters to be simply Tools, it
|
|
4225
|
+
* copies the params into a new object and replaces the tools, it does not
|
|
4226
|
+
* modify the original params.
|
|
4227
|
+
*/
|
|
4228
|
+
private transformCallableTools;
|
|
4229
|
+
private initAfcToolsMap;
|
|
4230
|
+
private processAfcStream;
|
|
3484
4231
|
/**
|
|
3485
4232
|
* Generates an image based on a text description and configuration.
|
|
3486
4233
|
*
|
|
@@ -3698,6 +4445,30 @@ export declare interface ModelSelectionConfig {
|
|
|
3698
4445
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
3699
4446
|
}
|
|
3700
4447
|
|
|
4448
|
+
/** The configuration for the multi-speaker setup. */
|
|
4449
|
+
export declare interface MultiSpeakerVoiceConfig {
|
|
4450
|
+
/** The configuration for the speaker to use. */
|
|
4451
|
+
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
4452
|
+
}
|
|
4453
|
+
|
|
4454
|
+
/** The mode of music generation. */
|
|
4455
|
+
export declare enum MusicGenerationMode {
|
|
4456
|
+
/**
|
|
4457
|
+
* This value is unused.
|
|
4458
|
+
*/
|
|
4459
|
+
MUSIC_GENERATION_MODE_UNSPECIFIED = "MUSIC_GENERATION_MODE_UNSPECIFIED",
|
|
4460
|
+
/**
|
|
4461
|
+
* Steer text prompts to regions of latent space with higher quality
|
|
4462
|
+
music.
|
|
4463
|
+
*/
|
|
4464
|
+
QUALITY = "QUALITY",
|
|
4465
|
+
/**
|
|
4466
|
+
* Steer text prompts to regions of latent space with a larger diversity
|
|
4467
|
+
of music.
|
|
4468
|
+
*/
|
|
4469
|
+
DIVERSITY = "DIVERSITY"
|
|
4470
|
+
}
|
|
4471
|
+
|
|
3701
4472
|
/** A long-running operation. */
|
|
3702
4473
|
export declare interface Operation {
|
|
3703
4474
|
/** 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}`. */
|
|
@@ -3739,9 +4510,21 @@ export declare class Operations extends BaseModule {
|
|
|
3739
4510
|
*/
|
|
3740
4511
|
/** Required. Outcome of the code execution. */
|
|
3741
4512
|
export declare enum Outcome {
|
|
4513
|
+
/**
|
|
4514
|
+
* Unspecified status. This value should not be used.
|
|
4515
|
+
*/
|
|
3742
4516
|
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED",
|
|
4517
|
+
/**
|
|
4518
|
+
* Code execution completed successfully.
|
|
4519
|
+
*/
|
|
3743
4520
|
OUTCOME_OK = "OUTCOME_OK",
|
|
4521
|
+
/**
|
|
4522
|
+
* Code execution finished but with a failure. `stderr` should contain the reason.
|
|
4523
|
+
*/
|
|
3744
4524
|
OUTCOME_FAILED = "OUTCOME_FAILED",
|
|
4525
|
+
/**
|
|
4526
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
4527
|
+
*/
|
|
3745
4528
|
OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
|
|
3746
4529
|
}
|
|
3747
4530
|
|
|
@@ -3922,11 +4705,18 @@ export declare enum PersonGeneration {
|
|
|
3922
4705
|
|
|
3923
4706
|
/** The configuration for the prebuilt speaker to use. */
|
|
3924
4707
|
export declare interface PrebuiltVoiceConfig {
|
|
3925
|
-
/** The name of the prebuilt voice to use.
|
|
3926
|
-
*/
|
|
4708
|
+
/** The name of the prebuilt voice to use. */
|
|
3927
4709
|
voiceName?: string;
|
|
3928
4710
|
}
|
|
3929
4711
|
|
|
4712
|
+
/** Config for proactivity features. */
|
|
4713
|
+
export declare interface ProactivityConfig {
|
|
4714
|
+
/** If enabled, the model can reject responding to the last prompt. For
|
|
4715
|
+
example, this allows the model to ignore out of context speech or to stay
|
|
4716
|
+
silent if the user did not make a request, yet. */
|
|
4717
|
+
proactiveAudio?: boolean;
|
|
4718
|
+
}
|
|
4719
|
+
|
|
3930
4720
|
/** Specifies the context retrieval config. */
|
|
3931
4721
|
export declare interface RagRetrievalConfig {
|
|
3932
4722
|
/** Optional. Config for filters. */
|
|
@@ -4107,6 +4897,62 @@ export declare interface SafetySetting {
|
|
|
4107
4897
|
threshold?: HarmBlockThreshold;
|
|
4108
4898
|
}
|
|
4109
4899
|
|
|
4900
|
+
/** Scale of the generated music. */
|
|
4901
|
+
export declare enum Scale {
|
|
4902
|
+
/**
|
|
4903
|
+
* Default value. This value is unused.
|
|
4904
|
+
*/
|
|
4905
|
+
SCALE_UNSPECIFIED = "SCALE_UNSPECIFIED",
|
|
4906
|
+
/**
|
|
4907
|
+
* C major or A minor.
|
|
4908
|
+
*/
|
|
4909
|
+
C_MAJOR_A_MINOR = "C_MAJOR_A_MINOR",
|
|
4910
|
+
/**
|
|
4911
|
+
* Db major or Bb minor.
|
|
4912
|
+
*/
|
|
4913
|
+
D_FLAT_MAJOR_B_FLAT_MINOR = "D_FLAT_MAJOR_B_FLAT_MINOR",
|
|
4914
|
+
/**
|
|
4915
|
+
* D major or B minor.
|
|
4916
|
+
*/
|
|
4917
|
+
D_MAJOR_B_MINOR = "D_MAJOR_B_MINOR",
|
|
4918
|
+
/**
|
|
4919
|
+
* Eb major or C minor
|
|
4920
|
+
*/
|
|
4921
|
+
E_FLAT_MAJOR_C_MINOR = "E_FLAT_MAJOR_C_MINOR",
|
|
4922
|
+
/**
|
|
4923
|
+
* E major or Db minor.
|
|
4924
|
+
*/
|
|
4925
|
+
E_MAJOR_D_FLAT_MINOR = "E_MAJOR_D_FLAT_MINOR",
|
|
4926
|
+
/**
|
|
4927
|
+
* F major or D minor.
|
|
4928
|
+
*/
|
|
4929
|
+
F_MAJOR_D_MINOR = "F_MAJOR_D_MINOR",
|
|
4930
|
+
/**
|
|
4931
|
+
* Gb major or Eb minor.
|
|
4932
|
+
*/
|
|
4933
|
+
G_FLAT_MAJOR_E_FLAT_MINOR = "G_FLAT_MAJOR_E_FLAT_MINOR",
|
|
4934
|
+
/**
|
|
4935
|
+
* G major or E minor.
|
|
4936
|
+
*/
|
|
4937
|
+
G_MAJOR_E_MINOR = "G_MAJOR_E_MINOR",
|
|
4938
|
+
/**
|
|
4939
|
+
* Ab major or F minor.
|
|
4940
|
+
*/
|
|
4941
|
+
A_FLAT_MAJOR_F_MINOR = "A_FLAT_MAJOR_F_MINOR",
|
|
4942
|
+
/**
|
|
4943
|
+
* A major or Gb minor.
|
|
4944
|
+
*/
|
|
4945
|
+
A_MAJOR_G_FLAT_MINOR = "A_MAJOR_G_FLAT_MINOR",
|
|
4946
|
+
/**
|
|
4947
|
+
* Bb major or G minor.
|
|
4948
|
+
*/
|
|
4949
|
+
B_FLAT_MAJOR_G_MINOR = "B_FLAT_MAJOR_G_MINOR",
|
|
4950
|
+
/**
|
|
4951
|
+
* B major or Ab minor.
|
|
4952
|
+
*/
|
|
4953
|
+
B_MAJOR_A_FLAT_MINOR = "B_MAJOR_A_FLAT_MINOR"
|
|
4954
|
+
}
|
|
4955
|
+
|
|
4110
4956
|
/** 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. */
|
|
4111
4957
|
export declare interface Schema {
|
|
4112
4958
|
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
@@ -4155,7 +5001,7 @@ export declare interface Schema {
|
|
|
4155
5001
|
type?: Type;
|
|
4156
5002
|
}
|
|
4157
5003
|
|
|
4158
|
-
export declare type SchemaUnion = Schema;
|
|
5004
|
+
export declare type SchemaUnion = Schema | unknown;
|
|
4159
5005
|
|
|
4160
5006
|
/** Google search entry point. */
|
|
4161
5007
|
export declare interface SearchEntryPoint {
|
|
@@ -4371,11 +5217,24 @@ export declare interface SlidingWindow {
|
|
|
4371
5217
|
targetTokens?: string;
|
|
4372
5218
|
}
|
|
4373
5219
|
|
|
5220
|
+
/** The configuration for the speaker to use. */
|
|
5221
|
+
export declare interface SpeakerVoiceConfig {
|
|
5222
|
+
/** The name of the speaker to use. Should be the same as in the
|
|
5223
|
+
prompt. */
|
|
5224
|
+
speaker?: string;
|
|
5225
|
+
/** The configuration for the voice to use. */
|
|
5226
|
+
voiceConfig?: VoiceConfig;
|
|
5227
|
+
}
|
|
5228
|
+
|
|
4374
5229
|
/** The speech generation configuration. */
|
|
4375
5230
|
export declare interface SpeechConfig {
|
|
4376
5231
|
/** The configuration for the speaker to use.
|
|
4377
5232
|
*/
|
|
4378
5233
|
voiceConfig?: VoiceConfig;
|
|
5234
|
+
/** The configuration for the multi-speaker setup.
|
|
5235
|
+
It is mutually exclusive with the voice_config field.
|
|
5236
|
+
*/
|
|
5237
|
+
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
4379
5238
|
/** Language code (ISO 639. e.g. en-US) for the speech synthesization.
|
|
4380
5239
|
Only available for Live API.
|
|
4381
5240
|
*/
|
|
@@ -4386,8 +5245,17 @@ export declare type SpeechConfigUnion = SpeechConfig | string;
|
|
|
4386
5245
|
|
|
4387
5246
|
/** Start of speech sensitivity. */
|
|
4388
5247
|
export declare enum StartSensitivity {
|
|
5248
|
+
/**
|
|
5249
|
+
* The default is START_SENSITIVITY_LOW.
|
|
5250
|
+
*/
|
|
4389
5251
|
START_SENSITIVITY_UNSPECIFIED = "START_SENSITIVITY_UNSPECIFIED",
|
|
5252
|
+
/**
|
|
5253
|
+
* Automatic detection will detect the start of speech more often.
|
|
5254
|
+
*/
|
|
4390
5255
|
START_SENSITIVITY_HIGH = "START_SENSITIVITY_HIGH",
|
|
5256
|
+
/**
|
|
5257
|
+
* Automatic detection will detect the start of speech less often.
|
|
5258
|
+
*/
|
|
4391
5259
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
4392
5260
|
}
|
|
4393
5261
|
|
|
@@ -4582,6 +5450,8 @@ export declare interface TokensInfo {
|
|
|
4582
5450
|
|
|
4583
5451
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
4584
5452
|
export declare interface Tool {
|
|
5453
|
+
/** List of function declarations that the tool supports. */
|
|
5454
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
4585
5455
|
/** 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. */
|
|
4586
5456
|
retrieval?: Retrieval;
|
|
4587
5457
|
/** Optional. Google Search tool type. Specialized retrieval tool
|
|
@@ -4595,10 +5465,10 @@ export declare interface Tool {
|
|
|
4595
5465
|
/** Optional. Google Maps tool type. Specialized retrieval tool
|
|
4596
5466
|
that is powered by Google Maps. */
|
|
4597
5467
|
googleMaps?: GoogleMaps;
|
|
5468
|
+
/** Optional. Tool to support URL context retrieval. */
|
|
5469
|
+
urlContext?: UrlContext;
|
|
4598
5470
|
/** 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. */
|
|
4599
5471
|
codeExecution?: ToolCodeExecution;
|
|
4600
|
-
/** 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. */
|
|
4601
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
4602
5472
|
}
|
|
4603
5473
|
|
|
4604
5474
|
/** 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. */
|
|
@@ -4616,12 +5486,23 @@ export declare interface ToolConfig {
|
|
|
4616
5486
|
retrievalConfig?: RetrievalConfig;
|
|
4617
5487
|
}
|
|
4618
5488
|
|
|
4619
|
-
export declare type ToolListUnion =
|
|
5489
|
+
export declare type ToolListUnion = ToolUnion[];
|
|
5490
|
+
|
|
5491
|
+
export declare type ToolUnion = Tool | CallableTool;
|
|
4620
5492
|
|
|
4621
5493
|
/** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
|
|
4622
5494
|
export declare enum TrafficType {
|
|
5495
|
+
/**
|
|
5496
|
+
* Unspecified request traffic type.
|
|
5497
|
+
*/
|
|
4623
5498
|
TRAFFIC_TYPE_UNSPECIFIED = "TRAFFIC_TYPE_UNSPECIFIED",
|
|
5499
|
+
/**
|
|
5500
|
+
* Type for Pay-As-You-Go traffic.
|
|
5501
|
+
*/
|
|
4624
5502
|
ON_DEMAND = "ON_DEMAND",
|
|
5503
|
+
/**
|
|
5504
|
+
* Type for Provisioned Throughput traffic.
|
|
5505
|
+
*/
|
|
4625
5506
|
PROVISIONED_THROUGHPUT = "PROVISIONED_THROUGHPUT"
|
|
4626
5507
|
}
|
|
4627
5508
|
|
|
@@ -4784,19 +5665,49 @@ export declare interface TuningValidationDataset {
|
|
|
4784
5665
|
|
|
4785
5666
|
/** Options about which input is included in the user's turn. */
|
|
4786
5667
|
export declare enum TurnCoverage {
|
|
5668
|
+
/**
|
|
5669
|
+
* If unspecified, the default behavior is `TURN_INCLUDES_ONLY_ACTIVITY`.
|
|
5670
|
+
*/
|
|
4787
5671
|
TURN_COVERAGE_UNSPECIFIED = "TURN_COVERAGE_UNSPECIFIED",
|
|
5672
|
+
/**
|
|
5673
|
+
* The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior.
|
|
5674
|
+
*/
|
|
4788
5675
|
TURN_INCLUDES_ONLY_ACTIVITY = "TURN_INCLUDES_ONLY_ACTIVITY",
|
|
5676
|
+
/**
|
|
5677
|
+
* The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
|
|
5678
|
+
*/
|
|
4789
5679
|
TURN_INCLUDES_ALL_INPUT = "TURN_INCLUDES_ALL_INPUT"
|
|
4790
5680
|
}
|
|
4791
5681
|
|
|
4792
5682
|
/** Optional. The type of the data. */
|
|
4793
5683
|
export declare enum Type {
|
|
5684
|
+
/**
|
|
5685
|
+
* Not specified, should not be used.
|
|
5686
|
+
*/
|
|
4794
5687
|
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
5688
|
+
/**
|
|
5689
|
+
* OpenAPI string type
|
|
5690
|
+
*/
|
|
4795
5691
|
STRING = "STRING",
|
|
5692
|
+
/**
|
|
5693
|
+
* OpenAPI number type
|
|
5694
|
+
*/
|
|
4796
5695
|
NUMBER = "NUMBER",
|
|
5696
|
+
/**
|
|
5697
|
+
* OpenAPI integer type
|
|
5698
|
+
*/
|
|
4797
5699
|
INTEGER = "INTEGER",
|
|
5700
|
+
/**
|
|
5701
|
+
* OpenAPI boolean type
|
|
5702
|
+
*/
|
|
4798
5703
|
BOOLEAN = "BOOLEAN",
|
|
5704
|
+
/**
|
|
5705
|
+
* OpenAPI array type
|
|
5706
|
+
*/
|
|
4799
5707
|
ARRAY = "ARRAY",
|
|
5708
|
+
/**
|
|
5709
|
+
* OpenAPI object type
|
|
5710
|
+
*/
|
|
4800
5711
|
OBJECT = "OBJECT"
|
|
4801
5712
|
}
|
|
4802
5713
|
|
|
@@ -4816,9 +5727,9 @@ declare namespace types {
|
|
|
4816
5727
|
HarmCategory,
|
|
4817
5728
|
HarmBlockMethod,
|
|
4818
5729
|
HarmBlockThreshold,
|
|
5730
|
+
Type,
|
|
4819
5731
|
Mode,
|
|
4820
5732
|
AuthType,
|
|
4821
|
-
Type,
|
|
4822
5733
|
FinishReason,
|
|
4823
5734
|
HarmProbability,
|
|
4824
5735
|
HarmSeverity,
|
|
@@ -4829,8 +5740,10 @@ declare namespace types {
|
|
|
4829
5740
|
JobState,
|
|
4830
5741
|
AdapterSize,
|
|
4831
5742
|
FeatureSelectionPreference,
|
|
5743
|
+
Behavior,
|
|
4832
5744
|
DynamicRetrievalConfigMode,
|
|
4833
5745
|
FunctionCallingConfigMode,
|
|
5746
|
+
UrlRetrievalStatus,
|
|
4834
5747
|
SafetyFilterLevel,
|
|
4835
5748
|
PersonGeneration,
|
|
4836
5749
|
ImagePromptLanguage,
|
|
@@ -4845,8 +5758,12 @@ declare namespace types {
|
|
|
4845
5758
|
EndSensitivity,
|
|
4846
5759
|
ActivityHandling,
|
|
4847
5760
|
TurnCoverage,
|
|
4848
|
-
|
|
5761
|
+
FunctionResponseScheduling,
|
|
5762
|
+
Scale,
|
|
5763
|
+
MusicGenerationMode,
|
|
5764
|
+
LiveMusicPlaybackControl,
|
|
4849
5765
|
VideoMetadata,
|
|
5766
|
+
Blob_2 as Blob,
|
|
4850
5767
|
CodeExecutionResult,
|
|
4851
5768
|
ExecutableCode,
|
|
4852
5769
|
FileData,
|
|
@@ -4857,6 +5774,9 @@ declare namespace types {
|
|
|
4857
5774
|
HttpOptions,
|
|
4858
5775
|
ModelSelectionConfig,
|
|
4859
5776
|
SafetySetting,
|
|
5777
|
+
Schema,
|
|
5778
|
+
FunctionDeclaration,
|
|
5779
|
+
Interval,
|
|
4860
5780
|
GoogleSearch,
|
|
4861
5781
|
DynamicRetrievalConfig,
|
|
4862
5782
|
GoogleSearchRetrieval,
|
|
@@ -4868,6 +5788,7 @@ declare namespace types {
|
|
|
4868
5788
|
AuthConfigOidcConfig,
|
|
4869
5789
|
AuthConfig,
|
|
4870
5790
|
GoogleMaps,
|
|
5791
|
+
UrlContext,
|
|
4871
5792
|
VertexAISearch,
|
|
4872
5793
|
VertexRagStoreRagResource,
|
|
4873
5794
|
RagRetrievalConfigFilter,
|
|
@@ -4879,8 +5800,6 @@ declare namespace types {
|
|
|
4879
5800
|
VertexRagStore,
|
|
4880
5801
|
Retrieval,
|
|
4881
5802
|
ToolCodeExecution,
|
|
4882
|
-
Schema,
|
|
4883
|
-
FunctionDeclaration,
|
|
4884
5803
|
Tool,
|
|
4885
5804
|
FunctionCallingConfig,
|
|
4886
5805
|
LatLng,
|
|
@@ -4888,7 +5807,10 @@ declare namespace types {
|
|
|
4888
5807
|
ToolConfig,
|
|
4889
5808
|
PrebuiltVoiceConfig,
|
|
4890
5809
|
VoiceConfig,
|
|
5810
|
+
SpeakerVoiceConfig,
|
|
5811
|
+
MultiSpeakerVoiceConfig,
|
|
4891
5812
|
SpeechConfig,
|
|
5813
|
+
AutomaticFunctionCallingConfig,
|
|
4892
5814
|
ThinkingConfig,
|
|
4893
5815
|
GenerationConfigRoutingConfigAutoRoutingMode,
|
|
4894
5816
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
@@ -4898,6 +5820,8 @@ declare namespace types {
|
|
|
4898
5820
|
GoogleTypeDate,
|
|
4899
5821
|
Citation,
|
|
4900
5822
|
CitationMetadata,
|
|
5823
|
+
UrlMetadata,
|
|
5824
|
+
UrlContextMetadata,
|
|
4901
5825
|
GroundingChunkRetrievedContext,
|
|
4902
5826
|
GroundingChunkWeb,
|
|
4903
5827
|
GroundingChunk,
|
|
@@ -5016,7 +5940,6 @@ declare namespace types {
|
|
|
5016
5940
|
CreateFileParameters,
|
|
5017
5941
|
HttpResponse,
|
|
5018
5942
|
LiveCallbacks,
|
|
5019
|
-
UploadFileParameters,
|
|
5020
5943
|
CreateFileResponse,
|
|
5021
5944
|
GetFileConfig,
|
|
5022
5945
|
GetFileParameters,
|
|
@@ -5058,6 +5981,7 @@ declare namespace types {
|
|
|
5058
5981
|
SlidingWindow,
|
|
5059
5982
|
ContextWindowCompressionConfig,
|
|
5060
5983
|
AudioTranscriptionConfig,
|
|
5984
|
+
ProactivityConfig,
|
|
5061
5985
|
LiveClientSetup,
|
|
5062
5986
|
LiveClientContent,
|
|
5063
5987
|
ActivityStart,
|
|
@@ -5072,6 +5996,24 @@ declare namespace types {
|
|
|
5072
5996
|
SendMessageParameters,
|
|
5073
5997
|
LiveSendClientContentParameters,
|
|
5074
5998
|
LiveSendToolResponseParameters,
|
|
5999
|
+
LiveMusicClientSetup,
|
|
6000
|
+
WeightedPrompt,
|
|
6001
|
+
LiveMusicClientContent,
|
|
6002
|
+
LiveMusicGenerationConfig,
|
|
6003
|
+
LiveMusicClientMessage,
|
|
6004
|
+
LiveMusicServerSetupComplete,
|
|
6005
|
+
LiveMusicSourceMetadata,
|
|
6006
|
+
AudioChunk,
|
|
6007
|
+
LiveMusicServerContent,
|
|
6008
|
+
LiveMusicFilteredPrompt,
|
|
6009
|
+
LiveMusicServerMessage,
|
|
6010
|
+
LiveMusicCallbacks,
|
|
6011
|
+
UploadFileParameters,
|
|
6012
|
+
CallableTool,
|
|
6013
|
+
CallableToolConfig,
|
|
6014
|
+
LiveMusicConnectParameters,
|
|
6015
|
+
LiveMusicSetConfigParameters,
|
|
6016
|
+
LiveMusicSetClientContentParameters,
|
|
5075
6017
|
OperationGetParameters,
|
|
5076
6018
|
BlobImageUnion,
|
|
5077
6019
|
PartUnion,
|
|
@@ -5080,6 +6022,7 @@ declare namespace types {
|
|
|
5080
6022
|
ContentListUnion,
|
|
5081
6023
|
SchemaUnion,
|
|
5082
6024
|
SpeechConfigUnion,
|
|
6025
|
+
ToolUnion,
|
|
5083
6026
|
ToolListUnion,
|
|
5084
6027
|
DownloadableFileUnion
|
|
5085
6028
|
}
|
|
@@ -5226,6 +6169,40 @@ export declare class UpscaleImageResponse {
|
|
|
5226
6169
|
generatedImages?: GeneratedImage[];
|
|
5227
6170
|
}
|
|
5228
6171
|
|
|
6172
|
+
/** Tool to support URL context retrieval. */
|
|
6173
|
+
export declare interface UrlContext {
|
|
6174
|
+
}
|
|
6175
|
+
|
|
6176
|
+
/** Metadata related to url context retrieval tool. */
|
|
6177
|
+
export declare interface UrlContextMetadata {
|
|
6178
|
+
/** List of url context. */
|
|
6179
|
+
urlMetadata?: UrlMetadata[];
|
|
6180
|
+
}
|
|
6181
|
+
|
|
6182
|
+
/** Context for a single url retrieval. */
|
|
6183
|
+
export declare interface UrlMetadata {
|
|
6184
|
+
/** The URL retrieved by the tool. */
|
|
6185
|
+
retrievedUrl?: string;
|
|
6186
|
+
/** Status of the url retrieval. */
|
|
6187
|
+
urlRetrievalStatus?: UrlRetrievalStatus;
|
|
6188
|
+
}
|
|
6189
|
+
|
|
6190
|
+
/** Status of the url retrieval. */
|
|
6191
|
+
export declare enum UrlRetrievalStatus {
|
|
6192
|
+
/**
|
|
6193
|
+
* Default value. This value is unused
|
|
6194
|
+
*/
|
|
6195
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED = "URL_RETRIEVAL_STATUS_UNSPECIFIED",
|
|
6196
|
+
/**
|
|
6197
|
+
* Url retrieval is successful.
|
|
6198
|
+
*/
|
|
6199
|
+
URL_RETRIEVAL_STATUS_SUCCESS = "URL_RETRIEVAL_STATUS_SUCCESS",
|
|
6200
|
+
/**
|
|
6201
|
+
* Url retrieval is failed due to error.
|
|
6202
|
+
*/
|
|
6203
|
+
URL_RETRIEVAL_STATUS_ERROR = "URL_RETRIEVAL_STATUS_ERROR"
|
|
6204
|
+
}
|
|
6205
|
+
|
|
5229
6206
|
/** Usage metadata about response(s). */
|
|
5230
6207
|
export declare interface UsageMetadata {
|
|
5231
6208
|
/** 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. */
|
|
@@ -5293,8 +6270,11 @@ export declare interface Video {
|
|
|
5293
6270
|
mimeType?: string;
|
|
5294
6271
|
}
|
|
5295
6272
|
|
|
5296
|
-
/**
|
|
6273
|
+
/** Describes how the video in the Part should be used by the model. */
|
|
5297
6274
|
export declare interface VideoMetadata {
|
|
6275
|
+
/** The frame rate of the video sent to the model. If not specified, the
|
|
6276
|
+
default value will be 1.0. The fps range is (0.0, 24.0]. */
|
|
6277
|
+
fps?: number;
|
|
5298
6278
|
/** Optional. The end offset of the video. */
|
|
5299
6279
|
endOffset?: string;
|
|
5300
6280
|
/** Optional. The start offset of the video. */
|
|
@@ -5342,4 +6322,17 @@ declare interface WebSocketFactory {
|
|
|
5342
6322
|
create(url: string, headers: Record<string, string>, callbacks: WebSocketCallbacks): WebSocket_2;
|
|
5343
6323
|
}
|
|
5344
6324
|
|
|
6325
|
+
/** Maps a prompt to a relative weight to steer music generation. */
|
|
6326
|
+
export declare interface WeightedPrompt {
|
|
6327
|
+
/** Text prompt. */
|
|
6328
|
+
text?: string;
|
|
6329
|
+
/** Weight of the prompt. The weight is used to control the relative
|
|
6330
|
+
importance of the prompt. Higher weights are more important than lower
|
|
6331
|
+
weights.
|
|
6332
|
+
|
|
6333
|
+
Weight must not be 0. Weights of all weighted_prompts in this
|
|
6334
|
+
LiveMusicClientContent message will be normalized. */
|
|
6335
|
+
weight?: number;
|
|
6336
|
+
}
|
|
6337
|
+
|
|
5345
6338
|
export { }
|