@google/genai 1.1.0 → 1.2.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 +1 -1
- package/dist/genai.d.ts +3 -22
- package/dist/index.cjs +11 -35
- package/dist/index.mjs +12 -36
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +11 -35
- package/dist/node/index.mjs +12 -36
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +3 -22
- package/dist/web/index.mjs +12 -36
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +3 -22
- package/package.json +1 -1
package/dist/node/node.d.ts
CHANGED
|
@@ -2408,6 +2408,8 @@ export declare interface GenerateVideosConfig {
|
|
|
2408
2408
|
negativePrompt?: string;
|
|
2409
2409
|
/** Whether to use the prompt rewriting logic. */
|
|
2410
2410
|
enhancePrompt?: boolean;
|
|
2411
|
+
/** Whether to generate audio along with the video. */
|
|
2412
|
+
generateAudio?: boolean;
|
|
2411
2413
|
}
|
|
2412
2414
|
|
|
2413
2415
|
/** A video generation operation. */
|
|
@@ -3707,8 +3709,6 @@ export declare interface LiveMusicGenerationConfig {
|
|
|
3707
3709
|
muteDrums?: boolean;
|
|
3708
3710
|
/** Whether the audio output should contain only bass and drums. */
|
|
3709
3711
|
onlyBassAndDrums?: boolean;
|
|
3710
|
-
/** The mode of music generation. Default mode is QUALITY. */
|
|
3711
|
-
musicGenerationMode?: MusicGenerationMode;
|
|
3712
3712
|
}
|
|
3713
3713
|
|
|
3714
3714
|
/** The playback control signal to apply to the music generation. */
|
|
@@ -4158,7 +4158,7 @@ export declare enum Modality {
|
|
|
4158
4158
|
*/
|
|
4159
4159
|
IMAGE = "IMAGE",
|
|
4160
4160
|
/**
|
|
4161
|
-
* Indicates the model should return
|
|
4161
|
+
* Indicates the model should return audio.
|
|
4162
4162
|
*/
|
|
4163
4163
|
AUDIO = "AUDIO"
|
|
4164
4164
|
}
|
|
@@ -4532,24 +4532,6 @@ export declare interface MultiSpeakerVoiceConfig {
|
|
|
4532
4532
|
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
4533
4533
|
}
|
|
4534
4534
|
|
|
4535
|
-
/** The mode of music generation. */
|
|
4536
|
-
export declare enum MusicGenerationMode {
|
|
4537
|
-
/**
|
|
4538
|
-
* This value is unused.
|
|
4539
|
-
*/
|
|
4540
|
-
MUSIC_GENERATION_MODE_UNSPECIFIED = "MUSIC_GENERATION_MODE_UNSPECIFIED",
|
|
4541
|
-
/**
|
|
4542
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
4543
|
-
music.
|
|
4544
|
-
*/
|
|
4545
|
-
QUALITY = "QUALITY",
|
|
4546
|
-
/**
|
|
4547
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
4548
|
-
of music.
|
|
4549
|
-
*/
|
|
4550
|
-
DIVERSITY = "DIVERSITY"
|
|
4551
|
-
}
|
|
4552
|
-
|
|
4553
4535
|
/** A long-running operation. */
|
|
4554
4536
|
export declare interface Operation {
|
|
4555
4537
|
/** 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}`. */
|
|
@@ -5872,7 +5854,6 @@ declare namespace types {
|
|
|
5872
5854
|
TurnCoverage,
|
|
5873
5855
|
FunctionResponseScheduling,
|
|
5874
5856
|
Scale,
|
|
5875
|
-
MusicGenerationMode,
|
|
5876
5857
|
LiveMusicPlaybackControl,
|
|
5877
5858
|
VideoMetadata,
|
|
5878
5859
|
Blob_2 as Blob,
|
package/dist/web/index.mjs
CHANGED
|
@@ -533,7 +533,7 @@ var Modality;
|
|
|
533
533
|
*/
|
|
534
534
|
Modality["IMAGE"] = "IMAGE";
|
|
535
535
|
/**
|
|
536
|
-
* Indicates the model should return
|
|
536
|
+
* Indicates the model should return audio.
|
|
537
537
|
*/
|
|
538
538
|
Modality["AUDIO"] = "AUDIO";
|
|
539
539
|
})(Modality || (Modality = {}));
|
|
@@ -957,24 +957,6 @@ var Scale;
|
|
|
957
957
|
*/
|
|
958
958
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
959
959
|
})(Scale || (Scale = {}));
|
|
960
|
-
/** The mode of music generation. */
|
|
961
|
-
var MusicGenerationMode;
|
|
962
|
-
(function (MusicGenerationMode) {
|
|
963
|
-
/**
|
|
964
|
-
* This value is unused.
|
|
965
|
-
*/
|
|
966
|
-
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
967
|
-
/**
|
|
968
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
969
|
-
music.
|
|
970
|
-
*/
|
|
971
|
-
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
972
|
-
/**
|
|
973
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
974
|
-
of music.
|
|
975
|
-
*/
|
|
976
|
-
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
977
|
-
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
978
960
|
/** The playback control signal to apply to the music generation. */
|
|
979
961
|
var LiveMusicPlaybackControl;
|
|
980
962
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -6109,12 +6091,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
|
|
|
6109
6091
|
if (fromOnlyBassAndDrums != null) {
|
|
6110
6092
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
6111
6093
|
}
|
|
6112
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
6113
|
-
'musicGenerationMode',
|
|
6114
|
-
]);
|
|
6115
|
-
if (fromMusicGenerationMode != null) {
|
|
6116
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
6117
|
-
}
|
|
6118
6094
|
return toObject;
|
|
6119
6095
|
}
|
|
6120
6096
|
function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
|
|
@@ -7039,12 +7015,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
|
|
|
7039
7015
|
if (fromOnlyBassAndDrums != null) {
|
|
7040
7016
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7041
7017
|
}
|
|
7042
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7043
|
-
'musicGenerationMode',
|
|
7044
|
-
]);
|
|
7045
|
-
if (fromMusicGenerationMode != null) {
|
|
7046
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7047
|
-
}
|
|
7048
7018
|
return toObject;
|
|
7049
7019
|
}
|
|
7050
7020
|
function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
|
|
@@ -8096,6 +8066,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8096
8066
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
8097
8067
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
8098
8068
|
}
|
|
8069
|
+
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8070
|
+
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
8071
|
+
}
|
|
8099
8072
|
return toObject;
|
|
8100
8073
|
}
|
|
8101
8074
|
function generateVideosParametersToMldev(apiClient, fromObject) {
|
|
@@ -9435,6 +9408,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
9435
9408
|
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
9436
9409
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
9437
9410
|
}
|
|
9411
|
+
const fromGenerateAudio = getValueByPath(fromObject, [
|
|
9412
|
+
'generateAudio',
|
|
9413
|
+
]);
|
|
9414
|
+
if (parentObject !== undefined && fromGenerateAudio != null) {
|
|
9415
|
+
setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
|
|
9416
|
+
}
|
|
9438
9417
|
return toObject;
|
|
9439
9418
|
}
|
|
9440
9419
|
function generateVideosParametersToVertex(apiClient, fromObject) {
|
|
@@ -10577,7 +10556,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10577
10556
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10578
10557
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10579
10558
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10580
|
-
const SDK_VERSION = '1.
|
|
10559
|
+
const SDK_VERSION = '1.2.0'; // x-release-please-version
|
|
10581
10560
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10582
10561
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10583
10562
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11113,9 +11092,6 @@ function hasMcpToolUsage(tools) {
|
|
|
11113
11092
|
function setMcpUsageHeader(headers) {
|
|
11114
11093
|
var _a;
|
|
11115
11094
|
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
11116
|
-
if (existingHeader.includes(MCP_LABEL)) {
|
|
11117
|
-
return;
|
|
11118
|
-
}
|
|
11119
11095
|
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
11120
11096
|
}
|
|
11121
11097
|
// Checks whether the list of tools contains any MCP clients. Will return true
|
|
@@ -14594,5 +14570,5 @@ class GoogleGenAI {
|
|
|
14594
14570
|
}
|
|
14595
14571
|
}
|
|
14596
14572
|
|
|
14597
|
-
export { ActivityHandling, AdapterSize, AuthType, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, JobState, Language, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models,
|
|
14573
|
+
export { ActivityHandling, AdapterSize, AuthType, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, JobState, Language, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
14598
14574
|
//# sourceMappingURL=index.mjs.map
|