@alicloud/cs20151215 7.2.6 → 7.3.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/client.d.ts CHANGED
@@ -1739,6 +1739,44 @@ export default class Client extends OpenApi {
1739
1739
  * @returns InstallNodePoolComponentsResponse
1740
1740
  */
1741
1741
  installNodePoolComponents(clusterId: string, nodePoolId: string, request: $_model.InstallNodePoolComponentsRequest): Promise<$_model.InstallNodePoolComponentsResponse>;
1742
+ /**
1743
+ * 发起智能助手会话运行(AG-UI 协议)
1744
+ *
1745
+ * @remarks
1746
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
1747
+ *
1748
+ * @param request - InvokeAgentRequest
1749
+ * @param headers - map
1750
+ * @param runtime - runtime options for this request RuntimeOptions
1751
+ * @returns InvokeAgentResponse
1752
+ */
1753
+ invokeAgentWithSSE(request: $_model.InvokeAgentRequest, headers: {
1754
+ [key: string]: string;
1755
+ }, runtime: $dara.RuntimeOptions): AsyncGenerator<$_model.InvokeAgentResponse, any, unknown>;
1756
+ /**
1757
+ * 发起智能助手会话运行(AG-UI 协议)
1758
+ *
1759
+ * @remarks
1760
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
1761
+ *
1762
+ * @param request - InvokeAgentRequest
1763
+ * @param headers - map
1764
+ * @param runtime - runtime options for this request RuntimeOptions
1765
+ * @returns InvokeAgentResponse
1766
+ */
1767
+ invokeAgentWithOptions(request: $_model.InvokeAgentRequest, headers: {
1768
+ [key: string]: string;
1769
+ }, runtime: $dara.RuntimeOptions): Promise<$_model.InvokeAgentResponse>;
1770
+ /**
1771
+ * 发起智能助手会话运行(AG-UI 协议)
1772
+ *
1773
+ * @remarks
1774
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
1775
+ *
1776
+ * @param request - InvokeAgentRequest
1777
+ * @returns InvokeAgentResponse
1778
+ */
1779
+ invokeAgent(request: $_model.InvokeAgentRequest): Promise<$_model.InvokeAgentResponse>;
1742
1780
  /**
1743
1781
  * Queries a list of available components and retrieves detailed component information based on parameters such as the region, cluster type, cluster profile, and cluster version. The detailed information includes whether the component is managed, the schema of supported custom parameters, and compatible operating system architectures.
1744
1782
  *
package/dist/client.js CHANGED
@@ -35,6 +35,26 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
39
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
40
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
41
+ var m = o[Symbol.asyncIterator], i;
42
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
43
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
44
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
45
+ };
46
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
47
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
48
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
49
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
50
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
51
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
52
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
53
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
54
+ function fulfill(value) { resume("next", value); }
55
+ function reject(value) { resume("throw", value); }
56
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
57
+ };
38
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
60
  };
@@ -4625,6 +4645,163 @@ class Client extends openapi_core_1.default {
4625
4645
  let headers = {};
4626
4646
  return await this.installNodePoolComponentsWithOptions(clusterId, nodePoolId, request, headers, runtime);
4627
4647
  }
4648
+ /**
4649
+ * 发起智能助手会话运行(AG-UI 协议)
4650
+ *
4651
+ * @remarks
4652
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
4653
+ *
4654
+ * @param request - InvokeAgentRequest
4655
+ * @param headers - map
4656
+ * @param runtime - runtime options for this request RuntimeOptions
4657
+ * @returns InvokeAgentResponse
4658
+ */
4659
+ invokeAgentWithSSE(request, headers, runtime) {
4660
+ return __asyncGenerator(this, arguments, function* invokeAgentWithSSE_1() {
4661
+ var _a, e_1, _b, _c;
4662
+ request.validate();
4663
+ let body = {};
4664
+ if (!$dara.isNull(request.context)) {
4665
+ body["context"] = request.context;
4666
+ }
4667
+ if (!$dara.isNull(request.forwardedProps)) {
4668
+ body["forwardedProps"] = request.forwardedProps;
4669
+ }
4670
+ if (!$dara.isNull(request.messages)) {
4671
+ body["messages"] = request.messages;
4672
+ }
4673
+ if (!$dara.isNull(request.parentRunId)) {
4674
+ body["parentRunId"] = request.parentRunId;
4675
+ }
4676
+ if (!$dara.isNull(request.resume)) {
4677
+ body["resume"] = request.resume;
4678
+ }
4679
+ if (!$dara.isNull(request.runId)) {
4680
+ body["runId"] = request.runId;
4681
+ }
4682
+ if (!$dara.isNull(request.state)) {
4683
+ body["state"] = request.state;
4684
+ }
4685
+ if (!$dara.isNull(request.threadId)) {
4686
+ body["threadId"] = request.threadId;
4687
+ }
4688
+ if (!$dara.isNull(request.tools)) {
4689
+ body["tools"] = request.tools;
4690
+ }
4691
+ let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
4692
+ headers: headers,
4693
+ body: openapi_core_2.OpenApiUtil.parseToMap(body),
4694
+ });
4695
+ let params = new openapi_core_2.$OpenApiUtil.Params({
4696
+ action: "InvokeAgent",
4697
+ version: "2015-12-15",
4698
+ protocol: "HTTPS",
4699
+ pathname: `/intelligence/invoke`,
4700
+ method: "POST",
4701
+ authType: "AK",
4702
+ style: "ROA",
4703
+ reqBodyType: "json",
4704
+ bodyType: "json",
4705
+ });
4706
+ let sseResp = yield __await(this.callSSEApi(params, req, runtime));
4707
+ try {
4708
+ for (var _d = true, sseResp_1 = __asyncValues(sseResp), sseResp_1_1; sseResp_1_1 = yield __await(sseResp_1.next()), _a = sseResp_1_1.done, !_a; _d = true) {
4709
+ _c = sseResp_1_1.value;
4710
+ _d = false;
4711
+ let resp = _c;
4712
+ if (!$dara.isNull(resp.event) && !$dara.isNull(resp.event.data)) {
4713
+ let data = JSON.parse(resp.event.data);
4714
+ yield yield __await($dara.cast({
4715
+ statusCode: resp.statusCode,
4716
+ headers: resp.headers,
4717
+ id: resp.event.id,
4718
+ event: resp.event.event,
4719
+ body: data,
4720
+ }, new $_model.InvokeAgentResponse({})));
4721
+ }
4722
+ }
4723
+ }
4724
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4725
+ finally {
4726
+ try {
4727
+ if (!_d && !_a && (_b = sseResp_1.return)) yield __await(_b.call(sseResp_1));
4728
+ }
4729
+ finally { if (e_1) throw e_1.error; }
4730
+ }
4731
+ });
4732
+ }
4733
+ /**
4734
+ * 发起智能助手会话运行(AG-UI 协议)
4735
+ *
4736
+ * @remarks
4737
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
4738
+ *
4739
+ * @param request - InvokeAgentRequest
4740
+ * @param headers - map
4741
+ * @param runtime - runtime options for this request RuntimeOptions
4742
+ * @returns InvokeAgentResponse
4743
+ */
4744
+ async invokeAgentWithOptions(request, headers, runtime) {
4745
+ request.validate();
4746
+ let body = {};
4747
+ if (!$dara.isNull(request.context)) {
4748
+ body["context"] = request.context;
4749
+ }
4750
+ if (!$dara.isNull(request.forwardedProps)) {
4751
+ body["forwardedProps"] = request.forwardedProps;
4752
+ }
4753
+ if (!$dara.isNull(request.messages)) {
4754
+ body["messages"] = request.messages;
4755
+ }
4756
+ if (!$dara.isNull(request.parentRunId)) {
4757
+ body["parentRunId"] = request.parentRunId;
4758
+ }
4759
+ if (!$dara.isNull(request.resume)) {
4760
+ body["resume"] = request.resume;
4761
+ }
4762
+ if (!$dara.isNull(request.runId)) {
4763
+ body["runId"] = request.runId;
4764
+ }
4765
+ if (!$dara.isNull(request.state)) {
4766
+ body["state"] = request.state;
4767
+ }
4768
+ if (!$dara.isNull(request.threadId)) {
4769
+ body["threadId"] = request.threadId;
4770
+ }
4771
+ if (!$dara.isNull(request.tools)) {
4772
+ body["tools"] = request.tools;
4773
+ }
4774
+ let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
4775
+ headers: headers,
4776
+ body: openapi_core_2.OpenApiUtil.parseToMap(body),
4777
+ });
4778
+ let params = new openapi_core_2.$OpenApiUtil.Params({
4779
+ action: "InvokeAgent",
4780
+ version: "2015-12-15",
4781
+ protocol: "HTTPS",
4782
+ pathname: `/intelligence/invoke`,
4783
+ method: "POST",
4784
+ authType: "AK",
4785
+ style: "ROA",
4786
+ reqBodyType: "json",
4787
+ bodyType: "json",
4788
+ });
4789
+ return $dara.cast(await this.callApi(params, req, runtime), new $_model.InvokeAgentResponse({}));
4790
+ }
4791
+ /**
4792
+ * 发起智能助手会话运行(AG-UI 协议)
4793
+ *
4794
+ * @remarks
4795
+ * 独立的原生 AG-UI 接口,成功建流后返回 text/event-stream。
4796
+ *
4797
+ * @param request - InvokeAgentRequest
4798
+ * @returns InvokeAgentResponse
4799
+ */
4800
+ async invokeAgent(request) {
4801
+ let runtime = new $dara.RuntimeOptions({});
4802
+ let headers = {};
4803
+ return await this.invokeAgentWithOptions(request, headers, runtime);
4804
+ }
4628
4805
  /**
4629
4806
  * Queries a list of available components and retrieves detailed component information based on parameters such as the region, cluster type, cluster profile, and cluster version. The detailed information includes whether the component is managed, the schema of supported custom parameters, and compatible operating system architectures.
4630
4807
  *