@google/genai 2.11.0 → 2.12.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/dist/genai.d.ts +666 -25
- package/dist/index.cjs +848 -100
- package/dist/index.mjs +848 -100
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +913 -165
- package/dist/node/index.mjs +913 -165
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +666 -25
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +1 -1
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +16 -0
- package/dist/vertex_internal/index.js +1 -1
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +913 -165
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +666 -25
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7927,7 +7927,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7927
7927
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7928
7928
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7929
7929
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7930
|
-
const SDK_VERSION = '2.
|
|
7930
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
7931
7931
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7932
7932
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7933
7933
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -12079,9 +12079,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
12079
12079
|
* Creates a new Agent (Typed version for SDK).
|
|
12080
12080
|
*/
|
|
12081
12081
|
function agentsCreate(client, body, api_version, options) {
|
|
12082
|
-
return new APIPromise($do$
|
|
12082
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
12083
12083
|
}
|
|
12084
|
-
async function $do$
|
|
12084
|
+
async function $do$l(client, body, api_version, options) {
|
|
12085
12085
|
var _a, _b, _c;
|
|
12086
12086
|
const input = {
|
|
12087
12087
|
body: body,
|
|
@@ -12164,9 +12164,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
12164
12164
|
* Deletes an Agent.
|
|
12165
12165
|
*/
|
|
12166
12166
|
function agentsDelete(client, id, api_version, options) {
|
|
12167
|
-
return new APIPromise($do$
|
|
12167
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
12168
12168
|
}
|
|
12169
|
-
async function $do$
|
|
12169
|
+
async function $do$k(client, id, api_version, options) {
|
|
12170
12170
|
var _a, _b, _c;
|
|
12171
12171
|
const input = {
|
|
12172
12172
|
id: id,
|
|
@@ -12252,9 +12252,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
12252
12252
|
* Gets a specific Agent.
|
|
12253
12253
|
*/
|
|
12254
12254
|
function agentsGet(client, id, api_version, options) {
|
|
12255
|
-
return new APIPromise($do$
|
|
12255
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
12256
12256
|
}
|
|
12257
|
-
async function $do$
|
|
12257
|
+
async function $do$j(client, id, api_version, options) {
|
|
12258
12258
|
var _a, _b, _c;
|
|
12259
12259
|
const input = {
|
|
12260
12260
|
id: id,
|
|
@@ -12340,9 +12340,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
12340
12340
|
* Lists all Agents.
|
|
12341
12341
|
*/
|
|
12342
12342
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
12343
|
-
return new APIPromise($do$
|
|
12343
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
12344
12344
|
}
|
|
12345
|
-
async function $do$
|
|
12345
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
12346
12346
|
var _a, _b, _c;
|
|
12347
12347
|
const input = {
|
|
12348
12348
|
api_version: api_version,
|
|
@@ -12608,15 +12608,596 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
12608
12608
|
* g3-prettier-ignore-file
|
|
12609
12609
|
*/
|
|
12610
12610
|
/**
|
|
12611
|
-
* Canceling an interaction
|
|
12612
|
-
*
|
|
12613
|
-
* @remarks
|
|
12614
|
-
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
12611
|
+
* Canceling an interaction
|
|
12612
|
+
*
|
|
12613
|
+
* @remarks
|
|
12614
|
+
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
12615
|
+
*/
|
|
12616
|
+
function interactionsCancel(client, id, api_version, options) {
|
|
12617
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
12618
|
+
}
|
|
12619
|
+
async function $do$h(client, id, api_version, options) {
|
|
12620
|
+
var _a, _b, _c;
|
|
12621
|
+
const input = {
|
|
12622
|
+
id: id,
|
|
12623
|
+
api_version: api_version,
|
|
12624
|
+
};
|
|
12625
|
+
const payload = input;
|
|
12626
|
+
const body = null;
|
|
12627
|
+
const pathParams = {
|
|
12628
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12629
|
+
id: encodeSimple("id", payload.id, {
|
|
12630
|
+
explode: false,
|
|
12631
|
+
charEncoding: "percent",
|
|
12632
|
+
}),
|
|
12633
|
+
};
|
|
12634
|
+
const path = pathToFunc("/{api_version}/interactions/{id}/cancel")(pathParams);
|
|
12635
|
+
const headers = new Headers(compactMap({
|
|
12636
|
+
Accept: "application/json",
|
|
12637
|
+
}));
|
|
12638
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
12639
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12640
|
+
const context = {
|
|
12641
|
+
options: client._options,
|
|
12642
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12643
|
+
operation_id: "cancelInteractionById",
|
|
12644
|
+
o_auth2_scopes: null,
|
|
12645
|
+
resolved_security: requestSecurity,
|
|
12646
|
+
security_source: client._options.security,
|
|
12647
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
12648
|
+
|| client._options.retry_config
|
|
12649
|
+
|| {
|
|
12650
|
+
strategy: "attempt-count-backoff",
|
|
12651
|
+
backoff: {
|
|
12652
|
+
initialInterval: 500,
|
|
12653
|
+
maxInterval: 8000,
|
|
12654
|
+
exponent: 2,
|
|
12655
|
+
maxElapsedTime: 30000,
|
|
12656
|
+
},
|
|
12657
|
+
retryConnectionErrors: true,
|
|
12658
|
+
maxRetries: 4,
|
|
12659
|
+
}
|
|
12660
|
+
|| { strategy: "none" },
|
|
12661
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
12662
|
+
};
|
|
12663
|
+
const requestRes = client._createRequest(context, {
|
|
12664
|
+
security: requestSecurity,
|
|
12665
|
+
method: "POST",
|
|
12666
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12667
|
+
path: path,
|
|
12668
|
+
headers: headers,
|
|
12669
|
+
body: body,
|
|
12670
|
+
userAgent: client._options.user_agent,
|
|
12671
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12672
|
+
}, options);
|
|
12673
|
+
if (!requestRes.ok) {
|
|
12674
|
+
return [requestRes, { status: "invalid" }];
|
|
12675
|
+
}
|
|
12676
|
+
const req = requestRes.value;
|
|
12677
|
+
const doResult = await client._do(req, {
|
|
12678
|
+
context,
|
|
12679
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
12680
|
+
retryConfig: context.retry_config,
|
|
12681
|
+
retryCodes: context.retry_codes,
|
|
12682
|
+
});
|
|
12683
|
+
if (!doResult.ok) {
|
|
12684
|
+
return [doResult, { status: "request-error", request: req }];
|
|
12685
|
+
}
|
|
12686
|
+
const response = doResult.value;
|
|
12687
|
+
const responseFields = {
|
|
12688
|
+
httpMeta: { response: response, request: req },
|
|
12689
|
+
};
|
|
12690
|
+
const [result] = await match(json(200), jsonErr("4XX", CancelInteractionByIdClientError), jsonErr("5XX", CancelInteractionByIdServerError))(response, req, { extraFields: responseFields });
|
|
12691
|
+
if (!result.ok) {
|
|
12692
|
+
return [result, { status: "complete", request: req, response }];
|
|
12693
|
+
}
|
|
12694
|
+
return [result, { status: "complete", request: req, response }];
|
|
12695
|
+
}
|
|
12696
|
+
|
|
12697
|
+
/**
|
|
12698
|
+
* @license
|
|
12699
|
+
* Copyright 2026 Google LLC
|
|
12700
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12701
|
+
*
|
|
12702
|
+
* g3-prettier-ignore-file
|
|
12703
|
+
*/
|
|
12704
|
+
function interactionsCreate(client, body, api_version, options) {
|
|
12705
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
12706
|
+
}
|
|
12707
|
+
async function $do$g(client, body, api_version, options) {
|
|
12708
|
+
var _a, _b, _c, _d;
|
|
12709
|
+
const input = {
|
|
12710
|
+
body: body,
|
|
12711
|
+
api_version: api_version,
|
|
12712
|
+
};
|
|
12713
|
+
const payload = input;
|
|
12714
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
12715
|
+
const pathParams = {
|
|
12716
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12717
|
+
};
|
|
12718
|
+
const path = pathToFunc("/{api_version}/interactions")(pathParams);
|
|
12719
|
+
const headers = new Headers(compactMap({
|
|
12720
|
+
"Content-Type": "application/json",
|
|
12721
|
+
Accept: ((_b = input === null || input === void 0 ? void 0 : input.body) === null || _b === void 0 ? void 0 : _b.stream) ? "text/event-stream" : "application/json",
|
|
12722
|
+
}));
|
|
12723
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
12724
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12725
|
+
const context = {
|
|
12726
|
+
options: client._options,
|
|
12727
|
+
base_url: (_d = (_c = options === null || options === void 0 ? void 0 : options.server_url) !== null && _c !== void 0 ? _c : client._baseURL) !== null && _d !== void 0 ? _d : "",
|
|
12728
|
+
operation_id: "CreateInteraction",
|
|
12729
|
+
o_auth2_scopes: null,
|
|
12730
|
+
resolved_security: requestSecurity,
|
|
12731
|
+
security_source: client._options.security,
|
|
12732
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
12733
|
+
|| client._options.retry_config
|
|
12734
|
+
|| {
|
|
12735
|
+
strategy: "attempt-count-backoff",
|
|
12736
|
+
backoff: {
|
|
12737
|
+
initialInterval: 500,
|
|
12738
|
+
maxInterval: 8000,
|
|
12739
|
+
exponent: 2,
|
|
12740
|
+
maxElapsedTime: 30000,
|
|
12741
|
+
},
|
|
12742
|
+
retryConnectionErrors: true,
|
|
12743
|
+
maxRetries: 4,
|
|
12744
|
+
}
|
|
12745
|
+
|| { strategy: "none" },
|
|
12746
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
12747
|
+
};
|
|
12748
|
+
const requestRes = client._createRequest(context, {
|
|
12749
|
+
security: requestSecurity,
|
|
12750
|
+
method: "POST",
|
|
12751
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12752
|
+
path: path,
|
|
12753
|
+
headers: headers,
|
|
12754
|
+
body: body$,
|
|
12755
|
+
userAgent: client._options.user_agent,
|
|
12756
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12757
|
+
}, options);
|
|
12758
|
+
if (!requestRes.ok) {
|
|
12759
|
+
return [requestRes, { status: "invalid" }];
|
|
12760
|
+
}
|
|
12761
|
+
const req = requestRes.value;
|
|
12762
|
+
const doResult = await client._do(req, {
|
|
12763
|
+
context,
|
|
12764
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
12765
|
+
retryConfig: context.retry_config,
|
|
12766
|
+
retryCodes: context.retry_codes,
|
|
12767
|
+
});
|
|
12768
|
+
if (!doResult.ok) {
|
|
12769
|
+
return [doResult, { status: "request-error", request: req }];
|
|
12770
|
+
}
|
|
12771
|
+
const response = doResult.value;
|
|
12772
|
+
const responseFields = {
|
|
12773
|
+
httpMeta: { response: response, request: req },
|
|
12774
|
+
};
|
|
12775
|
+
const [result] = await match(json(200), sse(200, {
|
|
12776
|
+
sentinel: "[DONE]",
|
|
12777
|
+
flattened: true,
|
|
12778
|
+
}), jsonErr("4XX", CreateInteractionClientError), jsonErr("5XX", CreateInteractionServerError))(response, req, { extraFields: responseFields });
|
|
12779
|
+
if (!result.ok) {
|
|
12780
|
+
return [result, { status: "complete", request: req, response }];
|
|
12781
|
+
}
|
|
12782
|
+
return [result, { status: "complete", request: req, response }];
|
|
12783
|
+
}
|
|
12784
|
+
|
|
12785
|
+
/**
|
|
12786
|
+
* @license
|
|
12787
|
+
* Copyright 2026 Google LLC
|
|
12788
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12789
|
+
*
|
|
12790
|
+
* g3-prettier-ignore-file
|
|
12791
|
+
*/
|
|
12792
|
+
/**
|
|
12793
|
+
* Deleting an interaction
|
|
12794
|
+
*
|
|
12795
|
+
* @remarks
|
|
12796
|
+
* Deletes the interaction by id.
|
|
12797
|
+
*/
|
|
12798
|
+
function interactionsDelete(client, id, api_version, options) {
|
|
12799
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
12800
|
+
}
|
|
12801
|
+
async function $do$f(client, id, api_version, options) {
|
|
12802
|
+
var _a, _b, _c;
|
|
12803
|
+
const input = {
|
|
12804
|
+
id: id,
|
|
12805
|
+
api_version: api_version,
|
|
12806
|
+
};
|
|
12807
|
+
const payload = input;
|
|
12808
|
+
const body = null;
|
|
12809
|
+
const pathParams = {
|
|
12810
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12811
|
+
id: encodeSimple("id", payload.id, {
|
|
12812
|
+
explode: false,
|
|
12813
|
+
charEncoding: "percent",
|
|
12814
|
+
}),
|
|
12815
|
+
};
|
|
12816
|
+
const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
|
|
12817
|
+
const headers = new Headers(compactMap({
|
|
12818
|
+
Accept: "application/json",
|
|
12819
|
+
}));
|
|
12820
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
12821
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12822
|
+
const context = {
|
|
12823
|
+
options: client._options,
|
|
12824
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12825
|
+
operation_id: "deleteInteraction",
|
|
12826
|
+
o_auth2_scopes: null,
|
|
12827
|
+
resolved_security: requestSecurity,
|
|
12828
|
+
security_source: client._options.security,
|
|
12829
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
12830
|
+
|| client._options.retry_config
|
|
12831
|
+
|| {
|
|
12832
|
+
strategy: "attempt-count-backoff",
|
|
12833
|
+
backoff: {
|
|
12834
|
+
initialInterval: 500,
|
|
12835
|
+
maxInterval: 8000,
|
|
12836
|
+
exponent: 2,
|
|
12837
|
+
maxElapsedTime: 30000,
|
|
12838
|
+
},
|
|
12839
|
+
retryConnectionErrors: true,
|
|
12840
|
+
maxRetries: 4,
|
|
12841
|
+
}
|
|
12842
|
+
|| { strategy: "none" },
|
|
12843
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
12844
|
+
};
|
|
12845
|
+
const requestRes = client._createRequest(context, {
|
|
12846
|
+
security: requestSecurity,
|
|
12847
|
+
method: "DELETE",
|
|
12848
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12849
|
+
path: path,
|
|
12850
|
+
headers: headers,
|
|
12851
|
+
body: body,
|
|
12852
|
+
userAgent: client._options.user_agent,
|
|
12853
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12854
|
+
}, options);
|
|
12855
|
+
if (!requestRes.ok) {
|
|
12856
|
+
return [requestRes, { status: "invalid" }];
|
|
12857
|
+
}
|
|
12858
|
+
const req = requestRes.value;
|
|
12859
|
+
const doResult = await client._do(req, {
|
|
12860
|
+
context,
|
|
12861
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
12862
|
+
retryConfig: context.retry_config,
|
|
12863
|
+
retryCodes: context.retry_codes,
|
|
12864
|
+
});
|
|
12865
|
+
if (!doResult.ok) {
|
|
12866
|
+
return [doResult, { status: "request-error", request: req }];
|
|
12867
|
+
}
|
|
12868
|
+
const response = doResult.value;
|
|
12869
|
+
const responseFields = {
|
|
12870
|
+
httpMeta: { response: response, request: req },
|
|
12871
|
+
};
|
|
12872
|
+
const [result] = await match(nil(200), jsonErr("4XX", DeleteInteractionClientError), jsonErr("5XX", DeleteInteractionServerError))(response, req, { extraFields: responseFields });
|
|
12873
|
+
if (!result.ok) {
|
|
12874
|
+
return [result, { status: "complete", request: req, response }];
|
|
12875
|
+
}
|
|
12876
|
+
return [result, { status: "complete", request: req, response }];
|
|
12877
|
+
}
|
|
12878
|
+
|
|
12879
|
+
/**
|
|
12880
|
+
* @license
|
|
12881
|
+
* Copyright 2026 Google LLC
|
|
12882
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12883
|
+
*
|
|
12884
|
+
* g3-prettier-ignore-file
|
|
12885
|
+
*/
|
|
12886
|
+
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12887
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
12888
|
+
}
|
|
12889
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12890
|
+
var _a, _b, _c;
|
|
12891
|
+
const input = {
|
|
12892
|
+
id: id,
|
|
12893
|
+
stream: stream,
|
|
12894
|
+
last_event_id: last_event_id,
|
|
12895
|
+
include_input: include_input,
|
|
12896
|
+
api_version: api_version,
|
|
12897
|
+
};
|
|
12898
|
+
const payload = input;
|
|
12899
|
+
const body = null;
|
|
12900
|
+
const pathParams = {
|
|
12901
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12902
|
+
id: encodeSimple("id", payload.id, {
|
|
12903
|
+
explode: false,
|
|
12904
|
+
charEncoding: "percent",
|
|
12905
|
+
}),
|
|
12906
|
+
};
|
|
12907
|
+
const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
|
|
12908
|
+
const query = encodeFormQuery({
|
|
12909
|
+
"include_input": payload.include_input,
|
|
12910
|
+
"last_event_id": payload.last_event_id,
|
|
12911
|
+
"stream": payload.stream,
|
|
12912
|
+
});
|
|
12913
|
+
const headers = new Headers(compactMap({
|
|
12914
|
+
Accept: (input === null || input === void 0 ? void 0 : input.stream) ? "text/event-stream" : "application/json",
|
|
12915
|
+
}));
|
|
12916
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
12917
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12918
|
+
const context = {
|
|
12919
|
+
options: client._options,
|
|
12920
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12921
|
+
operation_id: "getInteractionById",
|
|
12922
|
+
o_auth2_scopes: null,
|
|
12923
|
+
resolved_security: requestSecurity,
|
|
12924
|
+
security_source: client._options.security,
|
|
12925
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
12926
|
+
|| client._options.retry_config
|
|
12927
|
+
|| {
|
|
12928
|
+
strategy: "attempt-count-backoff",
|
|
12929
|
+
backoff: {
|
|
12930
|
+
initialInterval: 500,
|
|
12931
|
+
maxInterval: 8000,
|
|
12932
|
+
exponent: 2,
|
|
12933
|
+
maxElapsedTime: 30000,
|
|
12934
|
+
},
|
|
12935
|
+
retryConnectionErrors: true,
|
|
12936
|
+
maxRetries: 4,
|
|
12937
|
+
}
|
|
12938
|
+
|| { strategy: "none" },
|
|
12939
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
12940
|
+
};
|
|
12941
|
+
const requestRes = client._createRequest(context, {
|
|
12942
|
+
security: requestSecurity,
|
|
12943
|
+
method: "GET",
|
|
12944
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12945
|
+
path: path,
|
|
12946
|
+
headers: headers,
|
|
12947
|
+
query: query,
|
|
12948
|
+
body: body,
|
|
12949
|
+
userAgent: client._options.user_agent,
|
|
12950
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12951
|
+
}, options);
|
|
12952
|
+
if (!requestRes.ok) {
|
|
12953
|
+
return [requestRes, { status: "invalid" }];
|
|
12954
|
+
}
|
|
12955
|
+
const req = requestRes.value;
|
|
12956
|
+
const doResult = await client._do(req, {
|
|
12957
|
+
context,
|
|
12958
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
12959
|
+
retryConfig: context.retry_config,
|
|
12960
|
+
retryCodes: context.retry_codes,
|
|
12961
|
+
});
|
|
12962
|
+
if (!doResult.ok) {
|
|
12963
|
+
return [doResult, { status: "request-error", request: req }];
|
|
12964
|
+
}
|
|
12965
|
+
const response = doResult.value;
|
|
12966
|
+
const responseFields = {
|
|
12967
|
+
httpMeta: { response: response, request: req },
|
|
12968
|
+
};
|
|
12969
|
+
const [result] = await match(json(200), sse(200, {
|
|
12970
|
+
sentinel: "[DONE]",
|
|
12971
|
+
flattened: true,
|
|
12972
|
+
}), jsonErr("4XX", GetInteractionByIdClientError), jsonErr("5XX", GetInteractionByIdServerError))(response, req, { extraFields: responseFields });
|
|
12973
|
+
if (!result.ok) {
|
|
12974
|
+
return [result, { status: "complete", request: req, response }];
|
|
12975
|
+
}
|
|
12976
|
+
return [result, { status: "complete", request: req, response }];
|
|
12977
|
+
}
|
|
12978
|
+
|
|
12979
|
+
/**
|
|
12980
|
+
* @license
|
|
12981
|
+
* Copyright 2026 Google LLC
|
|
12982
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12983
|
+
*
|
|
12984
|
+
* g3-prettier-ignore-file
|
|
12985
|
+
*/
|
|
12986
|
+
class Interactions extends ClientSDK {
|
|
12987
|
+
create(params, options) {
|
|
12988
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
12989
|
+
return unwrapAsAPIPromise(interactionsCreate(this, body, api_version, options));
|
|
12990
|
+
}
|
|
12991
|
+
get(id, params, options) {
|
|
12992
|
+
return unwrapAsAPIPromise(interactionsGet(this, id, params === null || params === void 0 ? void 0 : params.stream, params === null || params === void 0 ? void 0 : params.last_event_id, params === null || params === void 0 ? void 0 : params.include_input, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
12993
|
+
}
|
|
12994
|
+
/**
|
|
12995
|
+
* Deleting an interaction
|
|
12996
|
+
*
|
|
12997
|
+
* @remarks
|
|
12998
|
+
* Deletes the interaction by id.
|
|
12999
|
+
*/
|
|
13000
|
+
delete(id, params, options) {
|
|
13001
|
+
return unwrapAsAPIPromise(interactionsDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13002
|
+
}
|
|
13003
|
+
/**
|
|
13004
|
+
* Canceling an interaction
|
|
13005
|
+
*
|
|
13006
|
+
* @remarks
|
|
13007
|
+
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
13008
|
+
*/
|
|
13009
|
+
cancel(id, params, options) {
|
|
13010
|
+
return unwrapAsAPIPromise(interactionsCancel(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13011
|
+
}
|
|
13012
|
+
}
|
|
13013
|
+
|
|
13014
|
+
/**
|
|
13015
|
+
* @license
|
|
13016
|
+
* Copyright 2026 Google LLC
|
|
13017
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13018
|
+
*
|
|
13019
|
+
* g3-prettier-ignore-file
|
|
13020
|
+
*/
|
|
13021
|
+
/**
|
|
13022
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
13023
|
+
*/
|
|
13024
|
+
function triggersCreate(client, body, api_version, options) {
|
|
13025
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
13026
|
+
}
|
|
13027
|
+
async function $do$d(client, body, api_version, options) {
|
|
13028
|
+
var _a, _b, _c;
|
|
13029
|
+
const input = {
|
|
13030
|
+
body: body,
|
|
13031
|
+
api_version: api_version,
|
|
13032
|
+
};
|
|
13033
|
+
const payload = input;
|
|
13034
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
13035
|
+
const pathParams = {
|
|
13036
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13037
|
+
};
|
|
13038
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
13039
|
+
const headers = new Headers(compactMap({
|
|
13040
|
+
"Content-Type": "application/json",
|
|
13041
|
+
Accept: "application/json",
|
|
13042
|
+
}));
|
|
13043
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13044
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13045
|
+
const context = {
|
|
13046
|
+
options: client._options,
|
|
13047
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
13048
|
+
operation_id: "CreateTrigger",
|
|
13049
|
+
o_auth2_scopes: null,
|
|
13050
|
+
resolved_security: requestSecurity,
|
|
13051
|
+
security_source: client._options.security,
|
|
13052
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13053
|
+
|| client._options.retry_config
|
|
13054
|
+
|| {
|
|
13055
|
+
strategy: "attempt-count-backoff",
|
|
13056
|
+
backoff: {
|
|
13057
|
+
initialInterval: 500,
|
|
13058
|
+
maxInterval: 8000,
|
|
13059
|
+
exponent: 2,
|
|
13060
|
+
maxElapsedTime: 30000,
|
|
13061
|
+
},
|
|
13062
|
+
retryConnectionErrors: true,
|
|
13063
|
+
maxRetries: 4,
|
|
13064
|
+
}
|
|
13065
|
+
|| { strategy: "none" },
|
|
13066
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13067
|
+
};
|
|
13068
|
+
const requestRes = client._createRequest(context, {
|
|
13069
|
+
security: requestSecurity,
|
|
13070
|
+
method: "POST",
|
|
13071
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13072
|
+
path: path,
|
|
13073
|
+
headers: headers,
|
|
13074
|
+
body: body$,
|
|
13075
|
+
userAgent: client._options.user_agent,
|
|
13076
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13077
|
+
}, options);
|
|
13078
|
+
if (!requestRes.ok) {
|
|
13079
|
+
return [requestRes, { status: "invalid" }];
|
|
13080
|
+
}
|
|
13081
|
+
const req = requestRes.value;
|
|
13082
|
+
const doResult = await client._do(req, {
|
|
13083
|
+
context,
|
|
13084
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13085
|
+
retryConfig: context.retry_config,
|
|
13086
|
+
retryCodes: context.retry_codes,
|
|
13087
|
+
});
|
|
13088
|
+
if (!doResult.ok) {
|
|
13089
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13090
|
+
}
|
|
13091
|
+
const response = doResult.value;
|
|
13092
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13093
|
+
if (!result.ok) {
|
|
13094
|
+
return [result, { status: "complete", request: req, response }];
|
|
13095
|
+
}
|
|
13096
|
+
return [result, { status: "complete", request: req, response }];
|
|
13097
|
+
}
|
|
13098
|
+
|
|
13099
|
+
/**
|
|
13100
|
+
* @license
|
|
13101
|
+
* Copyright 2026 Google LLC
|
|
13102
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13103
|
+
*
|
|
13104
|
+
* g3-prettier-ignore-file
|
|
13105
|
+
*/
|
|
13106
|
+
/**
|
|
13107
|
+
* Deletes a trigger.
|
|
13108
|
+
*/
|
|
13109
|
+
function triggersDelete(client, id, api_version, options) {
|
|
13110
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
13111
|
+
}
|
|
13112
|
+
async function $do$c(client, id, api_version, options) {
|
|
13113
|
+
var _a, _b, _c;
|
|
13114
|
+
const input = {
|
|
13115
|
+
id: id,
|
|
13116
|
+
api_version: api_version,
|
|
13117
|
+
};
|
|
13118
|
+
const payload = input;
|
|
13119
|
+
const body = null;
|
|
13120
|
+
const pathParams = {
|
|
13121
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13122
|
+
id: encodeSimple("id", payload.id, {
|
|
13123
|
+
explode: false,
|
|
13124
|
+
charEncoding: "percent",
|
|
13125
|
+
}),
|
|
13126
|
+
};
|
|
13127
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13128
|
+
const headers = new Headers(compactMap({
|
|
13129
|
+
Accept: "application/json",
|
|
13130
|
+
}));
|
|
13131
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13132
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13133
|
+
const context = {
|
|
13134
|
+
options: client._options,
|
|
13135
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
13136
|
+
operation_id: "DeleteTrigger",
|
|
13137
|
+
o_auth2_scopes: null,
|
|
13138
|
+
resolved_security: requestSecurity,
|
|
13139
|
+
security_source: client._options.security,
|
|
13140
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13141
|
+
|| client._options.retry_config
|
|
13142
|
+
|| {
|
|
13143
|
+
strategy: "attempt-count-backoff",
|
|
13144
|
+
backoff: {
|
|
13145
|
+
initialInterval: 500,
|
|
13146
|
+
maxInterval: 8000,
|
|
13147
|
+
exponent: 2,
|
|
13148
|
+
maxElapsedTime: 30000,
|
|
13149
|
+
},
|
|
13150
|
+
retryConnectionErrors: true,
|
|
13151
|
+
maxRetries: 4,
|
|
13152
|
+
}
|
|
13153
|
+
|| { strategy: "none" },
|
|
13154
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13155
|
+
};
|
|
13156
|
+
const requestRes = client._createRequest(context, {
|
|
13157
|
+
security: requestSecurity,
|
|
13158
|
+
method: "DELETE",
|
|
13159
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13160
|
+
path: path,
|
|
13161
|
+
headers: headers,
|
|
13162
|
+
body: body,
|
|
13163
|
+
userAgent: client._options.user_agent,
|
|
13164
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13165
|
+
}, options);
|
|
13166
|
+
if (!requestRes.ok) {
|
|
13167
|
+
return [requestRes, { status: "invalid" }];
|
|
13168
|
+
}
|
|
13169
|
+
const req = requestRes.value;
|
|
13170
|
+
const doResult = await client._do(req, {
|
|
13171
|
+
context,
|
|
13172
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13173
|
+
retryConfig: context.retry_config,
|
|
13174
|
+
retryCodes: context.retry_codes,
|
|
13175
|
+
});
|
|
13176
|
+
if (!doResult.ok) {
|
|
13177
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13178
|
+
}
|
|
13179
|
+
const response = doResult.value;
|
|
13180
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13181
|
+
if (!result.ok) {
|
|
13182
|
+
return [result, { status: "complete", request: req, response }];
|
|
13183
|
+
}
|
|
13184
|
+
return [result, { status: "complete", request: req, response }];
|
|
13185
|
+
}
|
|
13186
|
+
|
|
13187
|
+
/**
|
|
13188
|
+
* @license
|
|
13189
|
+
* Copyright 2026 Google LLC
|
|
13190
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13191
|
+
*
|
|
13192
|
+
* g3-prettier-ignore-file
|
|
13193
|
+
*/
|
|
13194
|
+
/**
|
|
13195
|
+
* Gets details of a single trigger.
|
|
12615
13196
|
*/
|
|
12616
|
-
function
|
|
12617
|
-
return new APIPromise($do$
|
|
13197
|
+
function triggersGet(client, id, api_version, options) {
|
|
13198
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
12618
13199
|
}
|
|
12619
|
-
async function $do$
|
|
13200
|
+
async function $do$b(client, id, api_version, options) {
|
|
12620
13201
|
var _a, _b, _c;
|
|
12621
13202
|
const input = {
|
|
12622
13203
|
id: id,
|
|
@@ -12631,7 +13212,7 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12631
13212
|
charEncoding: "percent",
|
|
12632
13213
|
}),
|
|
12633
13214
|
};
|
|
12634
|
-
const path = pathToFunc("/{api_version}/
|
|
13215
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
12635
13216
|
const headers = new Headers(compactMap({
|
|
12636
13217
|
Accept: "application/json",
|
|
12637
13218
|
}));
|
|
@@ -12640,7 +13221,7 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12640
13221
|
const context = {
|
|
12641
13222
|
options: client._options,
|
|
12642
13223
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12643
|
-
operation_id: "
|
|
13224
|
+
operation_id: "GetTrigger",
|
|
12644
13225
|
o_auth2_scopes: null,
|
|
12645
13226
|
resolved_security: requestSecurity,
|
|
12646
13227
|
security_source: client._options.security,
|
|
@@ -12662,7 +13243,7 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12662
13243
|
};
|
|
12663
13244
|
const requestRes = client._createRequest(context, {
|
|
12664
13245
|
security: requestSecurity,
|
|
12665
|
-
method: "
|
|
13246
|
+
method: "GET",
|
|
12666
13247
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12667
13248
|
path: path,
|
|
12668
13249
|
headers: headers,
|
|
@@ -12684,10 +13265,7 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12684
13265
|
return [doResult, { status: "request-error", request: req }];
|
|
12685
13266
|
}
|
|
12686
13267
|
const response = doResult.value;
|
|
12687
|
-
const
|
|
12688
|
-
httpMeta: { response: response, request: req },
|
|
12689
|
-
};
|
|
12690
|
-
const [result] = await match(json(200), jsonErr("4XX", CancelInteractionByIdClientError), jsonErr("5XX", CancelInteractionByIdServerError))(response, req, { extraFields: responseFields });
|
|
13268
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12691
13269
|
if (!result.ok) {
|
|
12692
13270
|
return [result, { status: "complete", request: req, response }];
|
|
12693
13271
|
}
|
|
@@ -12701,31 +13279,43 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12701
13279
|
*
|
|
12702
13280
|
* g3-prettier-ignore-file
|
|
12703
13281
|
*/
|
|
12704
|
-
|
|
12705
|
-
|
|
13282
|
+
/**
|
|
13283
|
+
* Lists executions for a trigger.
|
|
13284
|
+
*/
|
|
13285
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13286
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
12706
13287
|
}
|
|
12707
|
-
async function $do$
|
|
12708
|
-
var _a, _b, _c
|
|
13288
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13289
|
+
var _a, _b, _c;
|
|
12709
13290
|
const input = {
|
|
12710
|
-
|
|
13291
|
+
trigger_id: trigger_id,
|
|
12711
13292
|
api_version: api_version,
|
|
13293
|
+
page_size: page_size,
|
|
13294
|
+
page_token: page_token,
|
|
12712
13295
|
};
|
|
12713
13296
|
const payload = input;
|
|
12714
|
-
const body
|
|
13297
|
+
const body = null;
|
|
12715
13298
|
const pathParams = {
|
|
12716
13299
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13300
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
13301
|
+
explode: false,
|
|
13302
|
+
charEncoding: "percent",
|
|
13303
|
+
}),
|
|
12717
13304
|
};
|
|
12718
|
-
const path = pathToFunc("/{api_version}/
|
|
13305
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
13306
|
+
const query = encodeFormQuery({
|
|
13307
|
+
"page_size": payload.page_size,
|
|
13308
|
+
"page_token": payload.page_token,
|
|
13309
|
+
});
|
|
12719
13310
|
const headers = new Headers(compactMap({
|
|
12720
|
-
|
|
12721
|
-
Accept: ((_b = input === null || input === void 0 ? void 0 : input.body) === null || _b === void 0 ? void 0 : _b.stream) ? "text/event-stream" : "application/json",
|
|
13311
|
+
Accept: "application/json",
|
|
12722
13312
|
}));
|
|
12723
13313
|
const securityInput = await extractSecurity(client._options.security);
|
|
12724
13314
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12725
13315
|
const context = {
|
|
12726
13316
|
options: client._options,
|
|
12727
|
-
base_url: (
|
|
12728
|
-
operation_id: "
|
|
13317
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
13318
|
+
operation_id: "ListTriggerExecutions",
|
|
12729
13319
|
o_auth2_scopes: null,
|
|
12730
13320
|
resolved_security: requestSecurity,
|
|
12731
13321
|
security_source: client._options.security,
|
|
@@ -12747,11 +13337,12 @@ async function $do$9(client, body, api_version, options) {
|
|
|
12747
13337
|
};
|
|
12748
13338
|
const requestRes = client._createRequest(context, {
|
|
12749
13339
|
security: requestSecurity,
|
|
12750
|
-
method: "
|
|
13340
|
+
method: "GET",
|
|
12751
13341
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12752
13342
|
path: path,
|
|
12753
13343
|
headers: headers,
|
|
12754
|
-
|
|
13344
|
+
query: query,
|
|
13345
|
+
body: body,
|
|
12755
13346
|
userAgent: client._options.user_agent,
|
|
12756
13347
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12757
13348
|
}, options);
|
|
@@ -12769,13 +13360,7 @@ async function $do$9(client, body, api_version, options) {
|
|
|
12769
13360
|
return [doResult, { status: "request-error", request: req }];
|
|
12770
13361
|
}
|
|
12771
13362
|
const response = doResult.value;
|
|
12772
|
-
const
|
|
12773
|
-
httpMeta: { response: response, request: req },
|
|
12774
|
-
};
|
|
12775
|
-
const [result] = await match(json(200), sse(200, {
|
|
12776
|
-
sentinel: "[DONE]",
|
|
12777
|
-
flattened: true,
|
|
12778
|
-
}), jsonErr("4XX", CreateInteractionClientError), jsonErr("5XX", CreateInteractionServerError))(response, req, { extraFields: responseFields });
|
|
13363
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12779
13364
|
if (!result.ok) {
|
|
12780
13365
|
return [result, { status: "complete", request: req, response }];
|
|
12781
13366
|
}
|
|
@@ -12790,30 +13375,119 @@ async function $do$9(client, body, api_version, options) {
|
|
|
12790
13375
|
* g3-prettier-ignore-file
|
|
12791
13376
|
*/
|
|
12792
13377
|
/**
|
|
12793
|
-
*
|
|
13378
|
+
* Lists triggers for a project.
|
|
13379
|
+
*/
|
|
13380
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
13381
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
13382
|
+
}
|
|
13383
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
13384
|
+
var _a, _b, _c;
|
|
13385
|
+
const input = {
|
|
13386
|
+
api_version: api_version,
|
|
13387
|
+
filter: filter,
|
|
13388
|
+
page_size: page_size,
|
|
13389
|
+
page_token: page_token,
|
|
13390
|
+
};
|
|
13391
|
+
const payload = input;
|
|
13392
|
+
const body = null;
|
|
13393
|
+
const pathParams = {
|
|
13394
|
+
api_version: encodeSimple("api_version", (_a = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13395
|
+
};
|
|
13396
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
13397
|
+
const query = encodeFormQuery({
|
|
13398
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
13399
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
13400
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
13401
|
+
});
|
|
13402
|
+
const headers = new Headers(compactMap({
|
|
13403
|
+
Accept: "application/json",
|
|
13404
|
+
}));
|
|
13405
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13406
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13407
|
+
const context = {
|
|
13408
|
+
options: client._options,
|
|
13409
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
13410
|
+
operation_id: "ListTriggers",
|
|
13411
|
+
o_auth2_scopes: null,
|
|
13412
|
+
resolved_security: requestSecurity,
|
|
13413
|
+
security_source: client._options.security,
|
|
13414
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13415
|
+
|| client._options.retry_config
|
|
13416
|
+
|| {
|
|
13417
|
+
strategy: "attempt-count-backoff",
|
|
13418
|
+
backoff: {
|
|
13419
|
+
initialInterval: 500,
|
|
13420
|
+
maxInterval: 8000,
|
|
13421
|
+
exponent: 2,
|
|
13422
|
+
maxElapsedTime: 30000,
|
|
13423
|
+
},
|
|
13424
|
+
retryConnectionErrors: true,
|
|
13425
|
+
maxRetries: 4,
|
|
13426
|
+
}
|
|
13427
|
+
|| { strategy: "none" },
|
|
13428
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13429
|
+
};
|
|
13430
|
+
const requestRes = client._createRequest(context, {
|
|
13431
|
+
security: requestSecurity,
|
|
13432
|
+
method: "GET",
|
|
13433
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13434
|
+
path: path,
|
|
13435
|
+
headers: headers,
|
|
13436
|
+
query: query,
|
|
13437
|
+
body: body,
|
|
13438
|
+
userAgent: client._options.user_agent,
|
|
13439
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13440
|
+
}, options);
|
|
13441
|
+
if (!requestRes.ok) {
|
|
13442
|
+
return [requestRes, { status: "invalid" }];
|
|
13443
|
+
}
|
|
13444
|
+
const req = requestRes.value;
|
|
13445
|
+
const doResult = await client._do(req, {
|
|
13446
|
+
context,
|
|
13447
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13448
|
+
retryConfig: context.retry_config,
|
|
13449
|
+
retryCodes: context.retry_codes,
|
|
13450
|
+
});
|
|
13451
|
+
if (!doResult.ok) {
|
|
13452
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13453
|
+
}
|
|
13454
|
+
const response = doResult.value;
|
|
13455
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13456
|
+
if (!result.ok) {
|
|
13457
|
+
return [result, { status: "complete", request: req, response }];
|
|
13458
|
+
}
|
|
13459
|
+
return [result, { status: "complete", request: req, response }];
|
|
13460
|
+
}
|
|
13461
|
+
|
|
13462
|
+
/**
|
|
13463
|
+
* @license
|
|
13464
|
+
* Copyright 2026 Google LLC
|
|
13465
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12794
13466
|
*
|
|
12795
|
-
*
|
|
12796
|
-
* Deletes the interaction by id.
|
|
13467
|
+
* g3-prettier-ignore-file
|
|
12797
13468
|
*/
|
|
12798
|
-
|
|
12799
|
-
|
|
13469
|
+
/**
|
|
13470
|
+
* Runs a trigger immediately.
|
|
13471
|
+
*/
|
|
13472
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
13473
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
12800
13474
|
}
|
|
12801
|
-
async function $do$8(client,
|
|
13475
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
12802
13476
|
var _a, _b, _c;
|
|
12803
13477
|
const input = {
|
|
12804
|
-
|
|
13478
|
+
trigger_id: trigger_id,
|
|
12805
13479
|
api_version: api_version,
|
|
12806
13480
|
};
|
|
12807
13481
|
const payload = input;
|
|
12808
13482
|
const body = null;
|
|
12809
13483
|
const pathParams = {
|
|
12810
13484
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12811
|
-
|
|
13485
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
12812
13486
|
explode: false,
|
|
12813
13487
|
charEncoding: "percent",
|
|
12814
13488
|
}),
|
|
12815
13489
|
};
|
|
12816
|
-
const path = pathToFunc("/{api_version}/
|
|
13490
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
12817
13491
|
const headers = new Headers(compactMap({
|
|
12818
13492
|
Accept: "application/json",
|
|
12819
13493
|
}));
|
|
@@ -12822,7 +13496,7 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12822
13496
|
const context = {
|
|
12823
13497
|
options: client._options,
|
|
12824
13498
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12825
|
-
operation_id: "
|
|
13499
|
+
operation_id: "RunTrigger",
|
|
12826
13500
|
o_auth2_scopes: null,
|
|
12827
13501
|
resolved_security: requestSecurity,
|
|
12828
13502
|
security_source: client._options.security,
|
|
@@ -12844,7 +13518,7 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12844
13518
|
};
|
|
12845
13519
|
const requestRes = client._createRequest(context, {
|
|
12846
13520
|
security: requestSecurity,
|
|
12847
|
-
method: "
|
|
13521
|
+
method: "POST",
|
|
12848
13522
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12849
13523
|
path: path,
|
|
12850
13524
|
headers: headers,
|
|
@@ -12866,10 +13540,7 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12866
13540
|
return [doResult, { status: "request-error", request: req }];
|
|
12867
13541
|
}
|
|
12868
13542
|
const response = doResult.value;
|
|
12869
|
-
const
|
|
12870
|
-
httpMeta: { response: response, request: req },
|
|
12871
|
-
};
|
|
12872
|
-
const [result] = await match(nil(200), jsonErr("4XX", DeleteInteractionClientError), jsonErr("5XX", DeleteInteractionServerError))(response, req, { extraFields: responseFields });
|
|
13543
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12873
13544
|
if (!result.ok) {
|
|
12874
13545
|
return [result, { status: "complete", request: req, response }];
|
|
12875
13546
|
}
|
|
@@ -12883,20 +13554,21 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12883
13554
|
*
|
|
12884
13555
|
* g3-prettier-ignore-file
|
|
12885
13556
|
*/
|
|
12886
|
-
|
|
12887
|
-
|
|
13557
|
+
/**
|
|
13558
|
+
* Updates a trigger.
|
|
13559
|
+
*/
|
|
13560
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
13561
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
12888
13562
|
}
|
|
12889
|
-
async function $do$7(client, id,
|
|
13563
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
12890
13564
|
var _a, _b, _c;
|
|
12891
13565
|
const input = {
|
|
12892
13566
|
id: id,
|
|
12893
|
-
|
|
12894
|
-
last_event_id: last_event_id,
|
|
12895
|
-
include_input: include_input,
|
|
13567
|
+
body: body,
|
|
12896
13568
|
api_version: api_version,
|
|
12897
13569
|
};
|
|
12898
13570
|
const payload = input;
|
|
12899
|
-
const body =
|
|
13571
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
12900
13572
|
const pathParams = {
|
|
12901
13573
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12902
13574
|
id: encodeSimple("id", payload.id, {
|
|
@@ -12904,21 +13576,17 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
|
|
|
12904
13576
|
charEncoding: "percent",
|
|
12905
13577
|
}),
|
|
12906
13578
|
};
|
|
12907
|
-
const path = pathToFunc("/{api_version}/
|
|
12908
|
-
const query = encodeFormQuery({
|
|
12909
|
-
"include_input": payload.include_input,
|
|
12910
|
-
"last_event_id": payload.last_event_id,
|
|
12911
|
-
"stream": payload.stream,
|
|
12912
|
-
});
|
|
13579
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
12913
13580
|
const headers = new Headers(compactMap({
|
|
12914
|
-
|
|
13581
|
+
"Content-Type": "application/json",
|
|
13582
|
+
Accept: "application/json",
|
|
12915
13583
|
}));
|
|
12916
13584
|
const securityInput = await extractSecurity(client._options.security);
|
|
12917
13585
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
12918
13586
|
const context = {
|
|
12919
13587
|
options: client._options,
|
|
12920
13588
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
12921
|
-
operation_id: "
|
|
13589
|
+
operation_id: "UpdateTrigger",
|
|
12922
13590
|
o_auth2_scopes: null,
|
|
12923
13591
|
resolved_security: requestSecurity,
|
|
12924
13592
|
security_source: client._options.security,
|
|
@@ -12940,12 +13608,11 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
|
|
|
12940
13608
|
};
|
|
12941
13609
|
const requestRes = client._createRequest(context, {
|
|
12942
13610
|
security: requestSecurity,
|
|
12943
|
-
method: "
|
|
13611
|
+
method: "PATCH",
|
|
12944
13612
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
12945
13613
|
path: path,
|
|
12946
13614
|
headers: headers,
|
|
12947
|
-
|
|
12948
|
-
body: body,
|
|
13615
|
+
body: body$,
|
|
12949
13616
|
userAgent: client._options.user_agent,
|
|
12950
13617
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
12951
13618
|
}, options);
|
|
@@ -12963,13 +13630,7 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
|
|
|
12963
13630
|
return [doResult, { status: "request-error", request: req }];
|
|
12964
13631
|
}
|
|
12965
13632
|
const response = doResult.value;
|
|
12966
|
-
const
|
|
12967
|
-
httpMeta: { response: response, request: req },
|
|
12968
|
-
};
|
|
12969
|
-
const [result] = await match(json(200), sse(200, {
|
|
12970
|
-
sentinel: "[DONE]",
|
|
12971
|
-
flattened: true,
|
|
12972
|
-
}), jsonErr("4XX", GetInteractionByIdClientError), jsonErr("5XX", GetInteractionByIdServerError))(response, req, { extraFields: responseFields });
|
|
13633
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12973
13634
|
if (!result.ok) {
|
|
12974
13635
|
return [result, { status: "complete", request: req, response }];
|
|
12975
13636
|
}
|
|
@@ -12983,31 +13644,50 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
|
|
|
12983
13644
|
*
|
|
12984
13645
|
* g3-prettier-ignore-file
|
|
12985
13646
|
*/
|
|
12986
|
-
class
|
|
13647
|
+
class Triggers extends ClientSDK {
|
|
13648
|
+
/**
|
|
13649
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
13650
|
+
*/
|
|
12987
13651
|
create(params, options) {
|
|
12988
13652
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
12989
|
-
return unwrapAsAPIPromise(
|
|
13653
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
13654
|
+
}
|
|
13655
|
+
/**
|
|
13656
|
+
* Lists triggers for a project.
|
|
13657
|
+
*/
|
|
13658
|
+
list(params, options) {
|
|
13659
|
+
return unwrapAsAPIPromise(triggersList(this, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.filter, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
|
|
12990
13660
|
}
|
|
13661
|
+
/**
|
|
13662
|
+
* Gets details of a single trigger.
|
|
13663
|
+
*/
|
|
12991
13664
|
get(id, params, options) {
|
|
12992
|
-
return unwrapAsAPIPromise(
|
|
13665
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
12993
13666
|
}
|
|
12994
13667
|
/**
|
|
12995
|
-
*
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
13668
|
+
* Updates a trigger.
|
|
13669
|
+
*/
|
|
13670
|
+
update(id, params, options) {
|
|
13671
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
13672
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
13673
|
+
}
|
|
13674
|
+
/**
|
|
13675
|
+
* Deletes a trigger.
|
|
12999
13676
|
*/
|
|
13000
13677
|
delete(id, params, options) {
|
|
13001
|
-
return unwrapAsAPIPromise(
|
|
13678
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13002
13679
|
}
|
|
13003
13680
|
/**
|
|
13004
|
-
*
|
|
13005
|
-
*
|
|
13006
|
-
* @remarks
|
|
13007
|
-
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
13681
|
+
* Runs a trigger immediately.
|
|
13008
13682
|
*/
|
|
13009
|
-
|
|
13010
|
-
return unwrapAsAPIPromise(
|
|
13683
|
+
run(trigger_id, params, options) {
|
|
13684
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13685
|
+
}
|
|
13686
|
+
/**
|
|
13687
|
+
* Lists executions for a trigger.
|
|
13688
|
+
*/
|
|
13689
|
+
listExecutions(trigger_id, params, options) {
|
|
13690
|
+
return unwrapAsAPIPromise(triggersListExecutions(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
|
|
13011
13691
|
}
|
|
13012
13692
|
}
|
|
13013
13693
|
|
|
@@ -13717,6 +14397,10 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
13717
14397
|
var _a;
|
|
13718
14398
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
13719
14399
|
}
|
|
14400
|
+
get triggers() {
|
|
14401
|
+
var _a;
|
|
14402
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
14403
|
+
}
|
|
13720
14404
|
};
|
|
13721
14405
|
|
|
13722
14406
|
/**
|
|
@@ -13748,11 +14432,11 @@ function getGoogleGenAIAPIVersion(parentClient) {
|
|
|
13748
14432
|
return apiVersion;
|
|
13749
14433
|
}
|
|
13750
14434
|
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
13751
|
-
var _a, _b, _c, _d;
|
|
14435
|
+
var _a, _b, _c, _d, _e;
|
|
13752
14436
|
const sdk = new GoogleGenAI$1(Object.assign(Object.assign({}, options), { api_version: (_a = options.api_version) !== null && _a !== void 0 ? _a : getGoogleGenAIAPIVersion(parentClient), security: (_b = options.security) !== null && _b !== void 0 ? _b : new GoogleGenAISecurityProvider({
|
|
13753
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
14437
|
+
defaultHeaders: Object.assign(Object.assign({}, (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient)), (_d = parentClient.getHeaders) === null || _d === void 0 ? void 0 : _d.call(parentClient)),
|
|
13754
14438
|
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
13755
|
-
}), server_url: (
|
|
14439
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
13756
14440
|
return sdk;
|
|
13757
14441
|
}
|
|
13758
14442
|
class GeminiNextGenInteractions {
|
|
@@ -13859,6 +14543,46 @@ class GeminiNextGenWebhooks {
|
|
|
13859
14543
|
return this.sdk;
|
|
13860
14544
|
}
|
|
13861
14545
|
}
|
|
14546
|
+
class GeminiNextGenTriggers {
|
|
14547
|
+
constructor(parentClient) {
|
|
14548
|
+
this.parentClient = parentClient;
|
|
14549
|
+
}
|
|
14550
|
+
async create(params, options) {
|
|
14551
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14552
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14553
|
+
}
|
|
14554
|
+
async list(params = {}, options) {
|
|
14555
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14556
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14557
|
+
}
|
|
14558
|
+
async get(id, params = {}, options) {
|
|
14559
|
+
return unwrapWithSdkHttpResponse(triggersGet(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
14560
|
+
}
|
|
14561
|
+
async update(id, params, options) {
|
|
14562
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14563
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14564
|
+
}
|
|
14565
|
+
async delete(id, params = {}, options) {
|
|
14566
|
+
return unwrapWithSdkHttpResponse(triggersDelete(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
14567
|
+
}
|
|
14568
|
+
async run(trigger_id, params = {}, options) {
|
|
14569
|
+
return unwrapWithSdkHttpResponse(triggersRun(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), trigger_id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
14570
|
+
}
|
|
14571
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
14572
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14573
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14574
|
+
}
|
|
14575
|
+
getClient(apiVersion) {
|
|
14576
|
+
var _a;
|
|
14577
|
+
if (apiVersion) {
|
|
14578
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
14579
|
+
api_version: apiVersion,
|
|
14580
|
+
});
|
|
14581
|
+
}
|
|
14582
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
14583
|
+
return this.sdk;
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
13862
14586
|
function trimSlashes(value) {
|
|
13863
14587
|
return value.replace(/^\/+|\/+$/g, "");
|
|
13864
14588
|
}
|
|
@@ -15646,6 +16370,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
15646
16370
|
if (fromTokenCount != null) {
|
|
15647
16371
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
15648
16372
|
}
|
|
16373
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
16374
|
+
'tokensDetails',
|
|
16375
|
+
]);
|
|
16376
|
+
if (fromTokensDetails != null) {
|
|
16377
|
+
let transformedList = fromTokensDetails;
|
|
16378
|
+
if (Array.isArray(transformedList)) {
|
|
16379
|
+
transformedList = transformedList.map((item) => {
|
|
16380
|
+
return item;
|
|
16381
|
+
});
|
|
16382
|
+
}
|
|
16383
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
16384
|
+
}
|
|
15649
16385
|
return toObject;
|
|
15650
16386
|
}
|
|
15651
16387
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -16275,6 +17011,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
16275
17011
|
usageMetadata['promptTokenCount']) {
|
|
16276
17012
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
16277
17013
|
}
|
|
17014
|
+
if (usageMetadata &&
|
|
17015
|
+
usageMetadata['promptTokensDetails']) {
|
|
17016
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
17017
|
+
}
|
|
16278
17018
|
if (truncated) {
|
|
16279
17019
|
stats.truncated = truncated;
|
|
16280
17020
|
}
|
|
@@ -24554,6 +25294,14 @@ class GoogleGenAI {
|
|
|
24554
25294
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
24555
25295
|
return this._agents;
|
|
24556
25296
|
}
|
|
25297
|
+
get triggers() {
|
|
25298
|
+
if (this._triggers !== undefined) {
|
|
25299
|
+
return this._triggers;
|
|
25300
|
+
}
|
|
25301
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25302
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25303
|
+
return this._triggers;
|
|
25304
|
+
}
|
|
24557
25305
|
constructor(options) {
|
|
24558
25306
|
var _a, _b;
|
|
24559
25307
|
if (options.apiKey == null) {
|