huaweicloudsdkversatile 3.1.184__py3-none-any.whl

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.
Files changed (35) hide show
  1. huaweicloudsdkversatile/__init__.py +0 -0
  2. huaweicloudsdkversatile/v1/__init__.py +32 -0
  3. huaweicloudsdkversatile/v1/model/__init__.py +29 -0
  4. huaweicloudsdkversatile/v1/model/agent_run_req.py +302 -0
  5. huaweicloudsdkversatile/v1/model/conversation.py +129 -0
  6. huaweicloudsdkversatile/v1/model/feedback_reason.py +136 -0
  7. huaweicloudsdkversatile/v1/model/knowledge_base_retrieval_req.py +251 -0
  8. huaweicloudsdkversatile/v1/model/message.py +506 -0
  9. huaweicloudsdkversatile/v1/model/node_message.py +282 -0
  10. huaweicloudsdkversatile/v1/model/node_run_info.py +709 -0
  11. huaweicloudsdkversatile/v1/model/node_run_info_inner_error.py +133 -0
  12. huaweicloudsdkversatile/v1/model/node_run_info_inner_error_error_body.py +137 -0
  13. huaweicloudsdkversatile/v1/model/plugin_config.py +137 -0
  14. huaweicloudsdkversatile/v1/model/retrieval_result_info.py +282 -0
  15. huaweicloudsdkversatile/v1/model/run_agent_request.py +276 -0
  16. huaweicloudsdkversatile/v1/model/run_agent_response.py +378 -0
  17. huaweicloudsdkversatile/v1/model/run_workflow_request.py +247 -0
  18. huaweicloudsdkversatile/v1/model/run_workflow_response.py +378 -0
  19. huaweicloudsdkversatile/v1/model/search_knowledge_base_request.py +104 -0
  20. huaweicloudsdkversatile/v1/model/search_knowledge_base_response.py +141 -0
  21. huaweicloudsdkversatile/v1/model/status.py +135 -0
  22. huaweicloudsdkversatile/v1/model/upload_agent_file_request.py +190 -0
  23. huaweicloudsdkversatile/v1/model/upload_agent_file_request_body.py +107 -0
  24. huaweicloudsdkversatile/v1/model/upload_agent_file_response.py +170 -0
  25. huaweicloudsdkversatile/v1/model/user_profile.py +137 -0
  26. huaweicloudsdkversatile/v1/model/workflow_run_req.py +344 -0
  27. huaweicloudsdkversatile/v1/model/workflow_run_stream_rsp.py +195 -0
  28. huaweicloudsdkversatile/v1/region/__init__.py +0 -0
  29. huaweicloudsdkversatile/v1/region/versatile_region.py +31 -0
  30. huaweicloudsdkversatile/v1/versatile_async_client.py +378 -0
  31. huaweicloudsdkversatile/v1/versatile_client.py +375 -0
  32. huaweicloudsdkversatile-3.1.184.dist-info/METADATA +25 -0
  33. huaweicloudsdkversatile-3.1.184.dist-info/RECORD +35 -0
  34. huaweicloudsdkversatile-3.1.184.dist-info/WHEEL +4 -0
  35. huaweicloudsdkversatile-3.1.184.dist-info/licenses/LICENSE +13 -0
@@ -0,0 +1,506 @@
1
+ # coding: utf-8
2
+
3
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
4
+
5
+
6
+ class Message:
7
+
8
+ """
9
+ Attributes:
10
+ openapi_types (dict): The key is attribute name
11
+ and the value is attribute type.
12
+ attribute_map (dict): The key is attribute name
13
+ and the value is json key in definition.
14
+ """
15
+ sensitive_list = []
16
+
17
+ openapi_types = {
18
+ 'role': 'str',
19
+ 'content': 'str',
20
+ 'create_time': 'int',
21
+ 'name': 'object',
22
+ 'function_call': 'object',
23
+ 'tool_calls': 'object',
24
+ 'tool_call_id': 'object',
25
+ 'enable_history': 'bool',
26
+ 'intent': 'list[str]',
27
+ 'execution_id': 'str',
28
+ 'node_id': 'str',
29
+ 'agent_id': 'str',
30
+ 'rating': 'int',
31
+ 'files': 'list[object]',
32
+ 'reason': 'FeedbackReason'
33
+ }
34
+
35
+ attribute_map = {
36
+ 'role': 'role',
37
+ 'content': 'content',
38
+ 'create_time': 'create_time',
39
+ 'name': 'name',
40
+ 'function_call': 'function_call',
41
+ 'tool_calls': 'tool_calls',
42
+ 'tool_call_id': 'tool_call_id',
43
+ 'enable_history': 'enable_history',
44
+ 'intent': 'intent',
45
+ 'execution_id': 'execution_id',
46
+ 'node_id': 'node_id',
47
+ 'agent_id': 'agent_id',
48
+ 'rating': 'rating',
49
+ 'files': 'files',
50
+ 'reason': 'reason'
51
+ }
52
+
53
+ def __init__(self, role=None, content=None, create_time=None, name=None, function_call=None, tool_calls=None, tool_call_id=None, enable_history=None, intent=None, execution_id=None, node_id=None, agent_id=None, rating=None, files=None, reason=None):
54
+ r"""Message
55
+
56
+ The model defined in huaweicloud sdk
57
+
58
+ :param role: 角色
59
+ :type role: str
60
+ :param content: 内容
61
+ :type content: str
62
+ :param create_time: 时间戳
63
+ :type create_time: int
64
+ :param name: 工具名称
65
+ :type name: object
66
+ :param function_call: 工具调用信息
67
+ :type function_call: object
68
+ :param tool_calls: 工具调用信息
69
+ :type tool_calls: object
70
+ :param tool_call_id: 工具调用ID信息
71
+ :type tool_call_id: object
72
+ :param enable_history: 是否开启会话历史
73
+ :type enable_history: bool
74
+ :param intent:
75
+ :type intent: list[str]
76
+ :param execution_id: 对话ID
77
+ :type execution_id: str
78
+ :param node_id: 节点ID
79
+ :type node_id: str
80
+ :param agent_id: agent id
81
+ :type agent_id: str
82
+ :param rating: 评分,-1(点赞)、1(点踩)
83
+ :type rating: int
84
+ :param files: 多模态文件列表
85
+ :type files: list[object]
86
+ :param reason:
87
+ :type reason: :class:`huaweicloudsdkversatile.v1.FeedbackReason`
88
+ """
89
+
90
+
91
+
92
+ self._role = None
93
+ self._content = None
94
+ self._create_time = None
95
+ self._name = None
96
+ self._function_call = None
97
+ self._tool_calls = None
98
+ self._tool_call_id = None
99
+ self._enable_history = None
100
+ self._intent = None
101
+ self._execution_id = None
102
+ self._node_id = None
103
+ self._agent_id = None
104
+ self._rating = None
105
+ self._files = None
106
+ self._reason = None
107
+ self.discriminator = None
108
+
109
+ if role is not None:
110
+ self.role = role
111
+ if content is not None:
112
+ self.content = content
113
+ if create_time is not None:
114
+ self.create_time = create_time
115
+ if name is not None:
116
+ self.name = name
117
+ if function_call is not None:
118
+ self.function_call = function_call
119
+ if tool_calls is not None:
120
+ self.tool_calls = tool_calls
121
+ if tool_call_id is not None:
122
+ self.tool_call_id = tool_call_id
123
+ if enable_history is not None:
124
+ self.enable_history = enable_history
125
+ if intent is not None:
126
+ self.intent = intent
127
+ if execution_id is not None:
128
+ self.execution_id = execution_id
129
+ if node_id is not None:
130
+ self.node_id = node_id
131
+ if agent_id is not None:
132
+ self.agent_id = agent_id
133
+ if rating is not None:
134
+ self.rating = rating
135
+ if files is not None:
136
+ self.files = files
137
+ if reason is not None:
138
+ self.reason = reason
139
+
140
+ @property
141
+ def role(self):
142
+ r"""Gets the role of this Message.
143
+
144
+ 角色
145
+
146
+ :return: The role of this Message.
147
+ :rtype: str
148
+ """
149
+ return self._role
150
+
151
+ @role.setter
152
+ def role(self, role):
153
+ r"""Sets the role of this Message.
154
+
155
+ 角色
156
+
157
+ :param role: The role of this Message.
158
+ :type role: str
159
+ """
160
+ self._role = role
161
+
162
+ @property
163
+ def content(self):
164
+ r"""Gets the content of this Message.
165
+
166
+ 内容
167
+
168
+ :return: The content of this Message.
169
+ :rtype: str
170
+ """
171
+ return self._content
172
+
173
+ @content.setter
174
+ def content(self, content):
175
+ r"""Sets the content of this Message.
176
+
177
+ 内容
178
+
179
+ :param content: The content of this Message.
180
+ :type content: str
181
+ """
182
+ self._content = content
183
+
184
+ @property
185
+ def create_time(self):
186
+ r"""Gets the create_time of this Message.
187
+
188
+ 时间戳
189
+
190
+ :return: The create_time of this Message.
191
+ :rtype: int
192
+ """
193
+ return self._create_time
194
+
195
+ @create_time.setter
196
+ def create_time(self, create_time):
197
+ r"""Sets the create_time of this Message.
198
+
199
+ 时间戳
200
+
201
+ :param create_time: The create_time of this Message.
202
+ :type create_time: int
203
+ """
204
+ self._create_time = create_time
205
+
206
+ @property
207
+ def name(self):
208
+ r"""Gets the name of this Message.
209
+
210
+ 工具名称
211
+
212
+ :return: The name of this Message.
213
+ :rtype: object
214
+ """
215
+ return self._name
216
+
217
+ @name.setter
218
+ def name(self, name):
219
+ r"""Sets the name of this Message.
220
+
221
+ 工具名称
222
+
223
+ :param name: The name of this Message.
224
+ :type name: object
225
+ """
226
+ self._name = name
227
+
228
+ @property
229
+ def function_call(self):
230
+ r"""Gets the function_call of this Message.
231
+
232
+ 工具调用信息
233
+
234
+ :return: The function_call of this Message.
235
+ :rtype: object
236
+ """
237
+ return self._function_call
238
+
239
+ @function_call.setter
240
+ def function_call(self, function_call):
241
+ r"""Sets the function_call of this Message.
242
+
243
+ 工具调用信息
244
+
245
+ :param function_call: The function_call of this Message.
246
+ :type function_call: object
247
+ """
248
+ self._function_call = function_call
249
+
250
+ @property
251
+ def tool_calls(self):
252
+ r"""Gets the tool_calls of this Message.
253
+
254
+ 工具调用信息
255
+
256
+ :return: The tool_calls of this Message.
257
+ :rtype: object
258
+ """
259
+ return self._tool_calls
260
+
261
+ @tool_calls.setter
262
+ def tool_calls(self, tool_calls):
263
+ r"""Sets the tool_calls of this Message.
264
+
265
+ 工具调用信息
266
+
267
+ :param tool_calls: The tool_calls of this Message.
268
+ :type tool_calls: object
269
+ """
270
+ self._tool_calls = tool_calls
271
+
272
+ @property
273
+ def tool_call_id(self):
274
+ r"""Gets the tool_call_id of this Message.
275
+
276
+ 工具调用ID信息
277
+
278
+ :return: The tool_call_id of this Message.
279
+ :rtype: object
280
+ """
281
+ return self._tool_call_id
282
+
283
+ @tool_call_id.setter
284
+ def tool_call_id(self, tool_call_id):
285
+ r"""Sets the tool_call_id of this Message.
286
+
287
+ 工具调用ID信息
288
+
289
+ :param tool_call_id: The tool_call_id of this Message.
290
+ :type tool_call_id: object
291
+ """
292
+ self._tool_call_id = tool_call_id
293
+
294
+ @property
295
+ def enable_history(self):
296
+ r"""Gets the enable_history of this Message.
297
+
298
+ 是否开启会话历史
299
+
300
+ :return: The enable_history of this Message.
301
+ :rtype: bool
302
+ """
303
+ return self._enable_history
304
+
305
+ @enable_history.setter
306
+ def enable_history(self, enable_history):
307
+ r"""Sets the enable_history of this Message.
308
+
309
+ 是否开启会话历史
310
+
311
+ :param enable_history: The enable_history of this Message.
312
+ :type enable_history: bool
313
+ """
314
+ self._enable_history = enable_history
315
+
316
+ @property
317
+ def intent(self):
318
+ r"""Gets the intent of this Message.
319
+
320
+ :return: The intent of this Message.
321
+ :rtype: list[str]
322
+ """
323
+ return self._intent
324
+
325
+ @intent.setter
326
+ def intent(self, intent):
327
+ r"""Sets the intent of this Message.
328
+
329
+ :param intent: The intent of this Message.
330
+ :type intent: list[str]
331
+ """
332
+ self._intent = intent
333
+
334
+ @property
335
+ def execution_id(self):
336
+ r"""Gets the execution_id of this Message.
337
+
338
+ 对话ID
339
+
340
+ :return: The execution_id of this Message.
341
+ :rtype: str
342
+ """
343
+ return self._execution_id
344
+
345
+ @execution_id.setter
346
+ def execution_id(self, execution_id):
347
+ r"""Sets the execution_id of this Message.
348
+
349
+ 对话ID
350
+
351
+ :param execution_id: The execution_id of this Message.
352
+ :type execution_id: str
353
+ """
354
+ self._execution_id = execution_id
355
+
356
+ @property
357
+ def node_id(self):
358
+ r"""Gets the node_id of this Message.
359
+
360
+ 节点ID
361
+
362
+ :return: The node_id of this Message.
363
+ :rtype: str
364
+ """
365
+ return self._node_id
366
+
367
+ @node_id.setter
368
+ def node_id(self, node_id):
369
+ r"""Sets the node_id of this Message.
370
+
371
+ 节点ID
372
+
373
+ :param node_id: The node_id of this Message.
374
+ :type node_id: str
375
+ """
376
+ self._node_id = node_id
377
+
378
+ @property
379
+ def agent_id(self):
380
+ r"""Gets the agent_id of this Message.
381
+
382
+ agent id
383
+
384
+ :return: The agent_id of this Message.
385
+ :rtype: str
386
+ """
387
+ return self._agent_id
388
+
389
+ @agent_id.setter
390
+ def agent_id(self, agent_id):
391
+ r"""Sets the agent_id of this Message.
392
+
393
+ agent id
394
+
395
+ :param agent_id: The agent_id of this Message.
396
+ :type agent_id: str
397
+ """
398
+ self._agent_id = agent_id
399
+
400
+ @property
401
+ def rating(self):
402
+ r"""Gets the rating of this Message.
403
+
404
+ 评分,-1(点赞)、1(点踩)
405
+
406
+ :return: The rating of this Message.
407
+ :rtype: int
408
+ """
409
+ return self._rating
410
+
411
+ @rating.setter
412
+ def rating(self, rating):
413
+ r"""Sets the rating of this Message.
414
+
415
+ 评分,-1(点赞)、1(点踩)
416
+
417
+ :param rating: The rating of this Message.
418
+ :type rating: int
419
+ """
420
+ self._rating = rating
421
+
422
+ @property
423
+ def files(self):
424
+ r"""Gets the files of this Message.
425
+
426
+ 多模态文件列表
427
+
428
+ :return: The files of this Message.
429
+ :rtype: list[object]
430
+ """
431
+ return self._files
432
+
433
+ @files.setter
434
+ def files(self, files):
435
+ r"""Sets the files of this Message.
436
+
437
+ 多模态文件列表
438
+
439
+ :param files: The files of this Message.
440
+ :type files: list[object]
441
+ """
442
+ self._files = files
443
+
444
+ @property
445
+ def reason(self):
446
+ r"""Gets the reason of this Message.
447
+
448
+ :return: The reason of this Message.
449
+ :rtype: :class:`huaweicloudsdkversatile.v1.FeedbackReason`
450
+ """
451
+ return self._reason
452
+
453
+ @reason.setter
454
+ def reason(self, reason):
455
+ r"""Sets the reason of this Message.
456
+
457
+ :param reason: The reason of this Message.
458
+ :type reason: :class:`huaweicloudsdkversatile.v1.FeedbackReason`
459
+ """
460
+ self._reason = reason
461
+
462
+ def to_dict(self):
463
+ result = {}
464
+
465
+ for attr, _ in self.openapi_types.items():
466
+ value = getattr(self, attr)
467
+ if isinstance(value, list):
468
+ result[attr] = list(map(
469
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
470
+ value
471
+ ))
472
+ elif hasattr(value, "to_dict"):
473
+ result[attr] = value.to_dict()
474
+ elif isinstance(value, dict):
475
+ result[attr] = dict(map(
476
+ lambda item: (item[0], item[1].to_dict())
477
+ if hasattr(item[1], "to_dict") else item,
478
+ value.items()
479
+ ))
480
+ else:
481
+ if attr in self.sensitive_list:
482
+ result[attr] = "****"
483
+ else:
484
+ result[attr] = value
485
+
486
+ return result
487
+
488
+ def to_str(self):
489
+ """Returns the string representation of the model"""
490
+ import simplejson as json
491
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
492
+
493
+ def __repr__(self):
494
+ """For `print`"""
495
+ return self.to_str()
496
+
497
+ def __eq__(self, other):
498
+ """Returns true if both objects are equal"""
499
+ if not isinstance(other, Message):
500
+ return False
501
+
502
+ return self.__dict__ == other.__dict__
503
+
504
+ def __ne__(self, other):
505
+ """Returns true if both objects are not equal"""
506
+ return not self == other