@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/index.cjs
CHANGED
|
@@ -560,7 +560,7 @@ exports.Modality = void 0;
|
|
|
560
560
|
*/
|
|
561
561
|
Modality["IMAGE"] = "IMAGE";
|
|
562
562
|
/**
|
|
563
|
-
* Indicates the model should return
|
|
563
|
+
* Indicates the model should return audio.
|
|
564
564
|
*/
|
|
565
565
|
Modality["AUDIO"] = "AUDIO";
|
|
566
566
|
})(exports.Modality || (exports.Modality = {}));
|
|
@@ -984,24 +984,6 @@ exports.Scale = void 0;
|
|
|
984
984
|
*/
|
|
985
985
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
986
986
|
})(exports.Scale || (exports.Scale = {}));
|
|
987
|
-
/** The mode of music generation. */
|
|
988
|
-
exports.MusicGenerationMode = void 0;
|
|
989
|
-
(function (MusicGenerationMode) {
|
|
990
|
-
/**
|
|
991
|
-
* This value is unused.
|
|
992
|
-
*/
|
|
993
|
-
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
994
|
-
/**
|
|
995
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
996
|
-
music.
|
|
997
|
-
*/
|
|
998
|
-
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
999
|
-
/**
|
|
1000
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
1001
|
-
of music.
|
|
1002
|
-
*/
|
|
1003
|
-
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
1004
|
-
})(exports.MusicGenerationMode || (exports.MusicGenerationMode = {}));
|
|
1005
987
|
/** The playback control signal to apply to the music generation. */
|
|
1006
988
|
exports.LiveMusicPlaybackControl = void 0;
|
|
1007
989
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -6136,12 +6118,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
|
|
|
6136
6118
|
if (fromOnlyBassAndDrums != null) {
|
|
6137
6119
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
6138
6120
|
}
|
|
6139
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
6140
|
-
'musicGenerationMode',
|
|
6141
|
-
]);
|
|
6142
|
-
if (fromMusicGenerationMode != null) {
|
|
6143
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
6144
|
-
}
|
|
6145
6121
|
return toObject;
|
|
6146
6122
|
}
|
|
6147
6123
|
function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
|
|
@@ -7066,12 +7042,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
|
|
|
7066
7042
|
if (fromOnlyBassAndDrums != null) {
|
|
7067
7043
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7068
7044
|
}
|
|
7069
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7070
|
-
'musicGenerationMode',
|
|
7071
|
-
]);
|
|
7072
|
-
if (fromMusicGenerationMode != null) {
|
|
7073
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7074
|
-
}
|
|
7075
7045
|
return toObject;
|
|
7076
7046
|
}
|
|
7077
7047
|
function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
|
|
@@ -8123,6 +8093,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8123
8093
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
8124
8094
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
8125
8095
|
}
|
|
8096
|
+
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8097
|
+
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
8098
|
+
}
|
|
8126
8099
|
return toObject;
|
|
8127
8100
|
}
|
|
8128
8101
|
function generateVideosParametersToMldev(apiClient, fromObject) {
|
|
@@ -9462,6 +9435,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
9462
9435
|
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
9463
9436
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
9464
9437
|
}
|
|
9438
|
+
const fromGenerateAudio = getValueByPath(fromObject, [
|
|
9439
|
+
'generateAudio',
|
|
9440
|
+
]);
|
|
9441
|
+
if (parentObject !== undefined && fromGenerateAudio != null) {
|
|
9442
|
+
setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
|
|
9443
|
+
}
|
|
9465
9444
|
return toObject;
|
|
9466
9445
|
}
|
|
9467
9446
|
function generateVideosParametersToVertex(apiClient, fromObject) {
|
|
@@ -10604,7 +10583,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10604
10583
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10605
10584
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10606
10585
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10607
|
-
const SDK_VERSION = '1.
|
|
10586
|
+
const SDK_VERSION = '1.2.0'; // x-release-please-version
|
|
10608
10587
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10609
10588
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10610
10589
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11140,9 +11119,6 @@ function hasMcpToolUsage(tools) {
|
|
|
11140
11119
|
function setMcpUsageHeader(headers) {
|
|
11141
11120
|
var _a;
|
|
11142
11121
|
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
11143
|
-
if (existingHeader.includes(MCP_LABEL)) {
|
|
11144
|
-
return;
|
|
11145
|
-
}
|
|
11146
11122
|
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
11147
11123
|
}
|
|
11148
11124
|
// Checks whether the list of tools contains any MCP clients. Will return true
|
package/dist/node/index.mjs
CHANGED
|
@@ -538,7 +538,7 @@ var Modality;
|
|
|
538
538
|
*/
|
|
539
539
|
Modality["IMAGE"] = "IMAGE";
|
|
540
540
|
/**
|
|
541
|
-
* Indicates the model should return
|
|
541
|
+
* Indicates the model should return audio.
|
|
542
542
|
*/
|
|
543
543
|
Modality["AUDIO"] = "AUDIO";
|
|
544
544
|
})(Modality || (Modality = {}));
|
|
@@ -962,24 +962,6 @@ var Scale;
|
|
|
962
962
|
*/
|
|
963
963
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
964
964
|
})(Scale || (Scale = {}));
|
|
965
|
-
/** The mode of music generation. */
|
|
966
|
-
var MusicGenerationMode;
|
|
967
|
-
(function (MusicGenerationMode) {
|
|
968
|
-
/**
|
|
969
|
-
* This value is unused.
|
|
970
|
-
*/
|
|
971
|
-
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
972
|
-
/**
|
|
973
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
974
|
-
music.
|
|
975
|
-
*/
|
|
976
|
-
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
977
|
-
/**
|
|
978
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
979
|
-
of music.
|
|
980
|
-
*/
|
|
981
|
-
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
982
|
-
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
983
965
|
/** The playback control signal to apply to the music generation. */
|
|
984
966
|
var LiveMusicPlaybackControl;
|
|
985
967
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -6114,12 +6096,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
|
|
|
6114
6096
|
if (fromOnlyBassAndDrums != null) {
|
|
6115
6097
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
6116
6098
|
}
|
|
6117
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
6118
|
-
'musicGenerationMode',
|
|
6119
|
-
]);
|
|
6120
|
-
if (fromMusicGenerationMode != null) {
|
|
6121
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
6122
|
-
}
|
|
6123
6099
|
return toObject;
|
|
6124
6100
|
}
|
|
6125
6101
|
function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
|
|
@@ -7044,12 +7020,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
|
|
|
7044
7020
|
if (fromOnlyBassAndDrums != null) {
|
|
7045
7021
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7046
7022
|
}
|
|
7047
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7048
|
-
'musicGenerationMode',
|
|
7049
|
-
]);
|
|
7050
|
-
if (fromMusicGenerationMode != null) {
|
|
7051
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7052
|
-
}
|
|
7053
7023
|
return toObject;
|
|
7054
7024
|
}
|
|
7055
7025
|
function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
|
|
@@ -8101,6 +8071,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8101
8071
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
8102
8072
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
8103
8073
|
}
|
|
8074
|
+
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8075
|
+
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
8076
|
+
}
|
|
8104
8077
|
return toObject;
|
|
8105
8078
|
}
|
|
8106
8079
|
function generateVideosParametersToMldev(apiClient, fromObject) {
|
|
@@ -9440,6 +9413,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
9440
9413
|
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
9441
9414
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
9442
9415
|
}
|
|
9416
|
+
const fromGenerateAudio = getValueByPath(fromObject, [
|
|
9417
|
+
'generateAudio',
|
|
9418
|
+
]);
|
|
9419
|
+
if (parentObject !== undefined && fromGenerateAudio != null) {
|
|
9420
|
+
setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
|
|
9421
|
+
}
|
|
9443
9422
|
return toObject;
|
|
9444
9423
|
}
|
|
9445
9424
|
function generateVideosParametersToVertex(apiClient, fromObject) {
|
|
@@ -10582,7 +10561,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10582
10561
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10583
10562
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10584
10563
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10585
|
-
const SDK_VERSION = '1.
|
|
10564
|
+
const SDK_VERSION = '1.2.0'; // x-release-please-version
|
|
10586
10565
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10587
10566
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10588
10567
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11118,9 +11097,6 @@ function hasMcpToolUsage(tools) {
|
|
|
11118
11097
|
function setMcpUsageHeader(headers) {
|
|
11119
11098
|
var _a;
|
|
11120
11099
|
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
11121
|
-
if (existingHeader.includes(MCP_LABEL)) {
|
|
11122
|
-
return;
|
|
11123
|
-
}
|
|
11124
11100
|
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
11125
11101
|
}
|
|
11126
11102
|
// Checks whether the list of tools contains any MCP clients. Will return true
|
|
@@ -14918,5 +14894,5 @@ function stringToBoolean(str) {
|
|
|
14918
14894
|
return str.toLowerCase() === 'true';
|
|
14919
14895
|
}
|
|
14920
14896
|
|
|
14921
|
-
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,
|
|
14897
|
+
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 };
|
|
14922
14898
|
//# sourceMappingURL=index.mjs.map
|