@alicloud/dianjin20240628 1.14.0 → 1.15.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/src/client.ts CHANGED
@@ -2525,6 +2525,97 @@ export default class Client extends OpenApi {
2525
2525
  return await this.runChatResultGenerationWithOptions(workspaceId, request, headers, runtime);
2526
2526
  }
2527
2527
 
2528
+ /**
2529
+ * 流式获取外呼会话分析结果
2530
+ *
2531
+ * @param request - RunDialogAnalysisRequest
2532
+ * @param headers - map
2533
+ * @param runtime - runtime options for this request RuntimeOptions
2534
+ * @returns RunDialogAnalysisResponse
2535
+ */
2536
+ async *runDialogAnalysisWithSSE(workspaceId: string, request: $_model.RunDialogAnalysisRequest, headers: {[key: string ]: string}, runtime: $dara.RuntimeOptions): AsyncGenerator<$_model.RunDialogAnalysisResponse, any, unknown> {
2537
+ request.validate();
2538
+ let body : {[key: string ]: any} = { };
2539
+ if (!$dara.isNull(request.sessionId)) {
2540
+ body["sessionId"] = request.sessionId;
2541
+ }
2542
+
2543
+ let req = new $OpenApiUtil.OpenApiRequest({
2544
+ headers: headers,
2545
+ body: OpenApiUtil.parseToMap(body),
2546
+ });
2547
+ let params = new $OpenApiUtil.Params({
2548
+ action: "RunDialogAnalysis",
2549
+ version: "2024-06-28",
2550
+ protocol: "HTTPS",
2551
+ pathname: `/${$dara.URL.percentEncode(workspaceId)}/api/virtualHuman/dialog/stream/analysis`,
2552
+ method: "POST",
2553
+ authType: "AK",
2554
+ style: "ROA",
2555
+ reqBodyType: "json",
2556
+ bodyType: "json",
2557
+ });
2558
+ let sseResp = await this.callSSEApi(params, req, runtime);
2559
+
2560
+ for await (let resp of sseResp) {
2561
+ let data = JSON.parse(resp.event.data);
2562
+ yield $dara.cast<$_model.RunDialogAnalysisResponse>({
2563
+ statusCode: resp.statusCode,
2564
+ headers: resp.headers,
2565
+ body: {
2566
+ ...data,
2567
+ RequestId: resp.event.id,
2568
+ Message: resp.event.event,
2569
+ },
2570
+ }, new $_model.RunDialogAnalysisResponse({}));
2571
+ }
2572
+ }
2573
+
2574
+ /**
2575
+ * 流式获取外呼会话分析结果
2576
+ *
2577
+ * @param request - RunDialogAnalysisRequest
2578
+ * @param headers - map
2579
+ * @param runtime - runtime options for this request RuntimeOptions
2580
+ * @returns RunDialogAnalysisResponse
2581
+ */
2582
+ async runDialogAnalysisWithOptions(workspaceId: string, request: $_model.RunDialogAnalysisRequest, headers: {[key: string ]: string}, runtime: $dara.RuntimeOptions): Promise<$_model.RunDialogAnalysisResponse> {
2583
+ request.validate();
2584
+ let body : {[key: string ]: any} = { };
2585
+ if (!$dara.isNull(request.sessionId)) {
2586
+ body["sessionId"] = request.sessionId;
2587
+ }
2588
+
2589
+ let req = new $OpenApiUtil.OpenApiRequest({
2590
+ headers: headers,
2591
+ body: OpenApiUtil.parseToMap(body),
2592
+ });
2593
+ let params = new $OpenApiUtil.Params({
2594
+ action: "RunDialogAnalysis",
2595
+ version: "2024-06-28",
2596
+ protocol: "HTTPS",
2597
+ pathname: `/${$dara.URL.percentEncode(workspaceId)}/api/virtualHuman/dialog/stream/analysis`,
2598
+ method: "POST",
2599
+ authType: "AK",
2600
+ style: "ROA",
2601
+ reqBodyType: "json",
2602
+ bodyType: "json",
2603
+ });
2604
+ return $dara.cast<$_model.RunDialogAnalysisResponse>(await this.callApi(params, req, runtime), new $_model.RunDialogAnalysisResponse({}));
2605
+ }
2606
+
2607
+ /**
2608
+ * 流式获取外呼会话分析结果
2609
+ *
2610
+ * @param request - RunDialogAnalysisRequest
2611
+ * @returns RunDialogAnalysisResponse
2612
+ */
2613
+ async runDialogAnalysis(workspaceId: string, request: $_model.RunDialogAnalysisRequest): Promise<$_model.RunDialogAnalysisResponse> {
2614
+ let runtime = new $dara.RuntimeOptions({ });
2615
+ let headers : {[key: string ]: string} = { };
2616
+ return await this.runDialogAnalysisWithOptions(workspaceId, request, headers, runtime);
2617
+ }
2618
+
2528
2619
  /**
2529
2620
  * 获取生成式对话结果
2530
2621
  *
@@ -0,0 +1,34 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+
4
+
5
+ export class RunDialogAnalysisRequest extends $dara.Model {
6
+ /**
7
+ * @remarks
8
+ * This parameter is required.
9
+ *
10
+ * @example
11
+ * 1759457905S001vejpvd6vej
12
+ */
13
+ sessionId?: string;
14
+ static names(): { [key: string]: string } {
15
+ return {
16
+ sessionId: 'sessionId',
17
+ };
18
+ }
19
+
20
+ static types(): { [key: string]: any } {
21
+ return {
22
+ sessionId: 'string',
23
+ };
24
+ }
25
+
26
+ validate() {
27
+ super.validate();
28
+ }
29
+
30
+ constructor(map?: { [key: string]: any }) {
31
+ super(map);
32
+ }
33
+ }
34
+
@@ -0,0 +1,40 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+ import { RunDialogAnalysisResponseBody } from "./RunDialogAnalysisResponseBody";
4
+
5
+
6
+ export class RunDialogAnalysisResponse extends $dara.Model {
7
+ headers?: { [key: string]: string };
8
+ statusCode?: number;
9
+ body?: RunDialogAnalysisResponseBody;
10
+ static names(): { [key: string]: string } {
11
+ return {
12
+ headers: 'headers',
13
+ statusCode: 'statusCode',
14
+ body: 'body',
15
+ };
16
+ }
17
+
18
+ static types(): { [key: string]: any } {
19
+ return {
20
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
21
+ statusCode: 'number',
22
+ body: RunDialogAnalysisResponseBody,
23
+ };
24
+ }
25
+
26
+ validate() {
27
+ if(this.headers) {
28
+ $dara.Model.validateMap(this.headers);
29
+ }
30
+ if(this.body && typeof (this.body as any).validate === 'function') {
31
+ (this.body as any).validate();
32
+ }
33
+ super.validate();
34
+ }
35
+
36
+ constructor(map?: { [key: string]: any }) {
37
+ super(map);
38
+ }
39
+ }
40
+
@@ -0,0 +1,231 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+
4
+
5
+ export class RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisRespDialogLabels extends $dara.Model {
6
+ name?: string;
7
+ value?: string;
8
+ static names(): { [key: string]: string } {
9
+ return {
10
+ name: 'name',
11
+ value: 'value',
12
+ };
13
+ }
14
+
15
+ static types(): { [key: string]: any } {
16
+ return {
17
+ name: 'string',
18
+ value: 'string',
19
+ };
20
+ }
21
+
22
+ validate() {
23
+ super.validate();
24
+ }
25
+
26
+ constructor(map?: { [key: string]: any }) {
27
+ super(map);
28
+ }
29
+ }
30
+
31
+ export class RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisResp extends $dara.Model {
32
+ dialogExecPlan?: string;
33
+ dialogLabels?: RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisRespDialogLabels[];
34
+ dialogOpenAnalysis?: { [key: string]: any };
35
+ dialogProcessAnalysis?: { [key: string]: any };
36
+ dialogSop?: string;
37
+ dialogSummary?: string;
38
+ static names(): { [key: string]: string } {
39
+ return {
40
+ dialogExecPlan: 'dialogExecPlan',
41
+ dialogLabels: 'dialogLabels',
42
+ dialogOpenAnalysis: 'dialogOpenAnalysis',
43
+ dialogProcessAnalysis: 'dialogProcessAnalysis',
44
+ dialogSop: 'dialogSop',
45
+ dialogSummary: 'dialogSummary',
46
+ };
47
+ }
48
+
49
+ static types(): { [key: string]: any } {
50
+ return {
51
+ dialogExecPlan: 'string',
52
+ dialogLabels: { 'type': 'array', 'itemType': RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisRespDialogLabels },
53
+ dialogOpenAnalysis: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
54
+ dialogProcessAnalysis: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
55
+ dialogSop: 'string',
56
+ dialogSummary: 'string',
57
+ };
58
+ }
59
+
60
+ validate() {
61
+ if(Array.isArray(this.dialogLabels)) {
62
+ $dara.Model.validateArray(this.dialogLabels);
63
+ }
64
+ if(this.dialogOpenAnalysis) {
65
+ $dara.Model.validateMap(this.dialogOpenAnalysis);
66
+ }
67
+ if(this.dialogProcessAnalysis) {
68
+ $dara.Model.validateMap(this.dialogProcessAnalysis);
69
+ }
70
+ super.validate();
71
+ }
72
+
73
+ constructor(map?: { [key: string]: any }) {
74
+ super(map);
75
+ }
76
+ }
77
+
78
+ export class RunDialogAnalysisResponseBodyDataDialogAnalysisRespList extends $dara.Model {
79
+ analysisResp?: RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisResp;
80
+ failNode?: string[];
81
+ /**
82
+ * @example
83
+ * 2024-04-24 11:54:34
84
+ */
85
+ gmtCreate?: string;
86
+ /**
87
+ * @example
88
+ * 1759457905S001vejpvd6vej
89
+ */
90
+ sessionId?: string;
91
+ /**
92
+ * @example
93
+ * success
94
+ */
95
+ status?: string;
96
+ static names(): { [key: string]: string } {
97
+ return {
98
+ analysisResp: 'analysisResp',
99
+ failNode: 'failNode',
100
+ gmtCreate: 'gmtCreate',
101
+ sessionId: 'sessionId',
102
+ status: 'status',
103
+ };
104
+ }
105
+
106
+ static types(): { [key: string]: any } {
107
+ return {
108
+ analysisResp: RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisResp,
109
+ failNode: { 'type': 'array', 'itemType': 'string' },
110
+ gmtCreate: 'string',
111
+ sessionId: 'string',
112
+ status: 'string',
113
+ };
114
+ }
115
+
116
+ validate() {
117
+ if(this.analysisResp && typeof (this.analysisResp as any).validate === 'function') {
118
+ (this.analysisResp as any).validate();
119
+ }
120
+ if(Array.isArray(this.failNode)) {
121
+ $dara.Model.validateArray(this.failNode);
122
+ }
123
+ super.validate();
124
+ }
125
+
126
+ constructor(map?: { [key: string]: any }) {
127
+ super(map);
128
+ }
129
+ }
130
+
131
+ export class RunDialogAnalysisResponseBodyData extends $dara.Model {
132
+ dialogAnalysisRespList?: RunDialogAnalysisResponseBodyDataDialogAnalysisRespList[];
133
+ static names(): { [key: string]: string } {
134
+ return {
135
+ dialogAnalysisRespList: 'dialogAnalysisRespList',
136
+ };
137
+ }
138
+
139
+ static types(): { [key: string]: any } {
140
+ return {
141
+ dialogAnalysisRespList: { 'type': 'array', 'itemType': RunDialogAnalysisResponseBodyDataDialogAnalysisRespList },
142
+ };
143
+ }
144
+
145
+ validate() {
146
+ if(Array.isArray(this.dialogAnalysisRespList)) {
147
+ $dara.Model.validateArray(this.dialogAnalysisRespList);
148
+ }
149
+ super.validate();
150
+ }
151
+
152
+ constructor(map?: { [key: string]: any }) {
153
+ super(map);
154
+ }
155
+ }
156
+
157
+ export class RunDialogAnalysisResponseBody extends $dara.Model {
158
+ /**
159
+ * @example
160
+ * null
161
+ */
162
+ cost?: number;
163
+ data?: RunDialogAnalysisResponseBodyData;
164
+ /**
165
+ * @example
166
+ * null
167
+ */
168
+ dataType?: string;
169
+ /**
170
+ * @example
171
+ * 0
172
+ */
173
+ errCode?: string;
174
+ /**
175
+ * @example
176
+ * ok
177
+ */
178
+ message?: string;
179
+ /**
180
+ * @example
181
+ * 02CD4454-3F2C-57D0-9060-68DEAA1F6993
182
+ */
183
+ requestId?: string;
184
+ /**
185
+ * @example
186
+ * true
187
+ */
188
+ success?: boolean;
189
+ /**
190
+ * @example
191
+ * 2024-04-24 11:54:34
192
+ */
193
+ time?: string;
194
+ static names(): { [key: string]: string } {
195
+ return {
196
+ cost: 'cost',
197
+ data: 'data',
198
+ dataType: 'dataType',
199
+ errCode: 'errCode',
200
+ message: 'message',
201
+ requestId: 'requestId',
202
+ success: 'success',
203
+ time: 'time',
204
+ };
205
+ }
206
+
207
+ static types(): { [key: string]: any } {
208
+ return {
209
+ cost: 'number',
210
+ data: RunDialogAnalysisResponseBodyData,
211
+ dataType: 'string',
212
+ errCode: 'string',
213
+ message: 'string',
214
+ requestId: 'string',
215
+ success: 'boolean',
216
+ time: 'string',
217
+ };
218
+ }
219
+
220
+ validate() {
221
+ if(this.data && typeof (this.data as any).validate === 'function') {
222
+ (this.data as any).validate();
223
+ }
224
+ super.validate();
225
+ }
226
+
227
+ constructor(map?: { [key: string]: any }) {
228
+ super(map);
229
+ }
230
+ }
231
+
@@ -105,6 +105,10 @@ export { RunChatResultGenerationRequestTools } from './RunChatResultGenerationRe
105
105
  export { RunChatResultGenerationResponseBodyChoicesMessage } from './RunChatResultGenerationResponseBody';
106
106
  export { RunChatResultGenerationResponseBodyChoices } from './RunChatResultGenerationResponseBody';
107
107
  export { RunChatResultGenerationResponseBodyUsage } from './RunChatResultGenerationResponseBody';
108
+ export { RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisRespDialogLabels } from './RunDialogAnalysisResponseBody';
109
+ export { RunDialogAnalysisResponseBodyDataDialogAnalysisRespListAnalysisResp } from './RunDialogAnalysisResponseBody';
110
+ export { RunDialogAnalysisResponseBodyDataDialogAnalysisRespList } from './RunDialogAnalysisResponseBody';
111
+ export { RunDialogAnalysisResponseBodyData } from './RunDialogAnalysisResponseBody';
108
112
  export { RunLibraryChatGenerationRequestQueryCriteriaAnd } from './RunLibraryChatGenerationRequest';
109
113
  export { RunLibraryChatGenerationRequestQueryCriteriaOr } from './RunLibraryChatGenerationRequest';
110
114
  export { RunLibraryChatGenerationRequestQueryCriteria } from './RunLibraryChatGenerationRequest';
@@ -241,6 +245,9 @@ export { RunAgentResponse } from './RunAgentResponse';
241
245
  export { RunChatResultGenerationRequest } from './RunChatResultGenerationRequest';
242
246
  export { RunChatResultGenerationResponseBody } from './RunChatResultGenerationResponseBody';
243
247
  export { RunChatResultGenerationResponse } from './RunChatResultGenerationResponse';
248
+ export { RunDialogAnalysisRequest } from './RunDialogAnalysisRequest';
249
+ export { RunDialogAnalysisResponseBody } from './RunDialogAnalysisResponseBody';
250
+ export { RunDialogAnalysisResponse } from './RunDialogAnalysisResponse';
244
251
  export { RunLibraryChatGenerationRequest } from './RunLibraryChatGenerationRequest';
245
252
  export { RunLibraryChatGenerationResponseBody } from './RunLibraryChatGenerationResponseBody';
246
253
  export { RunLibraryChatGenerationResponse } from './RunLibraryChatGenerationResponse';