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