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.
- huaweicloudsdkversatile/__init__.py +0 -0
- huaweicloudsdkversatile/v1/__init__.py +32 -0
- huaweicloudsdkversatile/v1/model/__init__.py +29 -0
- huaweicloudsdkversatile/v1/model/agent_run_req.py +302 -0
- huaweicloudsdkversatile/v1/model/conversation.py +129 -0
- huaweicloudsdkversatile/v1/model/feedback_reason.py +136 -0
- huaweicloudsdkversatile/v1/model/knowledge_base_retrieval_req.py +251 -0
- huaweicloudsdkversatile/v1/model/message.py +506 -0
- huaweicloudsdkversatile/v1/model/node_message.py +282 -0
- huaweicloudsdkversatile/v1/model/node_run_info.py +709 -0
- huaweicloudsdkversatile/v1/model/node_run_info_inner_error.py +133 -0
- huaweicloudsdkversatile/v1/model/node_run_info_inner_error_error_body.py +137 -0
- huaweicloudsdkversatile/v1/model/plugin_config.py +137 -0
- huaweicloudsdkversatile/v1/model/retrieval_result_info.py +282 -0
- huaweicloudsdkversatile/v1/model/run_agent_request.py +276 -0
- huaweicloudsdkversatile/v1/model/run_agent_response.py +378 -0
- huaweicloudsdkversatile/v1/model/run_workflow_request.py +247 -0
- huaweicloudsdkversatile/v1/model/run_workflow_response.py +378 -0
- huaweicloudsdkversatile/v1/model/search_knowledge_base_request.py +104 -0
- huaweicloudsdkversatile/v1/model/search_knowledge_base_response.py +141 -0
- huaweicloudsdkversatile/v1/model/status.py +135 -0
- huaweicloudsdkversatile/v1/model/upload_agent_file_request.py +190 -0
- huaweicloudsdkversatile/v1/model/upload_agent_file_request_body.py +107 -0
- huaweicloudsdkversatile/v1/model/upload_agent_file_response.py +170 -0
- huaweicloudsdkversatile/v1/model/user_profile.py +137 -0
- huaweicloudsdkversatile/v1/model/workflow_run_req.py +344 -0
- huaweicloudsdkversatile/v1/model/workflow_run_stream_rsp.py +195 -0
- huaweicloudsdkversatile/v1/region/__init__.py +0 -0
- huaweicloudsdkversatile/v1/region/versatile_region.py +31 -0
- huaweicloudsdkversatile/v1/versatile_async_client.py +378 -0
- huaweicloudsdkversatile/v1/versatile_client.py +375 -0
- huaweicloudsdkversatile-3.1.184.dist-info/METADATA +25 -0
- huaweicloudsdkversatile-3.1.184.dist-info/RECORD +35 -0
- huaweicloudsdkversatile-3.1.184.dist-info/WHEEL +4 -0
- huaweicloudsdkversatile-3.1.184.dist-info/licenses/LICENSE +13 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class NodeRunInfoInnerError:
|
|
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
|
+
'is_success': 'bool',
|
|
19
|
+
'error_body': 'NodeRunInfoInnerErrorErrorBody'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
attribute_map = {
|
|
23
|
+
'is_success': 'is_success',
|
|
24
|
+
'error_body': 'error_body'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def __init__(self, is_success=None, error_body=None):
|
|
28
|
+
r"""NodeRunInfoInnerError
|
|
29
|
+
|
|
30
|
+
The model defined in huaweicloud sdk
|
|
31
|
+
|
|
32
|
+
:param is_success: 是否成功
|
|
33
|
+
:type is_success: bool
|
|
34
|
+
:param error_body:
|
|
35
|
+
:type error_body: :class:`huaweicloudsdkversatile.v1.NodeRunInfoInnerErrorErrorBody`
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
self._is_success = None
|
|
41
|
+
self._error_body = None
|
|
42
|
+
self.discriminator = None
|
|
43
|
+
|
|
44
|
+
if is_success is not None:
|
|
45
|
+
self.is_success = is_success
|
|
46
|
+
if error_body is not None:
|
|
47
|
+
self.error_body = error_body
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def is_success(self):
|
|
51
|
+
r"""Gets the is_success of this NodeRunInfoInnerError.
|
|
52
|
+
|
|
53
|
+
是否成功
|
|
54
|
+
|
|
55
|
+
:return: The is_success of this NodeRunInfoInnerError.
|
|
56
|
+
:rtype: bool
|
|
57
|
+
"""
|
|
58
|
+
return self._is_success
|
|
59
|
+
|
|
60
|
+
@is_success.setter
|
|
61
|
+
def is_success(self, is_success):
|
|
62
|
+
r"""Sets the is_success of this NodeRunInfoInnerError.
|
|
63
|
+
|
|
64
|
+
是否成功
|
|
65
|
+
|
|
66
|
+
:param is_success: The is_success of this NodeRunInfoInnerError.
|
|
67
|
+
:type is_success: bool
|
|
68
|
+
"""
|
|
69
|
+
self._is_success = is_success
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def error_body(self):
|
|
73
|
+
r"""Gets the error_body of this NodeRunInfoInnerError.
|
|
74
|
+
|
|
75
|
+
:return: The error_body of this NodeRunInfoInnerError.
|
|
76
|
+
:rtype: :class:`huaweicloudsdkversatile.v1.NodeRunInfoInnerErrorErrorBody`
|
|
77
|
+
"""
|
|
78
|
+
return self._error_body
|
|
79
|
+
|
|
80
|
+
@error_body.setter
|
|
81
|
+
def error_body(self, error_body):
|
|
82
|
+
r"""Sets the error_body of this NodeRunInfoInnerError.
|
|
83
|
+
|
|
84
|
+
:param error_body: The error_body of this NodeRunInfoInnerError.
|
|
85
|
+
:type error_body: :class:`huaweicloudsdkversatile.v1.NodeRunInfoInnerErrorErrorBody`
|
|
86
|
+
"""
|
|
87
|
+
self._error_body = error_body
|
|
88
|
+
|
|
89
|
+
def to_dict(self):
|
|
90
|
+
result = {}
|
|
91
|
+
|
|
92
|
+
for attr, _ in self.openapi_types.items():
|
|
93
|
+
value = getattr(self, attr)
|
|
94
|
+
if isinstance(value, list):
|
|
95
|
+
result[attr] = list(map(
|
|
96
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
97
|
+
value
|
|
98
|
+
))
|
|
99
|
+
elif hasattr(value, "to_dict"):
|
|
100
|
+
result[attr] = value.to_dict()
|
|
101
|
+
elif isinstance(value, dict):
|
|
102
|
+
result[attr] = dict(map(
|
|
103
|
+
lambda item: (item[0], item[1].to_dict())
|
|
104
|
+
if hasattr(item[1], "to_dict") else item,
|
|
105
|
+
value.items()
|
|
106
|
+
))
|
|
107
|
+
else:
|
|
108
|
+
if attr in self.sensitive_list:
|
|
109
|
+
result[attr] = "****"
|
|
110
|
+
else:
|
|
111
|
+
result[attr] = value
|
|
112
|
+
|
|
113
|
+
return result
|
|
114
|
+
|
|
115
|
+
def to_str(self):
|
|
116
|
+
"""Returns the string representation of the model"""
|
|
117
|
+
import simplejson as json
|
|
118
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
119
|
+
|
|
120
|
+
def __repr__(self):
|
|
121
|
+
"""For `print`"""
|
|
122
|
+
return self.to_str()
|
|
123
|
+
|
|
124
|
+
def __eq__(self, other):
|
|
125
|
+
"""Returns true if both objects are equal"""
|
|
126
|
+
if not isinstance(other, NodeRunInfoInnerError):
|
|
127
|
+
return False
|
|
128
|
+
|
|
129
|
+
return self.__dict__ == other.__dict__
|
|
130
|
+
|
|
131
|
+
def __ne__(self, other):
|
|
132
|
+
"""Returns true if both objects are not equal"""
|
|
133
|
+
return not self == other
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class NodeRunInfoInnerErrorErrorBody:
|
|
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
|
+
'error_code': 'str',
|
|
19
|
+
'error_message': 'str'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
attribute_map = {
|
|
23
|
+
'error_code': 'error_code',
|
|
24
|
+
'error_message': 'error_message'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def __init__(self, error_code=None, error_message=None):
|
|
28
|
+
r"""NodeRunInfoInnerErrorErrorBody
|
|
29
|
+
|
|
30
|
+
The model defined in huaweicloud sdk
|
|
31
|
+
|
|
32
|
+
:param error_code: 错误码
|
|
33
|
+
:type error_code: str
|
|
34
|
+
:param error_message: 错误信息
|
|
35
|
+
:type error_message: str
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
self._error_code = None
|
|
41
|
+
self._error_message = None
|
|
42
|
+
self.discriminator = None
|
|
43
|
+
|
|
44
|
+
if error_code is not None:
|
|
45
|
+
self.error_code = error_code
|
|
46
|
+
if error_message is not None:
|
|
47
|
+
self.error_message = error_message
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def error_code(self):
|
|
51
|
+
r"""Gets the error_code of this NodeRunInfoInnerErrorErrorBody.
|
|
52
|
+
|
|
53
|
+
错误码
|
|
54
|
+
|
|
55
|
+
:return: The error_code of this NodeRunInfoInnerErrorErrorBody.
|
|
56
|
+
:rtype: str
|
|
57
|
+
"""
|
|
58
|
+
return self._error_code
|
|
59
|
+
|
|
60
|
+
@error_code.setter
|
|
61
|
+
def error_code(self, error_code):
|
|
62
|
+
r"""Sets the error_code of this NodeRunInfoInnerErrorErrorBody.
|
|
63
|
+
|
|
64
|
+
错误码
|
|
65
|
+
|
|
66
|
+
:param error_code: The error_code of this NodeRunInfoInnerErrorErrorBody.
|
|
67
|
+
:type error_code: str
|
|
68
|
+
"""
|
|
69
|
+
self._error_code = error_code
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def error_message(self):
|
|
73
|
+
r"""Gets the error_message of this NodeRunInfoInnerErrorErrorBody.
|
|
74
|
+
|
|
75
|
+
错误信息
|
|
76
|
+
|
|
77
|
+
:return: The error_message of this NodeRunInfoInnerErrorErrorBody.
|
|
78
|
+
:rtype: str
|
|
79
|
+
"""
|
|
80
|
+
return self._error_message
|
|
81
|
+
|
|
82
|
+
@error_message.setter
|
|
83
|
+
def error_message(self, error_message):
|
|
84
|
+
r"""Sets the error_message of this NodeRunInfoInnerErrorErrorBody.
|
|
85
|
+
|
|
86
|
+
错误信息
|
|
87
|
+
|
|
88
|
+
:param error_message: The error_message of this NodeRunInfoInnerErrorErrorBody.
|
|
89
|
+
:type error_message: str
|
|
90
|
+
"""
|
|
91
|
+
self._error_message = error_message
|
|
92
|
+
|
|
93
|
+
def to_dict(self):
|
|
94
|
+
result = {}
|
|
95
|
+
|
|
96
|
+
for attr, _ in self.openapi_types.items():
|
|
97
|
+
value = getattr(self, attr)
|
|
98
|
+
if isinstance(value, list):
|
|
99
|
+
result[attr] = list(map(
|
|
100
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
101
|
+
value
|
|
102
|
+
))
|
|
103
|
+
elif hasattr(value, "to_dict"):
|
|
104
|
+
result[attr] = value.to_dict()
|
|
105
|
+
elif isinstance(value, dict):
|
|
106
|
+
result[attr] = dict(map(
|
|
107
|
+
lambda item: (item[0], item[1].to_dict())
|
|
108
|
+
if hasattr(item[1], "to_dict") else item,
|
|
109
|
+
value.items()
|
|
110
|
+
))
|
|
111
|
+
else:
|
|
112
|
+
if attr in self.sensitive_list:
|
|
113
|
+
result[attr] = "****"
|
|
114
|
+
else:
|
|
115
|
+
result[attr] = value
|
|
116
|
+
|
|
117
|
+
return result
|
|
118
|
+
|
|
119
|
+
def to_str(self):
|
|
120
|
+
"""Returns the string representation of the model"""
|
|
121
|
+
import simplejson as json
|
|
122
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
123
|
+
|
|
124
|
+
def __repr__(self):
|
|
125
|
+
"""For `print`"""
|
|
126
|
+
return self.to_str()
|
|
127
|
+
|
|
128
|
+
def __eq__(self, other):
|
|
129
|
+
"""Returns true if both objects are equal"""
|
|
130
|
+
if not isinstance(other, NodeRunInfoInnerErrorErrorBody):
|
|
131
|
+
return False
|
|
132
|
+
|
|
133
|
+
return self.__dict__ == other.__dict__
|
|
134
|
+
|
|
135
|
+
def __ne__(self, other):
|
|
136
|
+
"""Returns true if both objects are not equal"""
|
|
137
|
+
return not self == other
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PluginConfig:
|
|
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
|
+
'plugin_id': 'str',
|
|
19
|
+
'config': 'dict(str, object)'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
attribute_map = {
|
|
23
|
+
'plugin_id': 'plugin_id',
|
|
24
|
+
'config': 'config'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def __init__(self, plugin_id=None, config=None):
|
|
28
|
+
r"""PluginConfig
|
|
29
|
+
|
|
30
|
+
The model defined in huaweicloud sdk
|
|
31
|
+
|
|
32
|
+
:param plugin_id: 插件id
|
|
33
|
+
:type plugin_id: str
|
|
34
|
+
:param config: 单个插件参数
|
|
35
|
+
:type config: dict(str, object)
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
self._plugin_id = None
|
|
41
|
+
self._config = None
|
|
42
|
+
self.discriminator = None
|
|
43
|
+
|
|
44
|
+
if plugin_id is not None:
|
|
45
|
+
self.plugin_id = plugin_id
|
|
46
|
+
if config is not None:
|
|
47
|
+
self.config = config
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def plugin_id(self):
|
|
51
|
+
r"""Gets the plugin_id of this PluginConfig.
|
|
52
|
+
|
|
53
|
+
插件id
|
|
54
|
+
|
|
55
|
+
:return: The plugin_id of this PluginConfig.
|
|
56
|
+
:rtype: str
|
|
57
|
+
"""
|
|
58
|
+
return self._plugin_id
|
|
59
|
+
|
|
60
|
+
@plugin_id.setter
|
|
61
|
+
def plugin_id(self, plugin_id):
|
|
62
|
+
r"""Sets the plugin_id of this PluginConfig.
|
|
63
|
+
|
|
64
|
+
插件id
|
|
65
|
+
|
|
66
|
+
:param plugin_id: The plugin_id of this PluginConfig.
|
|
67
|
+
:type plugin_id: str
|
|
68
|
+
"""
|
|
69
|
+
self._plugin_id = plugin_id
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def config(self):
|
|
73
|
+
r"""Gets the config of this PluginConfig.
|
|
74
|
+
|
|
75
|
+
单个插件参数
|
|
76
|
+
|
|
77
|
+
:return: The config of this PluginConfig.
|
|
78
|
+
:rtype: dict(str, object)
|
|
79
|
+
"""
|
|
80
|
+
return self._config
|
|
81
|
+
|
|
82
|
+
@config.setter
|
|
83
|
+
def config(self, config):
|
|
84
|
+
r"""Sets the config of this PluginConfig.
|
|
85
|
+
|
|
86
|
+
单个插件参数
|
|
87
|
+
|
|
88
|
+
:param config: The config of this PluginConfig.
|
|
89
|
+
:type config: dict(str, object)
|
|
90
|
+
"""
|
|
91
|
+
self._config = config
|
|
92
|
+
|
|
93
|
+
def to_dict(self):
|
|
94
|
+
result = {}
|
|
95
|
+
|
|
96
|
+
for attr, _ in self.openapi_types.items():
|
|
97
|
+
value = getattr(self, attr)
|
|
98
|
+
if isinstance(value, list):
|
|
99
|
+
result[attr] = list(map(
|
|
100
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
101
|
+
value
|
|
102
|
+
))
|
|
103
|
+
elif hasattr(value, "to_dict"):
|
|
104
|
+
result[attr] = value.to_dict()
|
|
105
|
+
elif isinstance(value, dict):
|
|
106
|
+
result[attr] = dict(map(
|
|
107
|
+
lambda item: (item[0], item[1].to_dict())
|
|
108
|
+
if hasattr(item[1], "to_dict") else item,
|
|
109
|
+
value.items()
|
|
110
|
+
))
|
|
111
|
+
else:
|
|
112
|
+
if attr in self.sensitive_list:
|
|
113
|
+
result[attr] = "****"
|
|
114
|
+
else:
|
|
115
|
+
result[attr] = value
|
|
116
|
+
|
|
117
|
+
return result
|
|
118
|
+
|
|
119
|
+
def to_str(self):
|
|
120
|
+
"""Returns the string representation of the model"""
|
|
121
|
+
import simplejson as json
|
|
122
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
123
|
+
|
|
124
|
+
def __repr__(self):
|
|
125
|
+
"""For `print`"""
|
|
126
|
+
return self.to_str()
|
|
127
|
+
|
|
128
|
+
def __eq__(self, other):
|
|
129
|
+
"""Returns true if both objects are equal"""
|
|
130
|
+
if not isinstance(other, PluginConfig):
|
|
131
|
+
return False
|
|
132
|
+
|
|
133
|
+
return self.__dict__ == other.__dict__
|
|
134
|
+
|
|
135
|
+
def __ne__(self, other):
|
|
136
|
+
"""Returns true if both objects are not equal"""
|
|
137
|
+
return not self == other
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RetrievalResultInfo:
|
|
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
|
+
'file_id': 'str',
|
|
19
|
+
'title': 'str',
|
|
20
|
+
'chunk_id': 'str',
|
|
21
|
+
'content': 'str',
|
|
22
|
+
'similarity': 'float',
|
|
23
|
+
'knowledge_base_id': 'str',
|
|
24
|
+
'image_ids': 'list[str]'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
attribute_map = {
|
|
28
|
+
'file_id': 'file_id',
|
|
29
|
+
'title': 'title',
|
|
30
|
+
'chunk_id': 'chunk_id',
|
|
31
|
+
'content': 'content',
|
|
32
|
+
'similarity': 'similarity',
|
|
33
|
+
'knowledge_base_id': 'knowledge_base_id',
|
|
34
|
+
'image_ids': 'image_ids'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def __init__(self, file_id=None, title=None, chunk_id=None, content=None, similarity=None, knowledge_base_id=None, image_ids=None):
|
|
38
|
+
r"""RetrievalResultInfo
|
|
39
|
+
|
|
40
|
+
The model defined in huaweicloud sdk
|
|
41
|
+
|
|
42
|
+
:param file_id: **参数解释**: 文件ID(或FAQ ID)。 **取值范围**: 不涉及。
|
|
43
|
+
:type file_id: str
|
|
44
|
+
:param title: **参数解释**: 文档标题(如果是FAQ,返回QUESTION)。 **取值范围**: 不涉及。
|
|
45
|
+
:type title: str
|
|
46
|
+
:param chunk_id: **参数解释**: 分片ID。 **取值范围**: 不涉及。
|
|
47
|
+
:type chunk_id: str
|
|
48
|
+
:param content: **参数解释**: 文本内容(如果是FAQ,返回ANSWER)。 **取值范围**: 不涉及。
|
|
49
|
+
:type content: str
|
|
50
|
+
:param similarity: **参数解释**: 相似度。 **取值范围**: [0.0, 1.0],包含两端。
|
|
51
|
+
:type similarity: float
|
|
52
|
+
:param knowledge_base_id: **参数解释**: 知识库ID。 **取值范围**: 不涉及。
|
|
53
|
+
:type knowledge_base_id: str
|
|
54
|
+
:param image_ids: **参数解释**: 检索到的图片列表(需知识库支持),与content中的图片占位符{KI|N}保持一一对应关系,N为图片索引值,从0开始。 **取值范围**: 不涉及。
|
|
55
|
+
:type image_ids: list[str]
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
self._file_id = None
|
|
61
|
+
self._title = None
|
|
62
|
+
self._chunk_id = None
|
|
63
|
+
self._content = None
|
|
64
|
+
self._similarity = None
|
|
65
|
+
self._knowledge_base_id = None
|
|
66
|
+
self._image_ids = None
|
|
67
|
+
self.discriminator = None
|
|
68
|
+
|
|
69
|
+
if file_id is not None:
|
|
70
|
+
self.file_id = file_id
|
|
71
|
+
if title is not None:
|
|
72
|
+
self.title = title
|
|
73
|
+
if chunk_id is not None:
|
|
74
|
+
self.chunk_id = chunk_id
|
|
75
|
+
if content is not None:
|
|
76
|
+
self.content = content
|
|
77
|
+
if similarity is not None:
|
|
78
|
+
self.similarity = similarity
|
|
79
|
+
if knowledge_base_id is not None:
|
|
80
|
+
self.knowledge_base_id = knowledge_base_id
|
|
81
|
+
if image_ids is not None:
|
|
82
|
+
self.image_ids = image_ids
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def file_id(self):
|
|
86
|
+
r"""Gets the file_id of this RetrievalResultInfo.
|
|
87
|
+
|
|
88
|
+
**参数解释**: 文件ID(或FAQ ID)。 **取值范围**: 不涉及。
|
|
89
|
+
|
|
90
|
+
:return: The file_id of this RetrievalResultInfo.
|
|
91
|
+
:rtype: str
|
|
92
|
+
"""
|
|
93
|
+
return self._file_id
|
|
94
|
+
|
|
95
|
+
@file_id.setter
|
|
96
|
+
def file_id(self, file_id):
|
|
97
|
+
r"""Sets the file_id of this RetrievalResultInfo.
|
|
98
|
+
|
|
99
|
+
**参数解释**: 文件ID(或FAQ ID)。 **取值范围**: 不涉及。
|
|
100
|
+
|
|
101
|
+
:param file_id: The file_id of this RetrievalResultInfo.
|
|
102
|
+
:type file_id: str
|
|
103
|
+
"""
|
|
104
|
+
self._file_id = file_id
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def title(self):
|
|
108
|
+
r"""Gets the title of this RetrievalResultInfo.
|
|
109
|
+
|
|
110
|
+
**参数解释**: 文档标题(如果是FAQ,返回QUESTION)。 **取值范围**: 不涉及。
|
|
111
|
+
|
|
112
|
+
:return: The title of this RetrievalResultInfo.
|
|
113
|
+
:rtype: str
|
|
114
|
+
"""
|
|
115
|
+
return self._title
|
|
116
|
+
|
|
117
|
+
@title.setter
|
|
118
|
+
def title(self, title):
|
|
119
|
+
r"""Sets the title of this RetrievalResultInfo.
|
|
120
|
+
|
|
121
|
+
**参数解释**: 文档标题(如果是FAQ,返回QUESTION)。 **取值范围**: 不涉及。
|
|
122
|
+
|
|
123
|
+
:param title: The title of this RetrievalResultInfo.
|
|
124
|
+
:type title: str
|
|
125
|
+
"""
|
|
126
|
+
self._title = title
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def chunk_id(self):
|
|
130
|
+
r"""Gets the chunk_id of this RetrievalResultInfo.
|
|
131
|
+
|
|
132
|
+
**参数解释**: 分片ID。 **取值范围**: 不涉及。
|
|
133
|
+
|
|
134
|
+
:return: The chunk_id of this RetrievalResultInfo.
|
|
135
|
+
:rtype: str
|
|
136
|
+
"""
|
|
137
|
+
return self._chunk_id
|
|
138
|
+
|
|
139
|
+
@chunk_id.setter
|
|
140
|
+
def chunk_id(self, chunk_id):
|
|
141
|
+
r"""Sets the chunk_id of this RetrievalResultInfo.
|
|
142
|
+
|
|
143
|
+
**参数解释**: 分片ID。 **取值范围**: 不涉及。
|
|
144
|
+
|
|
145
|
+
:param chunk_id: The chunk_id of this RetrievalResultInfo.
|
|
146
|
+
:type chunk_id: str
|
|
147
|
+
"""
|
|
148
|
+
self._chunk_id = chunk_id
|
|
149
|
+
|
|
150
|
+
@property
|
|
151
|
+
def content(self):
|
|
152
|
+
r"""Gets the content of this RetrievalResultInfo.
|
|
153
|
+
|
|
154
|
+
**参数解释**: 文本内容(如果是FAQ,返回ANSWER)。 **取值范围**: 不涉及。
|
|
155
|
+
|
|
156
|
+
:return: The content of this RetrievalResultInfo.
|
|
157
|
+
:rtype: str
|
|
158
|
+
"""
|
|
159
|
+
return self._content
|
|
160
|
+
|
|
161
|
+
@content.setter
|
|
162
|
+
def content(self, content):
|
|
163
|
+
r"""Sets the content of this RetrievalResultInfo.
|
|
164
|
+
|
|
165
|
+
**参数解释**: 文本内容(如果是FAQ,返回ANSWER)。 **取值范围**: 不涉及。
|
|
166
|
+
|
|
167
|
+
:param content: The content of this RetrievalResultInfo.
|
|
168
|
+
:type content: str
|
|
169
|
+
"""
|
|
170
|
+
self._content = content
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
def similarity(self):
|
|
174
|
+
r"""Gets the similarity of this RetrievalResultInfo.
|
|
175
|
+
|
|
176
|
+
**参数解释**: 相似度。 **取值范围**: [0.0, 1.0],包含两端。
|
|
177
|
+
|
|
178
|
+
:return: The similarity of this RetrievalResultInfo.
|
|
179
|
+
:rtype: float
|
|
180
|
+
"""
|
|
181
|
+
return self._similarity
|
|
182
|
+
|
|
183
|
+
@similarity.setter
|
|
184
|
+
def similarity(self, similarity):
|
|
185
|
+
r"""Sets the similarity of this RetrievalResultInfo.
|
|
186
|
+
|
|
187
|
+
**参数解释**: 相似度。 **取值范围**: [0.0, 1.0],包含两端。
|
|
188
|
+
|
|
189
|
+
:param similarity: The similarity of this RetrievalResultInfo.
|
|
190
|
+
:type similarity: float
|
|
191
|
+
"""
|
|
192
|
+
self._similarity = similarity
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
def knowledge_base_id(self):
|
|
196
|
+
r"""Gets the knowledge_base_id of this RetrievalResultInfo.
|
|
197
|
+
|
|
198
|
+
**参数解释**: 知识库ID。 **取值范围**: 不涉及。
|
|
199
|
+
|
|
200
|
+
:return: The knowledge_base_id of this RetrievalResultInfo.
|
|
201
|
+
:rtype: str
|
|
202
|
+
"""
|
|
203
|
+
return self._knowledge_base_id
|
|
204
|
+
|
|
205
|
+
@knowledge_base_id.setter
|
|
206
|
+
def knowledge_base_id(self, knowledge_base_id):
|
|
207
|
+
r"""Sets the knowledge_base_id of this RetrievalResultInfo.
|
|
208
|
+
|
|
209
|
+
**参数解释**: 知识库ID。 **取值范围**: 不涉及。
|
|
210
|
+
|
|
211
|
+
:param knowledge_base_id: The knowledge_base_id of this RetrievalResultInfo.
|
|
212
|
+
:type knowledge_base_id: str
|
|
213
|
+
"""
|
|
214
|
+
self._knowledge_base_id = knowledge_base_id
|
|
215
|
+
|
|
216
|
+
@property
|
|
217
|
+
def image_ids(self):
|
|
218
|
+
r"""Gets the image_ids of this RetrievalResultInfo.
|
|
219
|
+
|
|
220
|
+
**参数解释**: 检索到的图片列表(需知识库支持),与content中的图片占位符{KI|N}保持一一对应关系,N为图片索引值,从0开始。 **取值范围**: 不涉及。
|
|
221
|
+
|
|
222
|
+
:return: The image_ids of this RetrievalResultInfo.
|
|
223
|
+
:rtype: list[str]
|
|
224
|
+
"""
|
|
225
|
+
return self._image_ids
|
|
226
|
+
|
|
227
|
+
@image_ids.setter
|
|
228
|
+
def image_ids(self, image_ids):
|
|
229
|
+
r"""Sets the image_ids of this RetrievalResultInfo.
|
|
230
|
+
|
|
231
|
+
**参数解释**: 检索到的图片列表(需知识库支持),与content中的图片占位符{KI|N}保持一一对应关系,N为图片索引值,从0开始。 **取值范围**: 不涉及。
|
|
232
|
+
|
|
233
|
+
:param image_ids: The image_ids of this RetrievalResultInfo.
|
|
234
|
+
:type image_ids: list[str]
|
|
235
|
+
"""
|
|
236
|
+
self._image_ids = image_ids
|
|
237
|
+
|
|
238
|
+
def to_dict(self):
|
|
239
|
+
result = {}
|
|
240
|
+
|
|
241
|
+
for attr, _ in self.openapi_types.items():
|
|
242
|
+
value = getattr(self, attr)
|
|
243
|
+
if isinstance(value, list):
|
|
244
|
+
result[attr] = list(map(
|
|
245
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
246
|
+
value
|
|
247
|
+
))
|
|
248
|
+
elif hasattr(value, "to_dict"):
|
|
249
|
+
result[attr] = value.to_dict()
|
|
250
|
+
elif isinstance(value, dict):
|
|
251
|
+
result[attr] = dict(map(
|
|
252
|
+
lambda item: (item[0], item[1].to_dict())
|
|
253
|
+
if hasattr(item[1], "to_dict") else item,
|
|
254
|
+
value.items()
|
|
255
|
+
))
|
|
256
|
+
else:
|
|
257
|
+
if attr in self.sensitive_list:
|
|
258
|
+
result[attr] = "****"
|
|
259
|
+
else:
|
|
260
|
+
result[attr] = value
|
|
261
|
+
|
|
262
|
+
return result
|
|
263
|
+
|
|
264
|
+
def to_str(self):
|
|
265
|
+
"""Returns the string representation of the model"""
|
|
266
|
+
import simplejson as json
|
|
267
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
268
|
+
|
|
269
|
+
def __repr__(self):
|
|
270
|
+
"""For `print`"""
|
|
271
|
+
return self.to_str()
|
|
272
|
+
|
|
273
|
+
def __eq__(self, other):
|
|
274
|
+
"""Returns true if both objects are equal"""
|
|
275
|
+
if not isinstance(other, RetrievalResultInfo):
|
|
276
|
+
return False
|
|
277
|
+
|
|
278
|
+
return self.__dict__ == other.__dict__
|
|
279
|
+
|
|
280
|
+
def __ne__(self, other):
|
|
281
|
+
"""Returns true if both objects are not equal"""
|
|
282
|
+
return not self == other
|