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