tencentcloud-sdk-lkeap 3.0.976
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-lkeap.rb +11 -0
- data/lib/v20240522/client.rb +617 -0
- data/lib/v20240522/models.rb +1681 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a6d9ddb18ccd49bed9fcacb5fccd8e209c9f3de7
|
4
|
+
data.tar.gz: ffcb2b31867895cdf7f0cf9eee6e7fce40b31907
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f2391b70723e4bd00703337c0585b59fbda62b147f6a0aa70be0ea81317e264a659a3e5cbdc5d658324da3a88d3f46628a7982dd20ee64a0aedee56dbf27870a
|
7
|
+
data.tar.gz: f98437c3bf89cb4f45ffd64ac2e9cb12b78d6a7fd900008527e82beffecec62d1a9247643719352a5a5b5b483b1c3ca9ad0370829ef1917b00f5eeeaa3340081
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.976
|
@@ -0,0 +1,617 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module TencentCloud
|
20
|
+
module Lkeap
|
21
|
+
module V20240522
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2024-05-22'
|
26
|
+
api_endpoint = 'lkeap.tencentcloudapi.com'
|
27
|
+
sdk_version = 'LKEAP_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 用于为问答对创建属性标签,以便对内容进行分类和管理。 使用场景:当需要为问答对添加分类标签和属性标记时使用,比如为问答对添加“售后”标签。
|
33
|
+
|
34
|
+
# @param request: Request instance for CreateAttributeLabel.
|
35
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::CreateAttributeLabelRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::CreateAttributeLabelResponse`
|
37
|
+
def CreateAttributeLabel(request)
|
38
|
+
body = send_request('CreateAttributeLabel', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = CreateAttributeLabelResponse.new
|
42
|
+
model.deserialize(response['Response'])
|
43
|
+
model
|
44
|
+
else
|
45
|
+
code = response['Response']['Error']['Code']
|
46
|
+
message = response['Response']['Error']['Message']
|
47
|
+
reqid = response['Response']['RequestId']
|
48
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
49
|
+
end
|
50
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
51
|
+
raise e
|
52
|
+
rescue StandardError => e
|
53
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
54
|
+
end
|
55
|
+
|
56
|
+
# 用于在系统中创建一个新的知识库。知识库是一个用于存储和管理知识条目的集合,可以包括文档、问答对、属性标签等。创建知识库后,可以向其中添加各种知识条目,以便在后续的知识检索中使用。 使用场景:当需要在系统中建立一个新的知识库以存储和管理特定领域或项目的知识条目时使用。例如,一个用户可能需要创建一个知识库,以存储用户指南、常见问题解答和技术文档。
|
57
|
+
|
58
|
+
# @param request: Request instance for CreateKnowledgeBase.
|
59
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::CreateKnowledgeBaseRequest`
|
60
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::CreateKnowledgeBaseResponse`
|
61
|
+
def CreateKnowledgeBase(request)
|
62
|
+
body = send_request('CreateKnowledgeBase', request.serialize)
|
63
|
+
response = JSON.parse(body)
|
64
|
+
if response['Response'].key?('Error') == false
|
65
|
+
model = CreateKnowledgeBaseResponse.new
|
66
|
+
model.deserialize(response['Response'])
|
67
|
+
model
|
68
|
+
else
|
69
|
+
code = response['Response']['Error']['Code']
|
70
|
+
message = response['Response']['Error']['Message']
|
71
|
+
reqid = response['Response']['RequestId']
|
72
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
73
|
+
end
|
74
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
75
|
+
raise e
|
76
|
+
rescue StandardError => e
|
77
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
78
|
+
end
|
79
|
+
|
80
|
+
# 用于创建新的问答对。问答对可以在SearchKnowledge接口知识检索时提供匹配的答案。 使用场景:当需要添加新的知识点和对应的问答对时使用,比如为产品添加新的常见问题解答。
|
81
|
+
|
82
|
+
# @param request: Request instance for CreateQA.
|
83
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::CreateQARequest`
|
84
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::CreateQAResponse`
|
85
|
+
def CreateQA(request)
|
86
|
+
body = send_request('CreateQA', request.serialize)
|
87
|
+
response = JSON.parse(body)
|
88
|
+
if response['Response'].key?('Error') == false
|
89
|
+
model = CreateQAResponse.new
|
90
|
+
model.deserialize(response['Response'])
|
91
|
+
model
|
92
|
+
else
|
93
|
+
code = response['Response']['Error']['Code']
|
94
|
+
message = response['Response']['Error']['Message']
|
95
|
+
reqid = response['Response']['RequestId']
|
96
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
97
|
+
end
|
98
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
99
|
+
raise e
|
100
|
+
rescue StandardError => e
|
101
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
102
|
+
end
|
103
|
+
|
104
|
+
# 本接口为异步接口的发起请求接口,用于发起文档解析任务。
|
105
|
+
# 文档解析支持将图片或PDF文件转换成Markdown格式文件,可解析包括表格、公式、图片、标题、段落、页眉、页脚等内容元素,并将内容智能转换成阅读顺序。
|
106
|
+
|
107
|
+
# 体验期间单账号限制qps仅为1,若有正式接入需要请与产研团队沟通开放。
|
108
|
+
|
109
|
+
# @param request: Request instance for CreateReconstructDocumentFlow.
|
110
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::CreateReconstructDocumentFlowRequest`
|
111
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::CreateReconstructDocumentFlowResponse`
|
112
|
+
def CreateReconstructDocumentFlow(request)
|
113
|
+
body = send_request('CreateReconstructDocumentFlow', request.serialize)
|
114
|
+
response = JSON.parse(body)
|
115
|
+
if response['Response'].key?('Error') == false
|
116
|
+
model = CreateReconstructDocumentFlowResponse.new
|
117
|
+
model.deserialize(response['Response'])
|
118
|
+
model
|
119
|
+
else
|
120
|
+
code = response['Response']['Error']['Code']
|
121
|
+
message = response['Response']['Error']['Message']
|
122
|
+
reqid = response['Response']['RequestId']
|
123
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
124
|
+
end
|
125
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
126
|
+
raise e
|
127
|
+
rescue StandardError => e
|
128
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
129
|
+
end
|
130
|
+
|
131
|
+
# 创建文档拆分任务
|
132
|
+
|
133
|
+
# @param request: Request instance for CreateSplitDocumentFlow.
|
134
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::CreateSplitDocumentFlowRequest`
|
135
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::CreateSplitDocumentFlowResponse`
|
136
|
+
def CreateSplitDocumentFlow(request)
|
137
|
+
body = send_request('CreateSplitDocumentFlow', request.serialize)
|
138
|
+
response = JSON.parse(body)
|
139
|
+
if response['Response'].key?('Error') == false
|
140
|
+
model = CreateSplitDocumentFlowResponse.new
|
141
|
+
model.deserialize(response['Response'])
|
142
|
+
model
|
143
|
+
else
|
144
|
+
code = response['Response']['Error']['Code']
|
145
|
+
message = response['Response']['Error']['Message']
|
146
|
+
reqid = response['Response']['RequestId']
|
147
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
148
|
+
end
|
149
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
150
|
+
raise e
|
151
|
+
rescue StandardError => e
|
152
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
153
|
+
end
|
154
|
+
|
155
|
+
# 用于删除不再需要的属性标签。 使用场景:当某个标签不再使用时,可以将其删除以保持标签系统的整洁。
|
156
|
+
|
157
|
+
# @param request: Request instance for DeleteAttributeLabels.
|
158
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::DeleteAttributeLabelsRequest`
|
159
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::DeleteAttributeLabelsResponse`
|
160
|
+
def DeleteAttributeLabels(request)
|
161
|
+
body = send_request('DeleteAttributeLabels', request.serialize)
|
162
|
+
response = JSON.parse(body)
|
163
|
+
if response['Response'].key?('Error') == false
|
164
|
+
model = DeleteAttributeLabelsResponse.new
|
165
|
+
model.deserialize(response['Response'])
|
166
|
+
model
|
167
|
+
else
|
168
|
+
code = response['Response']['Error']['Code']
|
169
|
+
message = response['Response']['Error']['Message']
|
170
|
+
reqid = response['Response']['RequestId']
|
171
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
172
|
+
end
|
173
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
174
|
+
raise e
|
175
|
+
rescue StandardError => e
|
176
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
177
|
+
end
|
178
|
+
|
179
|
+
# 用于删除已有的文档。 使用场景:当某个文档不再需要时,可以将其删除以保持文档库的整洁。
|
180
|
+
|
181
|
+
# @param request: Request instance for DeleteDocs.
|
182
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::DeleteDocsRequest`
|
183
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::DeleteDocsResponse`
|
184
|
+
def DeleteDocs(request)
|
185
|
+
body = send_request('DeleteDocs', request.serialize)
|
186
|
+
response = JSON.parse(body)
|
187
|
+
if response['Response'].key?('Error') == false
|
188
|
+
model = DeleteDocsResponse.new
|
189
|
+
model.deserialize(response['Response'])
|
190
|
+
model
|
191
|
+
else
|
192
|
+
code = response['Response']['Error']['Code']
|
193
|
+
message = response['Response']['Error']['Message']
|
194
|
+
reqid = response['Response']['RequestId']
|
195
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
196
|
+
end
|
197
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
198
|
+
raise e
|
199
|
+
rescue StandardError => e
|
200
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
201
|
+
end
|
202
|
+
|
203
|
+
# 用于从系统中删除一个现有的知识库。删除知识库将移除该知识库及其所有关联的知识条目(如文档、问答对、属性标签等)。该操作是不可逆的,请在执行前确认是否需要删除。**使用场景**:当某个知识库不再需要时,可以使用此接口将其从系统中删除。例如,一个项目结束后,其相关的知识库可能不再需要存储,可以使用该接口进行删除。
|
204
|
+
|
205
|
+
# @param request: Request instance for DeleteKnowledgeBase.
|
206
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::DeleteKnowledgeBaseRequest`
|
207
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::DeleteKnowledgeBaseResponse`
|
208
|
+
def DeleteKnowledgeBase(request)
|
209
|
+
body = send_request('DeleteKnowledgeBase', request.serialize)
|
210
|
+
response = JSON.parse(body)
|
211
|
+
if response['Response'].key?('Error') == false
|
212
|
+
model = DeleteKnowledgeBaseResponse.new
|
213
|
+
model.deserialize(response['Response'])
|
214
|
+
model
|
215
|
+
else
|
216
|
+
code = response['Response']['Error']['Code']
|
217
|
+
message = response['Response']['Error']['Message']
|
218
|
+
reqid = response['Response']['RequestId']
|
219
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
220
|
+
end
|
221
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
222
|
+
raise e
|
223
|
+
rescue StandardError => e
|
224
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
225
|
+
end
|
226
|
+
|
227
|
+
# 用于删除已有的问答对。 使用场景:当某个问答对不再适用或需要移除时使用。
|
228
|
+
|
229
|
+
# @param request: Request instance for DeleteQAs.
|
230
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::DeleteQAsRequest`
|
231
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::DeleteQAsResponse`
|
232
|
+
def DeleteQAs(request)
|
233
|
+
body = send_request('DeleteQAs', request.serialize)
|
234
|
+
response = JSON.parse(body)
|
235
|
+
if response['Response'].key?('Error') == false
|
236
|
+
model = DeleteQAsResponse.new
|
237
|
+
model.deserialize(response['Response'])
|
238
|
+
model
|
239
|
+
else
|
240
|
+
code = response['Response']['Error']['Code']
|
241
|
+
message = response['Response']['Error']['Message']
|
242
|
+
reqid = response['Response']['RequestId']
|
243
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
244
|
+
end
|
245
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
246
|
+
raise e
|
247
|
+
rescue StandardError => e
|
248
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
249
|
+
end
|
250
|
+
|
251
|
+
# 用于查询特定文档的详细信息。 使用场景:当需要查看某个文档的具体内容和属性时使用。
|
252
|
+
|
253
|
+
# @param request: Request instance for DescribeDoc.
|
254
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::DescribeDocRequest`
|
255
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::DescribeDocResponse`
|
256
|
+
def DescribeDoc(request)
|
257
|
+
body = send_request('DescribeDoc', request.serialize)
|
258
|
+
response = JSON.parse(body)
|
259
|
+
if response['Response'].key?('Error') == false
|
260
|
+
model = DescribeDocResponse.new
|
261
|
+
model.deserialize(response['Response'])
|
262
|
+
model
|
263
|
+
else
|
264
|
+
code = response['Response']['Error']['Code']
|
265
|
+
message = response['Response']['Error']['Message']
|
266
|
+
reqid = response['Response']['RequestId']
|
267
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
268
|
+
end
|
269
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
270
|
+
raise e
|
271
|
+
rescue StandardError => e
|
272
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
273
|
+
end
|
274
|
+
|
275
|
+
# 本接口(GetEmbedding)调用文本表示模型,将文本转化为用数值表示的向量形式,可用于文本检索、信息推荐、知识挖掘等场景。
|
276
|
+
# 本接口(GetEmbedding)有单账号调用上限控制,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。
|
277
|
+
|
278
|
+
# @param request: Request instance for GetEmbedding.
|
279
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::GetEmbeddingRequest`
|
280
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::GetEmbeddingResponse`
|
281
|
+
def GetEmbedding(request)
|
282
|
+
body = send_request('GetEmbedding', request.serialize)
|
283
|
+
response = JSON.parse(body)
|
284
|
+
if response['Response'].key?('Error') == false
|
285
|
+
model = GetEmbeddingResponse.new
|
286
|
+
model.deserialize(response['Response'])
|
287
|
+
model
|
288
|
+
else
|
289
|
+
code = response['Response']['Error']['Code']
|
290
|
+
message = response['Response']['Error']['Message']
|
291
|
+
reqid = response['Response']['RequestId']
|
292
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
293
|
+
end
|
294
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
295
|
+
raise e
|
296
|
+
rescue StandardError => e
|
297
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
298
|
+
end
|
299
|
+
|
300
|
+
# 本接口为异步接口的查询结果接口,用于获取文档解析处理结果。
|
301
|
+
|
302
|
+
# @param request: Request instance for GetReconstructDocumentResult.
|
303
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::GetReconstructDocumentResultRequest`
|
304
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::GetReconstructDocumentResultResponse`
|
305
|
+
def GetReconstructDocumentResult(request)
|
306
|
+
body = send_request('GetReconstructDocumentResult', request.serialize)
|
307
|
+
response = JSON.parse(body)
|
308
|
+
if response['Response'].key?('Error') == false
|
309
|
+
model = GetReconstructDocumentResultResponse.new
|
310
|
+
model.deserialize(response['Response'])
|
311
|
+
model
|
312
|
+
else
|
313
|
+
code = response['Response']['Error']['Code']
|
314
|
+
message = response['Response']['Error']['Message']
|
315
|
+
reqid = response['Response']['RequestId']
|
316
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
317
|
+
end
|
318
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
319
|
+
raise e
|
320
|
+
rescue StandardError => e
|
321
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
322
|
+
end
|
323
|
+
|
324
|
+
# 查询文档拆分任务结果
|
325
|
+
|
326
|
+
# @param request: Request instance for GetSplitDocumentResult.
|
327
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::GetSplitDocumentResultRequest`
|
328
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::GetSplitDocumentResultResponse`
|
329
|
+
def GetSplitDocumentResult(request)
|
330
|
+
body = send_request('GetSplitDocumentResult', request.serialize)
|
331
|
+
response = JSON.parse(body)
|
332
|
+
if response['Response'].key?('Error') == false
|
333
|
+
model = GetSplitDocumentResultResponse.new
|
334
|
+
model.deserialize(response['Response'])
|
335
|
+
model
|
336
|
+
else
|
337
|
+
code = response['Response']['Error']['Code']
|
338
|
+
message = response['Response']['Error']['Message']
|
339
|
+
reqid = response['Response']['RequestId']
|
340
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
341
|
+
end
|
342
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
343
|
+
raise e
|
344
|
+
rescue StandardError => e
|
345
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
346
|
+
end
|
347
|
+
|
348
|
+
# 用于批量导入问答对,最多支持50,000条数据导入。通过此接口,可以将多个问答对一次性导入系统中,以便在后续的知识检索中使用。导入的问答对可以来自外部系统、文件或其他数据源。使用场景:当需要一次性导入大量的问答对时使用。例如,一个公司可能需要将其产品的常见问题解答从一个文档或外部系统批量导入到知识库中,以便用户可以通过知识检索系统进行查询。
|
349
|
+
|
350
|
+
# @param request: Request instance for ImportQAs.
|
351
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ImportQAsRequest`
|
352
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ImportQAsResponse`
|
353
|
+
def ImportQAs(request)
|
354
|
+
body = send_request('ImportQAs', request.serialize)
|
355
|
+
response = JSON.parse(body)
|
356
|
+
if response['Response'].key?('Error') == false
|
357
|
+
model = ImportQAsResponse.new
|
358
|
+
model.deserialize(response['Response'])
|
359
|
+
model
|
360
|
+
else
|
361
|
+
code = response['Response']['Error']['Code']
|
362
|
+
message = response['Response']['Error']['Message']
|
363
|
+
reqid = response['Response']['RequestId']
|
364
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
365
|
+
end
|
366
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
367
|
+
raise e
|
368
|
+
rescue StandardError => e
|
369
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
370
|
+
end
|
371
|
+
|
372
|
+
# 用于获取所有属性标签的列表。 使用场景:用于查看当前系统中所有已有的属性标签,方便进行管理和维护。
|
373
|
+
|
374
|
+
# @param request: Request instance for ListAttributeLabels.
|
375
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ListAttributeLabelsRequest`
|
376
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ListAttributeLabelsResponse`
|
377
|
+
def ListAttributeLabels(request)
|
378
|
+
body = send_request('ListAttributeLabels', request.serialize)
|
379
|
+
response = JSON.parse(body)
|
380
|
+
if response['Response'].key?('Error') == false
|
381
|
+
model = ListAttributeLabelsResponse.new
|
382
|
+
model.deserialize(response['Response'])
|
383
|
+
model
|
384
|
+
else
|
385
|
+
code = response['Response']['Error']['Code']
|
386
|
+
message = response['Response']['Error']['Message']
|
387
|
+
reqid = response['Response']['RequestId']
|
388
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
389
|
+
end
|
390
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
391
|
+
raise e
|
392
|
+
rescue StandardError => e
|
393
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
394
|
+
end
|
395
|
+
|
396
|
+
# 用于获取所有文档的列表。 使用场景:用于查看当前系统中所有已有的文档,方便进行管理和维护。
|
397
|
+
|
398
|
+
# @param request: Request instance for ListDocs.
|
399
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ListDocsRequest`
|
400
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ListDocsResponse`
|
401
|
+
def ListDocs(request)
|
402
|
+
body = send_request('ListDocs', request.serialize)
|
403
|
+
response = JSON.parse(body)
|
404
|
+
if response['Response'].key?('Error') == false
|
405
|
+
model = ListDocsResponse.new
|
406
|
+
model.deserialize(response['Response'])
|
407
|
+
model
|
408
|
+
else
|
409
|
+
code = response['Response']['Error']['Code']
|
410
|
+
message = response['Response']['Error']['Message']
|
411
|
+
reqid = response['Response']['RequestId']
|
412
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
413
|
+
end
|
414
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
415
|
+
raise e
|
416
|
+
rescue StandardError => e
|
417
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
418
|
+
end
|
419
|
+
|
420
|
+
# 用于获取所有问答对的列表。 使用场景:用于查看当前系统中所有已有的问答对,方便进行管理和维护。
|
421
|
+
|
422
|
+
# @param request: Request instance for ListQAs.
|
423
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ListQAsRequest`
|
424
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ListQAsResponse`
|
425
|
+
def ListQAs(request)
|
426
|
+
body = send_request('ListQAs', request.serialize)
|
427
|
+
response = JSON.parse(body)
|
428
|
+
if response['Response'].key?('Error') == false
|
429
|
+
model = ListQAsResponse.new
|
430
|
+
model.deserialize(response['Response'])
|
431
|
+
model
|
432
|
+
else
|
433
|
+
code = response['Response']['Error']['Code']
|
434
|
+
message = response['Response']['Error']['Message']
|
435
|
+
reqid = response['Response']['RequestId']
|
436
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
437
|
+
end
|
438
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
439
|
+
raise e
|
440
|
+
rescue StandardError => e
|
441
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
442
|
+
end
|
443
|
+
|
444
|
+
# 用于修改已有的属性标签。 使用场景:当需要更改属性标签的名称或描述时使用,比如将“售后”标签改为“售前”。
|
445
|
+
|
446
|
+
# @param request: Request instance for ModifyAttributeLabel.
|
447
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ModifyAttributeLabelRequest`
|
448
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ModifyAttributeLabelResponse`
|
449
|
+
def ModifyAttributeLabel(request)
|
450
|
+
body = send_request('ModifyAttributeLabel', request.serialize)
|
451
|
+
response = JSON.parse(body)
|
452
|
+
if response['Response'].key?('Error') == false
|
453
|
+
model = ModifyAttributeLabelResponse.new
|
454
|
+
model.deserialize(response['Response'])
|
455
|
+
model
|
456
|
+
else
|
457
|
+
code = response['Response']['Error']['Code']
|
458
|
+
message = response['Response']['Error']['Message']
|
459
|
+
reqid = response['Response']['RequestId']
|
460
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
461
|
+
end
|
462
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
463
|
+
raise e
|
464
|
+
rescue StandardError => e
|
465
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
466
|
+
end
|
467
|
+
|
468
|
+
# 用于修改已有的问答对。 使用场景:当需要更新问答对的内容或答案时使用。
|
469
|
+
|
470
|
+
# @param request: Request instance for ModifyQA.
|
471
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ModifyQARequest`
|
472
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ModifyQAResponse`
|
473
|
+
def ModifyQA(request)
|
474
|
+
body = send_request('ModifyQA', request.serialize)
|
475
|
+
response = JSON.parse(body)
|
476
|
+
if response['Response'].key?('Error') == false
|
477
|
+
model = ModifyQAResponse.new
|
478
|
+
model.deserialize(response['Response'])
|
479
|
+
model
|
480
|
+
else
|
481
|
+
code = response['Response']['Error']['Code']
|
482
|
+
message = response['Response']['Error']['Message']
|
483
|
+
reqid = response['Response']['RequestId']
|
484
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
485
|
+
end
|
486
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
487
|
+
raise e
|
488
|
+
rescue StandardError => e
|
489
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
490
|
+
end
|
491
|
+
|
492
|
+
# 准实时文档解析接口,使用HTTP SSE 协议通信。
|
493
|
+
|
494
|
+
# @param request: Request instance for ReconstructDocumentSSE.
|
495
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::ReconstructDocumentSSERequest`
|
496
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::ReconstructDocumentSSEResponse`
|
497
|
+
def ReconstructDocumentSSE(request)
|
498
|
+
body = send_request('ReconstructDocumentSSE', request.serialize)
|
499
|
+
response = JSON.parse(body)
|
500
|
+
if response['Response'].key?('Error') == false
|
501
|
+
model = ReconstructDocumentSSEResponse.new
|
502
|
+
model.deserialize(response['Response'])
|
503
|
+
model
|
504
|
+
else
|
505
|
+
code = response['Response']['Error']['Code']
|
506
|
+
message = response['Response']['Error']['Message']
|
507
|
+
reqid = response['Response']['RequestId']
|
508
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
509
|
+
end
|
510
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
511
|
+
raise e
|
512
|
+
rescue StandardError => e
|
513
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
514
|
+
end
|
515
|
+
|
516
|
+
# 用于检索知识库中的文档和问答对内容。 使用场景:适用于查询长期存储在知识库中的文档和问答对,比如产品手册、用户指南等内容的检索。
|
517
|
+
|
518
|
+
# @param request: Request instance for RetrieveKnowledge.
|
519
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::RetrieveKnowledgeRequest`
|
520
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::RetrieveKnowledgeResponse`
|
521
|
+
def RetrieveKnowledge(request)
|
522
|
+
body = send_request('RetrieveKnowledge', request.serialize)
|
523
|
+
response = JSON.parse(body)
|
524
|
+
if response['Response'].key?('Error') == false
|
525
|
+
model = RetrieveKnowledgeResponse.new
|
526
|
+
model.deserialize(response['Response'])
|
527
|
+
model
|
528
|
+
else
|
529
|
+
code = response['Response']['Error']['Code']
|
530
|
+
message = response['Response']['Error']['Message']
|
531
|
+
reqid = response['Response']['RequestId']
|
532
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
533
|
+
end
|
534
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
535
|
+
raise e
|
536
|
+
rescue StandardError => e
|
537
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
538
|
+
end
|
539
|
+
|
540
|
+
# 基于知识引擎精调模型技术的rerank模型,支持对多路召回的结果进行重排序,根据query与切片内容的相关性,按分数由高到低对切片进行排序,并输出对应的打分结果。
|
541
|
+
|
542
|
+
# @param request: Request instance for RunRerank.
|
543
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::RunRerankRequest`
|
544
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::RunRerankResponse`
|
545
|
+
def RunRerank(request)
|
546
|
+
body = send_request('RunRerank', request.serialize)
|
547
|
+
response = JSON.parse(body)
|
548
|
+
if response['Response'].key?('Error') == false
|
549
|
+
model = RunRerankResponse.new
|
550
|
+
model.deserialize(response['Response'])
|
551
|
+
model
|
552
|
+
else
|
553
|
+
code = response['Response']['Error']['Code']
|
554
|
+
message = response['Response']['Error']['Message']
|
555
|
+
reqid = response['Response']['RequestId']
|
556
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
557
|
+
end
|
558
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
559
|
+
raise e
|
560
|
+
rescue StandardError => e
|
561
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
562
|
+
end
|
563
|
+
|
564
|
+
# 用于上传文档内容。上传的文档将存储在知识库中,可以通过SearchKnowledge知识库内容检索接口进行检索。
|
565
|
+
# 使用场景:适用于需要长期存储和检索的文档内容,如产品手册、用户指南等。
|
566
|
+
|
567
|
+
# @param request: Request instance for UploadDoc.
|
568
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::UploadDocRequest`
|
569
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::UploadDocResponse`
|
570
|
+
def UploadDoc(request)
|
571
|
+
body = send_request('UploadDoc', request.serialize)
|
572
|
+
response = JSON.parse(body)
|
573
|
+
if response['Response'].key?('Error') == false
|
574
|
+
model = UploadDocResponse.new
|
575
|
+
model.deserialize(response['Response'])
|
576
|
+
model
|
577
|
+
else
|
578
|
+
code = response['Response']['Error']['Code']
|
579
|
+
message = response['Response']['Error']['Message']
|
580
|
+
reqid = response['Response']['RequestId']
|
581
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
582
|
+
end
|
583
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
584
|
+
raise e
|
585
|
+
rescue StandardError => e
|
586
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
587
|
+
end
|
588
|
+
|
589
|
+
# 用于上传实时文档内容。实时文档在上传后可以立即通过SearchRealtime进行实时检索,适用于在会话中对文档进行问答的场景。
|
590
|
+
|
591
|
+
# @param request: Request instance for UploadDocRealtime.
|
592
|
+
# @type request: :class:`Tencentcloud::lkeap::V20240522::UploadDocRealtimeRequest`
|
593
|
+
# @rtype: :class:`Tencentcloud::lkeap::V20240522::UploadDocRealtimeResponse`
|
594
|
+
def UploadDocRealtime(request)
|
595
|
+
body = send_request('UploadDocRealtime', request.serialize)
|
596
|
+
response = JSON.parse(body)
|
597
|
+
if response['Response'].key?('Error') == false
|
598
|
+
model = UploadDocRealtimeResponse.new
|
599
|
+
model.deserialize(response['Response'])
|
600
|
+
model
|
601
|
+
else
|
602
|
+
code = response['Response']['Error']['Code']
|
603
|
+
message = response['Response']['Error']['Message']
|
604
|
+
reqid = response['Response']['RequestId']
|
605
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
606
|
+
end
|
607
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
608
|
+
raise e
|
609
|
+
rescue StandardError => e
|
610
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
611
|
+
end
|
612
|
+
|
613
|
+
|
614
|
+
end
|
615
|
+
end
|
616
|
+
end
|
617
|
+
end
|