Skip to content

Commit 26c397c

Browse files
Merge branch 'main' into fix-files-upload-content-length
2 parents a94e72d + 31223a3 commit 26c397c

22 files changed

Lines changed: 509 additions & 50 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.9.0"
2+
".": "2.10.0"
33
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33

44

5+
## [2.10.0](https://github.com/googleapis/js-genai/compare/v2.9.0...v2.10.0) (2026-06-24)
6+
7+
8+
### Features
9+
10+
* [Interactions] Add ComputerUse.disabled_safety_policies ([a2ca95c](https://github.com/googleapis/js-genai/commit/a2ca95cb81230ac371864914d2ad655c3f83c7bb))
11+
* [Models] Add ComputerUse.disabled_safety_policies ([3618023](https://github.com/googleapis/js-genai/commit/3618023147fe8ba63a9ecfa00253ab489e74aba8))
12+
* add usage fields for steps ([048db9a](https://github.com/googleapis/js-genai/commit/048db9a660d6cb7107212baab64e694db8498dfc))
13+
* add video generation and response format parameters. ([84e795c](https://github.com/googleapis/js-genai/commit/84e795cf4add4ca9dffe47828d6528e19d684d54))
14+
515
## [2.9.0](https://github.com/googleapis/js-genai/compare/v2.8.0...v2.9.0) (2026-06-19)
616

717

api-report/genai-node.api.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ export interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
507507

508508
// @public
509509
export interface ComputerUse {
510+
disabledSafetyPolicies?: SafetyPolicy[];
510511
enablePromptInjectionDetection?: boolean;
511512
environment?: Environment;
512513
excludedPredefinedFunctions?: string[];
@@ -2594,7 +2595,15 @@ export namespace Interactions {
25942595
// Warning: (ae-forgotten-export) The symbol "ModelOutputStep$" needs to be exported by the entry point index.d.ts
25952596
//
25962597
// (undocumented)
2597-
export type ModelOutputStep = ModelOutputStep$;
2598+
export interface ModelOutputStep extends ModelOutputStep$ {
2599+
}
2600+
// (undocumented)
2601+
export namespace ModelOutputStep {
2602+
// Warning: (ae-forgotten-export) The symbol "Error$2" needs to be exported by the entry point index.d.ts
2603+
//
2604+
// (undocumented)
2605+
export type Error = Error$2;
2606+
}
25982607
// Warning: (ae-forgotten-export) The symbol "PlaceCitation$" needs to be exported by the entry point index.d.ts
25992608
//
26002609
// (undocumented)
@@ -2878,10 +2887,18 @@ export namespace Interactions {
28782887
//
28792888
// (undocumented)
28802889
export type UserInputStep = UserInputStep$;
2890+
// Warning: (ae-forgotten-export) The symbol "VideoConfig$" needs to be exported by the entry point index.d.ts
2891+
//
2892+
// (undocumented)
2893+
export type VideoConfig = VideoConfig$;
28812894
// Warning: (ae-forgotten-export) The symbol "VideoContent$" needs to be exported by the entry point index.d.ts
28822895
//
28832896
// (undocumented)
28842897
export type VideoContent = VideoContent$;
2898+
// Warning: (ae-forgotten-export) The symbol "VideoResponseFormat$" needs to be exported by the entry point index.d.ts
2899+
//
2900+
// (undocumented)
2901+
export type VideoResponseFormat = VideoResponseFormat$;
28852902
// Warning: (ae-forgotten-export) The symbol "WebhookConfig$" needs to be exported by the entry point index.d.ts
28862903
//
28872904
// (undocumented)
@@ -4165,6 +4182,18 @@ export enum SafetyFilterLevel {
41654182
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH"
41664183
}
41674184

4185+
// @public
4186+
export enum SafetyPolicy {
4187+
ACCOUNT_CREATION = "ACCOUNT_CREATION",
4188+
COMMUNICATION_TOOL = "COMMUNICATION_TOOL",
4189+
DATA_MODIFICATION = "DATA_MODIFICATION",
4190+
FINANCIAL_TRANSACTIONS = "FINANCIAL_TRANSACTIONS",
4191+
LEGAL_TERMS_AND_AGREEMENTS = "LEGAL_TERMS_AND_AGREEMENTS",
4192+
SAFETY_POLICY_UNSPECIFIED = "SAFETY_POLICY_UNSPECIFIED",
4193+
SENSITIVE_DATA_MODIFICATION = "SENSITIVE_DATA_MODIFICATION",
4194+
USER_CONSENT_MANAGEMENT = "USER_CONSENT_MANAGEMENT"
4195+
}
4196+
41684197
// @public
41694198
export interface SafetyRating {
41704199
blocked?: boolean;

api-report/genai-web.api.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ export interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
507507

508508
// @public
509509
export interface ComputerUse {
510+
disabledSafetyPolicies?: SafetyPolicy[];
510511
enablePromptInjectionDetection?: boolean;
511512
environment?: Environment;
512513
excludedPredefinedFunctions?: string[];
@@ -2594,7 +2595,15 @@ export namespace Interactions {
25942595
// Warning: (ae-forgotten-export) The symbol "ModelOutputStep$" needs to be exported by the entry point index.d.ts
25952596
//
25962597
// (undocumented)
2597-
export type ModelOutputStep = ModelOutputStep$;
2598+
export interface ModelOutputStep extends ModelOutputStep$ {
2599+
}
2600+
// (undocumented)
2601+
export namespace ModelOutputStep {
2602+
// Warning: (ae-forgotten-export) The symbol "Error$2" needs to be exported by the entry point index.d.ts
2603+
//
2604+
// (undocumented)
2605+
export type Error = Error$2;
2606+
}
25982607
// Warning: (ae-forgotten-export) The symbol "PlaceCitation$" needs to be exported by the entry point index.d.ts
25992608
//
26002609
// (undocumented)
@@ -2878,10 +2887,18 @@ export namespace Interactions {
28782887
//
28792888
// (undocumented)
28802889
export type UserInputStep = UserInputStep$;
2890+
// Warning: (ae-forgotten-export) The symbol "VideoConfig$" needs to be exported by the entry point index.d.ts
2891+
//
2892+
// (undocumented)
2893+
export type VideoConfig = VideoConfig$;
28812894
// Warning: (ae-forgotten-export) The symbol "VideoContent$" needs to be exported by the entry point index.d.ts
28822895
//
28832896
// (undocumented)
28842897
export type VideoContent = VideoContent$;
2898+
// Warning: (ae-forgotten-export) The symbol "VideoResponseFormat$" needs to be exported by the entry point index.d.ts
2899+
//
2900+
// (undocumented)
2901+
export type VideoResponseFormat = VideoResponseFormat$;
28852902
// Warning: (ae-forgotten-export) The symbol "WebhookConfig$" needs to be exported by the entry point index.d.ts
28862903
//
28872904
// (undocumented)
@@ -4165,6 +4182,18 @@ export enum SafetyFilterLevel {
41654182
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH"
41664183
}
41674184

4185+
// @public
4186+
export enum SafetyPolicy {
4187+
ACCOUNT_CREATION = "ACCOUNT_CREATION",
4188+
COMMUNICATION_TOOL = "COMMUNICATION_TOOL",
4189+
DATA_MODIFICATION = "DATA_MODIFICATION",
4190+
FINANCIAL_TRANSACTIONS = "FINANCIAL_TRANSACTIONS",
4191+
LEGAL_TERMS_AND_AGREEMENTS = "LEGAL_TERMS_AND_AGREEMENTS",
4192+
SAFETY_POLICY_UNSPECIFIED = "SAFETY_POLICY_UNSPECIFIED",
4193+
SENSITIVE_DATA_MODIFICATION = "SENSITIVE_DATA_MODIFICATION",
4194+
USER_CONSENT_MANAGEMENT = "USER_CONSENT_MANAGEMENT"
4195+
}
4196+
41684197
// @public
41694198
export interface SafetyRating {
41704199
blocked?: boolean;

api-report/genai.api.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ export interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
507507

508508
// @public
509509
export interface ComputerUse {
510+
disabledSafetyPolicies?: SafetyPolicy[];
510511
enablePromptInjectionDetection?: boolean;
511512
environment?: Environment;
512513
excludedPredefinedFunctions?: string[];
@@ -2594,7 +2595,15 @@ export namespace Interactions {
25942595
// Warning: (ae-forgotten-export) The symbol "ModelOutputStep$" needs to be exported by the entry point index.d.ts
25952596
//
25962597
// (undocumented)
2597-
export type ModelOutputStep = ModelOutputStep$;
2598+
export interface ModelOutputStep extends ModelOutputStep$ {
2599+
}
2600+
// (undocumented)
2601+
export namespace ModelOutputStep {
2602+
// Warning: (ae-forgotten-export) The symbol "Error$2" needs to be exported by the entry point index.d.ts
2603+
//
2604+
// (undocumented)
2605+
export type Error = Error$2;
2606+
}
25982607
// Warning: (ae-forgotten-export) The symbol "PlaceCitation$" needs to be exported by the entry point index.d.ts
25992608
//
26002609
// (undocumented)
@@ -2878,10 +2887,18 @@ export namespace Interactions {
28782887
//
28792888
// (undocumented)
28802889
export type UserInputStep = UserInputStep$;
2890+
// Warning: (ae-forgotten-export) The symbol "VideoConfig$" needs to be exported by the entry point index.d.ts
2891+
//
2892+
// (undocumented)
2893+
export type VideoConfig = VideoConfig$;
28812894
// Warning: (ae-forgotten-export) The symbol "VideoContent$" needs to be exported by the entry point index.d.ts
28822895
//
28832896
// (undocumented)
28842897
export type VideoContent = VideoContent$;
2898+
// Warning: (ae-forgotten-export) The symbol "VideoResponseFormat$" needs to be exported by the entry point index.d.ts
2899+
//
2900+
// (undocumented)
2901+
export type VideoResponseFormat = VideoResponseFormat$;
28852902
// Warning: (ae-forgotten-export) The symbol "WebhookConfig$" needs to be exported by the entry point index.d.ts
28862903
//
28872904
// (undocumented)
@@ -4165,6 +4182,18 @@ export enum SafetyFilterLevel {
41654182
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH"
41664183
}
41674184

4185+
// @public
4186+
export enum SafetyPolicy {
4187+
ACCOUNT_CREATION = "ACCOUNT_CREATION",
4188+
COMMUNICATION_TOOL = "COMMUNICATION_TOOL",
4189+
DATA_MODIFICATION = "DATA_MODIFICATION",
4190+
FINANCIAL_TRANSACTIONS = "FINANCIAL_TRANSACTIONS",
4191+
LEGAL_TERMS_AND_AGREEMENTS = "LEGAL_TERMS_AND_AGREEMENTS",
4192+
SAFETY_POLICY_UNSPECIFIED = "SAFETY_POLICY_UNSPECIFIED",
4193+
SENSITIVE_DATA_MODIFICATION = "SENSITIVE_DATA_MODIFICATION",
4194+
USER_CONSENT_MANAGEMENT = "USER_CONSENT_MANAGEMENT"
4195+
}
4196+
41684197
// @public
41694198
export interface SafetyRating {
41704199
blocked?: boolean;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@google/genai",
3-
"version": "2.9.0",
3+
"version": "2.10.0",
44
"description": "",
55
"type": "module",
66
"main": "dist/node/index.mjs",

src/_api_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
1717
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
1818
const USER_AGENT_HEADER = 'User-Agent';
1919
export const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
20-
export const SDK_VERSION = '2.9.0'; // x-release-please-version
20+
export const SDK_VERSION = '2.10.0'; // x-release-please-version
2121
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
2222
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
2323
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';

src/converters/_caches_converters.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,49 @@ export function codeExecutionResultToVertex(
111111
return toObject;
112112
}
113113

114+
export function computerUseToVertex(
115+
fromObject: types.ComputerUse,
116+
): Record<string, unknown> {
117+
const toObject: Record<string, unknown> = {};
118+
119+
const fromEnvironment = common.getValueByPath(fromObject, ['environment']);
120+
if (fromEnvironment != null) {
121+
common.setValueByPath(toObject, ['environment'], fromEnvironment);
122+
}
123+
124+
const fromExcludedPredefinedFunctions = common.getValueByPath(fromObject, [
125+
'excludedPredefinedFunctions',
126+
]);
127+
if (fromExcludedPredefinedFunctions != null) {
128+
common.setValueByPath(
129+
toObject,
130+
['excludedPredefinedFunctions'],
131+
fromExcludedPredefinedFunctions,
132+
);
133+
}
134+
135+
const fromEnablePromptInjectionDetection = common.getValueByPath(fromObject, [
136+
'enablePromptInjectionDetection',
137+
]);
138+
if (fromEnablePromptInjectionDetection != null) {
139+
common.setValueByPath(
140+
toObject,
141+
['enablePromptInjectionDetection'],
142+
fromEnablePromptInjectionDetection,
143+
);
144+
}
145+
146+
if (
147+
common.getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined
148+
) {
149+
throw new Error(
150+
'disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.',
151+
);
152+
}
153+
154+
return toObject;
155+
}
156+
114157
export function contentToMldev(
115158
fromObject: types.Content,
116159
): Record<string, unknown> {
@@ -1167,7 +1210,11 @@ export function toolToVertex(fromObject: types.Tool): Record<string, unknown> {
11671210

11681211
const fromComputerUse = common.getValueByPath(fromObject, ['computerUse']);
11691212
if (fromComputerUse != null) {
1170-
common.setValueByPath(toObject, ['computerUse'], fromComputerUse);
1213+
common.setValueByPath(
1214+
toObject,
1215+
['computerUse'],
1216+
computerUseToVertex(fromComputerUse),
1217+
);
11711218
}
11721219

11731220
if (common.getValueByPath(fromObject, ['fileSearch']) !== undefined) {

src/converters/_live_converters.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,49 @@ export function codeExecutionResultToVertex(
148148
return toObject;
149149
}
150150

151+
export function computerUseToVertex(
152+
fromObject: types.ComputerUse,
153+
): Record<string, unknown> {
154+
const toObject: Record<string, unknown> = {};
155+
156+
const fromEnvironment = common.getValueByPath(fromObject, ['environment']);
157+
if (fromEnvironment != null) {
158+
common.setValueByPath(toObject, ['environment'], fromEnvironment);
159+
}
160+
161+
const fromExcludedPredefinedFunctions = common.getValueByPath(fromObject, [
162+
'excludedPredefinedFunctions',
163+
]);
164+
if (fromExcludedPredefinedFunctions != null) {
165+
common.setValueByPath(
166+
toObject,
167+
['excludedPredefinedFunctions'],
168+
fromExcludedPredefinedFunctions,
169+
);
170+
}
171+
172+
const fromEnablePromptInjectionDetection = common.getValueByPath(fromObject, [
173+
'enablePromptInjectionDetection',
174+
]);
175+
if (fromEnablePromptInjectionDetection != null) {
176+
common.setValueByPath(
177+
toObject,
178+
['enablePromptInjectionDetection'],
179+
fromEnablePromptInjectionDetection,
180+
);
181+
}
182+
183+
if (
184+
common.getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined
185+
) {
186+
throw new Error(
187+
'disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.',
188+
);
189+
}
190+
191+
return toObject;
192+
}
193+
151194
export function contentToMldev(
152195
fromObject: types.Content,
153196
): Record<string, unknown> {
@@ -2363,7 +2406,11 @@ export function toolToVertex(fromObject: types.Tool): Record<string, unknown> {
23632406

23642407
const fromComputerUse = common.getValueByPath(fromObject, ['computerUse']);
23652408
if (fromComputerUse != null) {
2366-
common.setValueByPath(toObject, ['computerUse'], fromComputerUse);
2409+
common.setValueByPath(
2410+
toObject,
2411+
['computerUse'],
2412+
computerUseToVertex(fromComputerUse),
2413+
);
23672414
}
23682415

23692416
if (common.getValueByPath(fromObject, ['fileSearch']) !== undefined) {

0 commit comments

Comments
 (0)