tencentcloud-sdk-python-dataagent 3.0.1488__py2.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.
@@ -0,0 +1,17 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 1999-2018 Tencent Ltd.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+
17
+ __version__ = '3.0.1488'
File without changes
File without changes
@@ -0,0 +1,274 @@
1
+ # -*- coding: utf8 -*-
2
+ # Copyright (c) 2017-2025 Tencent. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import json
17
+
18
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
19
+ from tencentcloud.common.abstract_client import AbstractClient
20
+ from tencentcloud.dataagent.v20250513 import models
21
+
22
+
23
+ class DataagentClient(AbstractClient):
24
+ _apiVersion = '2025-05-13'
25
+ _endpoint = 'dataagent.tencentcloudapi.com'
26
+ _service = 'dataagent'
27
+
28
+
29
+ def AddChunk(self, request):
30
+ r"""文档切片新增
31
+
32
+ :param request: Request instance for AddChunk.
33
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.AddChunkRequest`
34
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.AddChunkResponse`
35
+
36
+ """
37
+ try:
38
+ params = request._serialize()
39
+ headers = request.headers
40
+ body = self.call("AddChunk", params, headers=headers)
41
+ response = json.loads(body)
42
+ model = models.AddChunkResponse()
43
+ model._deserialize(response["Response"])
44
+ return model
45
+ except Exception as e:
46
+ if isinstance(e, TencentCloudSDKException):
47
+ raise
48
+ else:
49
+ raise TencentCloudSDKException(type(e).__name__, str(e))
50
+
51
+
52
+ def ChatAI(self, request):
53
+ r"""提供DataAgent 产品服务API
54
+
55
+ :param request: Request instance for ChatAI.
56
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.ChatAIRequest`
57
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.ChatAIResponse`
58
+
59
+ """
60
+ try:
61
+ params = request._serialize()
62
+ return self._call_and_deserialize("ChatAI", params, models.ChatAIResponse, headers=request.headers)
63
+ except Exception as e:
64
+ if isinstance(e, TencentCloudSDKException):
65
+ raise
66
+ else:
67
+ raise TencentCloudSDKException(type(e).__name__, str(e))
68
+
69
+
70
+ def CreateDataAgentSession(self, request):
71
+ r"""生成DataAgent 会话ID
72
+
73
+ :param request: Request instance for CreateDataAgentSession.
74
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.CreateDataAgentSessionRequest`
75
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.CreateDataAgentSessionResponse`
76
+
77
+ """
78
+ try:
79
+ params = request._serialize()
80
+ headers = request.headers
81
+ body = self.call("CreateDataAgentSession", params, headers=headers)
82
+ response = json.loads(body)
83
+ model = models.CreateDataAgentSessionResponse()
84
+ model._deserialize(response["Response"])
85
+ return model
86
+ except Exception as e:
87
+ if isinstance(e, TencentCloudSDKException):
88
+ raise
89
+ else:
90
+ raise TencentCloudSDKException(type(e).__name__, str(e))
91
+
92
+
93
+ def DeleteChunk(self, request):
94
+ r"""文档切片删除
95
+
96
+ :param request: Request instance for DeleteChunk.
97
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.DeleteChunkRequest`
98
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.DeleteChunkResponse`
99
+
100
+ """
101
+ try:
102
+ params = request._serialize()
103
+ headers = request.headers
104
+ body = self.call("DeleteChunk", params, headers=headers)
105
+ response = json.loads(body)
106
+ model = models.DeleteChunkResponse()
107
+ model._deserialize(response["Response"])
108
+ return model
109
+ except Exception as e:
110
+ if isinstance(e, TencentCloudSDKException):
111
+ raise
112
+ else:
113
+ raise TencentCloudSDKException(type(e).__name__, str(e))
114
+
115
+
116
+ def DeleteDataAgentSession(self, request):
117
+ r"""删除会话
118
+
119
+ :param request: Request instance for DeleteDataAgentSession.
120
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.DeleteDataAgentSessionRequest`
121
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.DeleteDataAgentSessionResponse`
122
+
123
+ """
124
+ try:
125
+ params = request._serialize()
126
+ headers = request.headers
127
+ body = self.call("DeleteDataAgentSession", params, headers=headers)
128
+ response = json.loads(body)
129
+ model = models.DeleteDataAgentSessionResponse()
130
+ model._deserialize(response["Response"])
131
+ return model
132
+ except Exception as e:
133
+ if isinstance(e, TencentCloudSDKException):
134
+ raise
135
+ else:
136
+ raise TencentCloudSDKException(type(e).__name__, str(e))
137
+
138
+
139
+ def GetKnowledgeBaseList(self, request):
140
+ r"""获取知识库列表
141
+
142
+ :param request: Request instance for GetKnowledgeBaseList.
143
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.GetKnowledgeBaseListRequest`
144
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.GetKnowledgeBaseListResponse`
145
+
146
+ """
147
+ try:
148
+ params = request._serialize()
149
+ headers = request.headers
150
+ body = self.call("GetKnowledgeBaseList", params, headers=headers)
151
+ response = json.loads(body)
152
+ model = models.GetKnowledgeBaseListResponse()
153
+ model._deserialize(response["Response"])
154
+ return model
155
+ except Exception as e:
156
+ if isinstance(e, TencentCloudSDKException):
157
+ raise
158
+ else:
159
+ raise TencentCloudSDKException(type(e).__name__, str(e))
160
+
161
+
162
+ def GetSessionDetails(self, request):
163
+ r"""获取用户会话记录详情列表
164
+
165
+ :param request: Request instance for GetSessionDetails.
166
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.GetSessionDetailsRequest`
167
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.GetSessionDetailsResponse`
168
+
169
+ """
170
+ try:
171
+ params = request._serialize()
172
+ headers = request.headers
173
+ body = self.call("GetSessionDetails", params, headers=headers)
174
+ response = json.loads(body)
175
+ model = models.GetSessionDetailsResponse()
176
+ model._deserialize(response["Response"])
177
+ return model
178
+ except Exception as e:
179
+ if isinstance(e, TencentCloudSDKException):
180
+ raise
181
+ else:
182
+ raise TencentCloudSDKException(type(e).__name__, str(e))
183
+
184
+
185
+ def ModifyChunk(self, request):
186
+ r"""编辑修改分片
187
+
188
+ :param request: Request instance for ModifyChunk.
189
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.ModifyChunkRequest`
190
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.ModifyChunkResponse`
191
+
192
+ """
193
+ try:
194
+ params = request._serialize()
195
+ headers = request.headers
196
+ body = self.call("ModifyChunk", params, headers=headers)
197
+ response = json.loads(body)
198
+ model = models.ModifyChunkResponse()
199
+ model._deserialize(response["Response"])
200
+ return model
201
+ except Exception as e:
202
+ if isinstance(e, TencentCloudSDKException):
203
+ raise
204
+ else:
205
+ raise TencentCloudSDKException(type(e).__name__, str(e))
206
+
207
+
208
+ def ModifyKnowledgeBase(self, request):
209
+ r"""操作知识库
210
+
211
+ :param request: Request instance for ModifyKnowledgeBase.
212
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.ModifyKnowledgeBaseRequest`
213
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.ModifyKnowledgeBaseResponse`
214
+
215
+ """
216
+ try:
217
+ params = request._serialize()
218
+ headers = request.headers
219
+ body = self.call("ModifyKnowledgeBase", params, headers=headers)
220
+ response = json.loads(body)
221
+ model = models.ModifyKnowledgeBaseResponse()
222
+ model._deserialize(response["Response"])
223
+ return model
224
+ except Exception as e:
225
+ if isinstance(e, TencentCloudSDKException):
226
+ raise
227
+ else:
228
+ raise TencentCloudSDKException(type(e).__name__, str(e))
229
+
230
+
231
+ def QueryChunkList(self, request):
232
+ r"""分配查询
233
+
234
+ :param request: Request instance for QueryChunkList.
235
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.QueryChunkListRequest`
236
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.QueryChunkListResponse`
237
+
238
+ """
239
+ try:
240
+ params = request._serialize()
241
+ headers = request.headers
242
+ body = self.call("QueryChunkList", params, headers=headers)
243
+ response = json.loads(body)
244
+ model = models.QueryChunkListResponse()
245
+ model._deserialize(response["Response"])
246
+ return model
247
+ except Exception as e:
248
+ if isinstance(e, TencentCloudSDKException):
249
+ raise
250
+ else:
251
+ raise TencentCloudSDKException(type(e).__name__, str(e))
252
+
253
+
254
+ def StopChatAI(self, request):
255
+ r"""中断DataAgent的回答输出
256
+
257
+ :param request: Request instance for StopChatAI.
258
+ :type request: :class:`tencentcloud.dataagent.v20250513.models.StopChatAIRequest`
259
+ :rtype: :class:`tencentcloud.dataagent.v20250513.models.StopChatAIResponse`
260
+
261
+ """
262
+ try:
263
+ params = request._serialize()
264
+ headers = request.headers
265
+ body = self.call("StopChatAI", params, headers=headers)
266
+ response = json.loads(body)
267
+ model = models.StopChatAIResponse()
268
+ model._deserialize(response["Response"])
269
+ return model
270
+ except Exception as e:
271
+ if isinstance(e, TencentCloudSDKException):
272
+ raise
273
+ else:
274
+ raise TencentCloudSDKException(type(e).__name__, str(e))
@@ -0,0 +1,57 @@
1
+ # -*- coding: utf8 -*-
2
+ # Copyright (c) 2017-2025 Tencent. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+
17
+ # 操作失败。
18
+ FAILEDOPERATION = 'FailedOperation'
19
+
20
+ # 内部错误。
21
+ INTERNALERROR = 'InternalError'
22
+
23
+ # 参数错误。
24
+ INVALIDPARAMETER = 'InvalidParameter'
25
+
26
+ # 自定义错误码
27
+ INVALIDPARAMETER_INVALID = 'InvalidParameter.Invalid'
28
+
29
+ # 参数取值错误。
30
+ INVALIDPARAMETERVALUE = 'InvalidParameterValue'
31
+
32
+ # 超过配额限制。
33
+ LIMITEXCEEDED = 'LimitExceeded'
34
+
35
+ # 缺少参数错误。
36
+ MISSINGPARAMETER = 'MissingParameter'
37
+
38
+ # 请求的次数超过了频率限制。
39
+ REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
40
+
41
+ # 资源不足。
42
+ RESOURCEINSUFFICIENT = 'ResourceInsufficient'
43
+
44
+ # 资源不存在。
45
+ RESOURCENOTFOUND = 'ResourceNotFound'
46
+
47
+ # 资源不可用。
48
+ RESOURCEUNAVAILABLE = 'ResourceUnavailable'
49
+
50
+ # 未授权操作。
51
+ UNAUTHORIZEDOPERATION = 'UnauthorizedOperation'
52
+
53
+ # 未知参数错误。
54
+ UNKNOWNPARAMETER = 'UnknownParameter'
55
+
56
+ # 操作不支持。
57
+ UNSUPPORTEDOPERATION = 'UnsupportedOperation'