tencentcloud-sdk-es 3.0.1037 → 3.0.1038

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51c5ffa81b3fa2402cb59cd457b84cf5673dd7bc
4
- data.tar.gz: ffe1cd7c578d25ee18956c611a6f23b8880ab5e7
3
+ metadata.gz: f26534bd5592e9a32ca2d24276da67e99ae9a649
4
+ data.tar.gz: e76fd4779a3ee508b59ac914bff6f82d0806505d
5
5
  SHA512:
6
- metadata.gz: a71f4d88d3705365716f2442b9c412d625b54d0a66ea171872797b0bd84482ed0d93191fd39526f57b8aaf5a67fa368251df10443313703b5d7130866039f171
7
- data.tar.gz: ae556dcb0bf9856aabc082df479a585357ecfa7a0d099bbefac8db45b791dd2a95bcffa333cda196033f68d2c0dca841b73ca9021b935e0c0b1bf35d374b5885
6
+ metadata.gz: b7d881837ac5dcab0119aed750332df99134c8f591a17e41ac836cfb4021e50bfc2a418eba1ddba1968ec23b944584f61f85809d1532b862f40e152de2c676c2
7
+ data.tar.gz: 37a60ab754ea02ac9d9628647d17d0195b81e7eafdbb18e8c2dfc506eda6ef3b175ea8e4352ab74ee7a234002dbf1eaf666655f18b5daec688c708c031d1eb0e
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1037
1
+ 3.0.1038
@@ -2,6 +2,9 @@
2
2
 
3
3
  require 'tencentcloud-sdk-common'
4
4
 
5
+ require_relative 'v20250101/client'
6
+ require_relative 'v20250101/models'
7
+
5
8
  require_relative 'v20180416/client'
6
9
  require_relative 'v20180416/models'
7
10
 
@@ -283,7 +283,7 @@ module TencentCloud
283
283
  # @param Version: 快照版本
284
284
  # 注意:此字段可能返回 null,表示取不到有效值。
285
285
  # @type Version: String
286
- # @param CommonIndexArr: 普通索引信息列表
286
+ # @param CommonIndexArr: 普通[{"DataStreamName":"ilm-history-5","Is索引信息列表
287
287
  # 注意:此字段可能返回 null,表示取不到有效值。
288
288
  # @type CommonIndexArr: Array
289
289
  # @param DataStreamArr: 自治索引信息列表
@@ -4927,10 +4927,16 @@ module TencentCloud
4927
4927
  # @param QueueCheckPointWrites: 管道缓冲队列检查点写入数
4928
4928
  # 注意:此字段可能返回 null,表示取不到有效值。
4929
4929
  # @type QueueCheckPointWrites: Integer
4930
+ # @param CreateTime: 创建时间
4931
+ # 注意:此字段可能返回 null,表示取不到有效值。
4932
+ # @type CreateTime: String
4933
+ # @param UpdateTime: 更新时间
4934
+ # 注意:此字段可能返回 null,表示取不到有效值。
4935
+ # @type UpdateTime: String
4930
4936
 
4931
- attr_accessor :PipelineId, :PipelineDesc, :Config, :Status, :Workers, :BatchSize, :BatchDelay, :QueueType, :QueueMaxBytes, :QueueCheckPointWrites
4937
+ attr_accessor :PipelineId, :PipelineDesc, :Config, :Status, :Workers, :BatchSize, :BatchDelay, :QueueType, :QueueMaxBytes, :QueueCheckPointWrites, :CreateTime, :UpdateTime
4932
4938
 
4933
- def initialize(pipelineid=nil, pipelinedesc=nil, config=nil, status=nil, workers=nil, batchsize=nil, batchdelay=nil, queuetype=nil, queuemaxbytes=nil, queuecheckpointwrites=nil)
4939
+ def initialize(pipelineid=nil, pipelinedesc=nil, config=nil, status=nil, workers=nil, batchsize=nil, batchdelay=nil, queuetype=nil, queuemaxbytes=nil, queuecheckpointwrites=nil, createtime=nil, updatetime=nil)
4934
4940
  @PipelineId = pipelineid
4935
4941
  @PipelineDesc = pipelinedesc
4936
4942
  @Config = config
@@ -4941,6 +4947,8 @@ module TencentCloud
4941
4947
  @QueueType = queuetype
4942
4948
  @QueueMaxBytes = queuemaxbytes
4943
4949
  @QueueCheckPointWrites = queuecheckpointwrites
4950
+ @CreateTime = createtime
4951
+ @UpdateTime = updatetime
4944
4952
  end
4945
4953
 
4946
4954
  def deserialize(params)
@@ -4954,6 +4962,8 @@ module TencentCloud
4954
4962
  @QueueType = params['QueueType']
4955
4963
  @QueueMaxBytes = params['QueueMaxBytes']
4956
4964
  @QueueCheckPointWrites = params['QueueCheckPointWrites']
4965
+ @CreateTime = params['CreateTime']
4966
+ @UpdateTime = params['UpdateTime']
4957
4967
  end
4958
4968
  end
4959
4969
 
@@ -5957,7 +5967,7 @@ module TencentCloud
5957
5967
  # @type StorageType: Integer
5958
5968
  # @param TagList: 标签信息
5959
5969
  # @type TagList: Array
5960
- # @param IndexTraffic: 3782478.47
5970
+ # @param IndexTraffic: 索引流量,单位byte
5961
5971
  # 注意:此字段可能返回 null,表示取不到有效值。
5962
5972
  # @type IndexTraffic: Float
5963
5973
 
@@ -6178,7 +6188,7 @@ module TencentCloud
6178
6188
  # @param ClusterType: 0
6179
6189
  # 注意:此字段可能返回 null,表示取不到有效值。
6180
6190
  # @type ClusterType: Integer
6181
- # @param TagList: key:value
6191
+ # @param TagList: 空间标签信息
6182
6192
  # 注意:此字段可能返回 null,表示取不到有效值。
6183
6193
  # @type TagList: Array
6184
6194
 
@@ -6366,10 +6376,13 @@ module TencentCloud
6366
6376
  # @param Failures: 备份失败的索引分片和失败原因
6367
6377
  # 注意:此字段可能返回 null,表示取不到有效值。
6368
6378
  # @type Failures: Array
6379
+ # @param UserBackUp: 是否用户备份
6380
+ # 注意:此字段可能返回 null,表示取不到有效值。
6381
+ # @type UserBackUp: String
6369
6382
 
6370
- attr_accessor :SnapshotName, :Uuid, :Version, :Indices, :DataStreams, :State, :StartTime, :EndTime, :DurationInMillis, :TotalShards, :FailedShards, :SuccessfulShards, :Failures
6383
+ attr_accessor :SnapshotName, :Uuid, :Version, :Indices, :DataStreams, :State, :StartTime, :EndTime, :DurationInMillis, :TotalShards, :FailedShards, :SuccessfulShards, :Failures, :UserBackUp
6371
6384
 
6372
- def initialize(snapshotname=nil, uuid=nil, version=nil, indices=nil, datastreams=nil, state=nil, starttime=nil, endtime=nil, durationinmillis=nil, totalshards=nil, failedshards=nil, successfulshards=nil, failures=nil)
6385
+ def initialize(snapshotname=nil, uuid=nil, version=nil, indices=nil, datastreams=nil, state=nil, starttime=nil, endtime=nil, durationinmillis=nil, totalshards=nil, failedshards=nil, successfulshards=nil, failures=nil, userbackup=nil)
6373
6386
  @SnapshotName = snapshotname
6374
6387
  @Uuid = uuid
6375
6388
  @Version = version
@@ -6383,6 +6396,7 @@ module TencentCloud
6383
6396
  @FailedShards = failedshards
6384
6397
  @SuccessfulShards = successfulshards
6385
6398
  @Failures = failures
6399
+ @UserBackUp = userbackup
6386
6400
  end
6387
6401
 
6388
6402
  def deserialize(params)
@@ -6406,6 +6420,7 @@ module TencentCloud
6406
6420
  @Failures << failures_tmp
6407
6421
  end
6408
6422
  end
6423
+ @UserBackUp = params['UserBackUp']
6409
6424
  end
6410
6425
  end
6411
6426
 
@@ -0,0 +1,257 @@
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 Es
21
+ module V20250101
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2025-01-01'
26
+ api_endpoint = 'es.tencentcloudapi.com'
27
+ sdk_version = 'ES_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 本服务支持一系列高性能的大语言模型,包括DeepSeek以及腾讯自主研发的混元大模型,结合混合搜索等先进搜索技术,快速高效实现RAG,有效解决幻觉和知识更新问题。
33
+ # 本接口有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
34
+
35
+ # @param request: Request instance for ChatCompletions.
36
+ # @type request: :class:`Tencentcloud::es::V20250101::ChatCompletionsRequest`
37
+ # @rtype: :class:`Tencentcloud::es::V20250101::ChatCompletionsResponse`
38
+ def ChatCompletions(request)
39
+ body = send_request('ChatCompletions', request.serialize)
40
+ response = JSON.parse(body)
41
+ if response['Response'].key?('Error') == false
42
+ model = ChatCompletionsResponse.new
43
+ model.deserialize(response['Response'])
44
+ model
45
+ else
46
+ code = response['Response']['Error']['Code']
47
+ message = response['Response']['Error']['Message']
48
+ reqid = response['Response']['RequestId']
49
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
50
+ end
51
+ rescue TencentCloud::Common::TencentCloudSDKException => e
52
+ raise e
53
+ rescue StandardError => e
54
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
55
+ end
56
+
57
+ # 实时文档切片
58
+
59
+ # @param request: Request instance for ChunkDocument.
60
+ # @type request: :class:`Tencentcloud::es::V20250101::ChunkDocumentRequest`
61
+ # @rtype: :class:`Tencentcloud::es::V20250101::ChunkDocumentResponse`
62
+ def ChunkDocument(request)
63
+ body = send_request('ChunkDocument', request.serialize)
64
+ response = JSON.parse(body)
65
+ if response['Response'].key?('Error') == false
66
+ model = ChunkDocumentResponse.new
67
+ model.deserialize(response['Response'])
68
+ model
69
+ else
70
+ code = response['Response']['Error']['Code']
71
+ message = response['Response']['Error']['Message']
72
+ reqid = response['Response']['RequestId']
73
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
74
+ end
75
+ rescue TencentCloud::Common::TencentCloudSDKException => e
76
+ raise e
77
+ rescue StandardError => e
78
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
79
+ end
80
+
81
+ # 文本切片是将长文本分割为短片段的技术,用于适配模型输入、提升处理效率或信息检索,平衡片段长度与语义连贯性,适用于NLP、数据分析等场景。
82
+ # 本接口为异步接口,有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
83
+
84
+ # @param request: Request instance for ChunkDocumentAsync.
85
+ # @type request: :class:`Tencentcloud::es::V20250101::ChunkDocumentAsyncRequest`
86
+ # @rtype: :class:`Tencentcloud::es::V20250101::ChunkDocumentAsyncResponse`
87
+ def ChunkDocumentAsync(request)
88
+ body = send_request('ChunkDocumentAsync', request.serialize)
89
+ response = JSON.parse(body)
90
+ if response['Response'].key?('Error') == false
91
+ model = ChunkDocumentAsyncResponse.new
92
+ model.deserialize(response['Response'])
93
+ model
94
+ else
95
+ code = response['Response']['Error']['Code']
96
+ message = response['Response']['Error']['Message']
97
+ reqid = response['Response']['RequestId']
98
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
99
+ end
100
+ rescue TencentCloud::Common::TencentCloudSDKException => e
101
+ raise e
102
+ rescue StandardError => e
103
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
104
+ end
105
+
106
+ # 获取文档切片结果
107
+
108
+ # @param request: Request instance for GetDocumentChunkResult.
109
+ # @type request: :class:`Tencentcloud::es::V20250101::GetDocumentChunkResultRequest`
110
+ # @rtype: :class:`Tencentcloud::es::V20250101::GetDocumentChunkResultResponse`
111
+ def GetDocumentChunkResult(request)
112
+ body = send_request('GetDocumentChunkResult', request.serialize)
113
+ response = JSON.parse(body)
114
+ if response['Response'].key?('Error') == false
115
+ model = GetDocumentChunkResultResponse.new
116
+ model.deserialize(response['Response'])
117
+ model
118
+ else
119
+ code = response['Response']['Error']['Code']
120
+ message = response['Response']['Error']['Message']
121
+ reqid = response['Response']['RequestId']
122
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
123
+ end
124
+ rescue TencentCloud::Common::TencentCloudSDKException => e
125
+ raise e
126
+ rescue StandardError => e
127
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
128
+ end
129
+
130
+ # 本接口用于获取文档解析异步处理结果。
131
+
132
+ # @param request: Request instance for GetDocumentParseResult.
133
+ # @type request: :class:`Tencentcloud::es::V20250101::GetDocumentParseResultRequest`
134
+ # @rtype: :class:`Tencentcloud::es::V20250101::GetDocumentParseResultResponse`
135
+ def GetDocumentParseResult(request)
136
+ body = send_request('GetDocumentParseResult', request.serialize)
137
+ response = JSON.parse(body)
138
+ if response['Response'].key?('Error') == false
139
+ model = GetDocumentParseResultResponse.new
140
+ model.deserialize(response['Response'])
141
+ model
142
+ else
143
+ code = response['Response']['Error']['Code']
144
+ message = response['Response']['Error']['Message']
145
+ reqid = response['Response']['RequestId']
146
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
147
+ end
148
+ rescue TencentCloud::Common::TencentCloudSDKException => e
149
+ raise e
150
+ rescue StandardError => e
151
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
152
+ end
153
+
154
+ # Embedding是一种将高维数据映射到低维空间的技术,通常用于将非结构化数据,如文本、图像或音频转化为向量表示,使其更容易输入机器模型进行处理,并且向量之间的距离可以反映对象之间的相似性。
155
+ # 本接口有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
156
+
157
+ # @param request: Request instance for GetTextEmbedding.
158
+ # @type request: :class:`Tencentcloud::es::V20250101::GetTextEmbeddingRequest`
159
+ # @rtype: :class:`Tencentcloud::es::V20250101::GetTextEmbeddingResponse`
160
+ def GetTextEmbedding(request)
161
+ body = send_request('GetTextEmbedding', request.serialize)
162
+ response = JSON.parse(body)
163
+ if response['Response'].key?('Error') == false
164
+ model = GetTextEmbeddingResponse.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
+ # 本接口有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service)。
181
+
182
+ # @param request: Request instance for ParseDocument.
183
+ # @type request: :class:`Tencentcloud::es::V20250101::ParseDocumentRequest`
184
+ # @rtype: :class:`Tencentcloud::es::V20250101::ParseDocumentResponse`
185
+ def ParseDocument(request)
186
+ body = send_request('ParseDocument', request.serialize)
187
+ response = JSON.parse(body)
188
+ if response['Response'].key?('Error') == false
189
+ model = ParseDocumentResponse.new
190
+ model.deserialize(response['Response'])
191
+ model
192
+ else
193
+ code = response['Response']['Error']['Code']
194
+ message = response['Response']['Error']['Message']
195
+ reqid = response['Response']['RequestId']
196
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
197
+ end
198
+ rescue TencentCloud::Common::TencentCloudSDKException => e
199
+ raise e
200
+ rescue StandardError => e
201
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
202
+ end
203
+
204
+ # 本服务可将各类格式文档精准转换为标准格式,满足企业知识库建设、技术文档迁移、内容平台结构化存储等需求。
205
+ # 本接口为异步接口,有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
206
+
207
+ # @param request: Request instance for ParseDocumentAsync.
208
+ # @type request: :class:`Tencentcloud::es::V20250101::ParseDocumentAsyncRequest`
209
+ # @rtype: :class:`Tencentcloud::es::V20250101::ParseDocumentAsyncResponse`
210
+ def ParseDocumentAsync(request)
211
+ body = send_request('ParseDocumentAsync', request.serialize)
212
+ response = JSON.parse(body)
213
+ if response['Response'].key?('Error') == false
214
+ model = ParseDocumentAsyncResponse.new
215
+ model.deserialize(response['Response'])
216
+ model
217
+ else
218
+ code = response['Response']['Error']['Code']
219
+ message = response['Response']['Error']['Message']
220
+ reqid = response['Response']['RequestId']
221
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
222
+ end
223
+ rescue TencentCloud::Common::TencentCloudSDKException => e
224
+ raise e
225
+ rescue StandardError => e
226
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
227
+ end
228
+
229
+ # 重排序
230
+
231
+ # @param request: Request instance for RunRerank.
232
+ # @type request: :class:`Tencentcloud::es::V20250101::RunRerankRequest`
233
+ # @rtype: :class:`Tencentcloud::es::V20250101::RunRerankResponse`
234
+ def RunRerank(request)
235
+ body = send_request('RunRerank', request.serialize)
236
+ response = JSON.parse(body)
237
+ if response['Response'].key?('Error') == false
238
+ model = RunRerankResponse.new
239
+ model.deserialize(response['Response'])
240
+ model
241
+ else
242
+ code = response['Response']['Error']['Code']
243
+ message = response['Response']['Error']['Message']
244
+ reqid = response['Response']['RequestId']
245
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
246
+ end
247
+ rescue TencentCloud::Common::TencentCloudSDKException => e
248
+ raise e
249
+ rescue StandardError => e
250
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
251
+ end
252
+
253
+
254
+ end
255
+ end
256
+ end
257
+ end
@@ -0,0 +1,907 @@
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
+ module TencentCloud
18
+ module Es
19
+ module V20250101
20
+ # ChatCompletions请求参数结构体
21
+ class ChatCompletionsRequest < TencentCloud::Common::AbstractModel
22
+ # @param Messages: 会话内容,按对话时间从旧到新在数组中排列,长度受模型窗口大小限制
23
+ # @type Messages: Array
24
+ # @param ModelName: 模型名称
25
+ # @type ModelName: String
26
+ # @param Stream: 是否以流式接口的形式返回数据,默认true
27
+ # @type Stream: Boolean
28
+ # @param TopP: 取值区间为[0.0, 1.0], 非必要不建议使用, 不合理的取值会影响效果
29
+ # @type TopP: Float
30
+ # @param Temperature: 取值区间为[0.0, 2.0], 非必要不建议使用, 不合理的取值会影响效果
31
+ # @type Temperature: Float
32
+ # @param OnlineSearch: 是否开启联网搜索。默认为 false。
33
+ # @type OnlineSearch: Boolean
34
+ # @param OnlineSearchOptions: 当 OnlineSearch 为 true 时,指定的搜索引擎,默认为 bing。
35
+ # @type OnlineSearchOptions: :class:`Tencentcloud::Es.v20250101.models.OnlineSearchOptions`
36
+
37
+ attr_accessor :Messages, :ModelName, :Stream, :TopP, :Temperature, :OnlineSearch, :OnlineSearchOptions
38
+
39
+ def initialize(messages=nil, modelname=nil, stream=nil, topp=nil, temperature=nil, onlinesearch=nil, onlinesearchoptions=nil)
40
+ @Messages = messages
41
+ @ModelName = modelname
42
+ @Stream = stream
43
+ @TopP = topp
44
+ @Temperature = temperature
45
+ @OnlineSearch = onlinesearch
46
+ @OnlineSearchOptions = onlinesearchoptions
47
+ end
48
+
49
+ def deserialize(params)
50
+ unless params['Messages'].nil?
51
+ @Messages = []
52
+ params['Messages'].each do |i|
53
+ message_tmp = Message.new
54
+ message_tmp.deserialize(i)
55
+ @Messages << message_tmp
56
+ end
57
+ end
58
+ @ModelName = params['ModelName']
59
+ @Stream = params['Stream']
60
+ @TopP = params['TopP']
61
+ @Temperature = params['Temperature']
62
+ @OnlineSearch = params['OnlineSearch']
63
+ unless params['OnlineSearchOptions'].nil?
64
+ @OnlineSearchOptions = OnlineSearchOptions.new
65
+ @OnlineSearchOptions.deserialize(params['OnlineSearchOptions'])
66
+ end
67
+ end
68
+ end
69
+
70
+ # ChatCompletions返回参数结构体
71
+ class ChatCompletionsResponse < TencentCloud::Common::AbstractModel
72
+ # @param Id: 此次请求的id
73
+ # @type Id: String
74
+ # @param Choices: 回复内容
75
+ # @type Choices: Array
76
+ # @param Usage: token使用量
77
+ # @type Usage: :class:`Tencentcloud::Es.v20250101.models.TokenUsage`
78
+ # @param OnlineSearchContent: 联网搜索结果。
79
+ # 注意:此字段可能返回 null,表示取不到有效值。
80
+ # @type OnlineSearchContent: Array
81
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
82
+ # @type RequestId: String
83
+
84
+ attr_accessor :Id, :Choices, :Usage, :OnlineSearchContent, :RequestId
85
+
86
+ def initialize(id=nil, choices=nil, usage=nil, onlinesearchcontent=nil, requestid=nil)
87
+ @Id = id
88
+ @Choices = choices
89
+ @Usage = usage
90
+ @OnlineSearchContent = onlinesearchcontent
91
+ @RequestId = requestid
92
+ end
93
+
94
+ def deserialize(params)
95
+ @Id = params['Id']
96
+ unless params['Choices'].nil?
97
+ @Choices = []
98
+ params['Choices'].each do |i|
99
+ choice_tmp = Choice.new
100
+ choice_tmp.deserialize(i)
101
+ @Choices << choice_tmp
102
+ end
103
+ end
104
+ unless params['Usage'].nil?
105
+ @Usage = TokenUsage.new
106
+ @Usage.deserialize(params['Usage'])
107
+ end
108
+ unless params['OnlineSearchContent'].nil?
109
+ @OnlineSearchContent = []
110
+ params['OnlineSearchContent'].each do |i|
111
+ webcontent_tmp = WebContent.new
112
+ webcontent_tmp.deserialize(i)
113
+ @OnlineSearchContent << webcontent_tmp
114
+ end
115
+ end
116
+ @RequestId = params['RequestId']
117
+ end
118
+ end
119
+
120
+ # 返回的回复, 支持多个。
121
+ class Choice < TencentCloud::Common::AbstractModel
122
+ # @param Message: 返回的回复。
123
+ # @type Message: :class:`Tencentcloud::Es.v20250101.models.OutputMessage`
124
+
125
+ attr_accessor :Message
126
+
127
+ def initialize(message=nil)
128
+ @Message = message
129
+ end
130
+
131
+ def deserialize(params)
132
+ unless params['Message'].nil?
133
+ @Message = OutputMessage.new
134
+ @Message.deserialize(params['Message'])
135
+ end
136
+ end
137
+ end
138
+
139
+ # 切片对象信息
140
+ class Chunk < TencentCloud::Common::AbstractModel
141
+ # @param Index: chunk索引。切片顺序 id。
142
+ # @type Index: Integer
143
+ # @param Content: chunk内容。
144
+ # @type Content: String
145
+
146
+ attr_accessor :Index, :Content
147
+
148
+ def initialize(index=nil, content=nil)
149
+ @Index = index
150
+ @Content = content
151
+ end
152
+
153
+ def deserialize(params)
154
+ @Index = params['Index']
155
+ @Content = params['Content']
156
+ end
157
+ end
158
+
159
+ # 文档分片配置
160
+ class ChunkConfig < TencentCloud::Common::AbstractModel
161
+ # @param MaxChunkSize: 最大分片长度
162
+ # @type MaxChunkSize: Integer
163
+ # @param Delimiters: 分隔符列表
164
+ # @type Delimiters: Array
165
+
166
+ attr_accessor :MaxChunkSize, :Delimiters
167
+
168
+ def initialize(maxchunksize=nil, delimiters=nil)
169
+ @MaxChunkSize = maxchunksize
170
+ @Delimiters = delimiters
171
+ end
172
+
173
+ def deserialize(params)
174
+ @MaxChunkSize = params['MaxChunkSize']
175
+ @Delimiters = params['Delimiters']
176
+ end
177
+ end
178
+
179
+ # 文档切片异步任务
180
+ class ChunkConfigAsync < TencentCloud::Common::AbstractModel
181
+ # @param MaxChunkSize: 最大分片长度
182
+ # @type MaxChunkSize: Integer
183
+
184
+ attr_accessor :MaxChunkSize
185
+
186
+ def initialize(maxchunksize=nil)
187
+ @MaxChunkSize = maxchunksize
188
+ end
189
+
190
+ def deserialize(params)
191
+ @MaxChunkSize = params['MaxChunkSize']
192
+ end
193
+ end
194
+
195
+ # 切片文档信息
196
+ class ChunkDocument < TencentCloud::Common::AbstractModel
197
+ # @param FileType: 文件类型
198
+ # @type FileType: String
199
+ # @param FileContent: 文件的 base64值
200
+ # @type FileContent: String
201
+
202
+ attr_accessor :FileType, :FileContent
203
+
204
+ def initialize(filetype=nil, filecontent=nil)
205
+ @FileType = filetype
206
+ @FileContent = filecontent
207
+ end
208
+
209
+ def deserialize(params)
210
+ @FileType = params['FileType']
211
+ @FileContent = params['FileContent']
212
+ end
213
+ end
214
+
215
+ # ChunkDocumentAsync请求参数结构体
216
+ class ChunkDocumentAsyncRequest < TencentCloud::Common::AbstractModel
217
+ # @param Document: 文件信息
218
+ # @type Document: :class:`Tencentcloud::Es.v20250101.models.Document`
219
+ # @param ModelName: 模型名称
220
+ # @type ModelName: String
221
+ # @param Config: 文件切片配置
222
+ # @type Config: :class:`Tencentcloud::Es.v20250101.models.ChunkConfigAsync`
223
+
224
+ attr_accessor :Document, :ModelName, :Config
225
+
226
+ def initialize(document=nil, modelname=nil, config=nil)
227
+ @Document = document
228
+ @ModelName = modelname
229
+ @Config = config
230
+ end
231
+
232
+ def deserialize(params)
233
+ unless params['Document'].nil?
234
+ @Document = Document.new
235
+ @Document.deserialize(params['Document'])
236
+ end
237
+ @ModelName = params['ModelName']
238
+ unless params['Config'].nil?
239
+ @Config = ChunkConfigAsync.new
240
+ @Config.deserialize(params['Config'])
241
+ end
242
+ end
243
+ end
244
+
245
+ # ChunkDocumentAsync返回参数结构体
246
+ class ChunkDocumentAsyncResponse < TencentCloud::Common::AbstractModel
247
+ # @param TaskId: 任务 ID
248
+ # @type TaskId: String
249
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
250
+ # @type RequestId: String
251
+
252
+ attr_accessor :TaskId, :RequestId
253
+
254
+ def initialize(taskid=nil, requestid=nil)
255
+ @TaskId = taskid
256
+ @RequestId = requestid
257
+ end
258
+
259
+ def deserialize(params)
260
+ @TaskId = params['TaskId']
261
+ @RequestId = params['RequestId']
262
+ end
263
+ end
264
+
265
+ # ChunkDocument请求参数结构体
266
+ class ChunkDocumentRequest < TencentCloud::Common::AbstractModel
267
+ # @param Document: 文件切片文件信息
268
+ # @type Document: :class:`Tencentcloud::Es.v20250101.models.ChunkDocument`
269
+ # @param ModelName: 模型名称
270
+ # @type ModelName: String
271
+ # @param Config: 文件切片配置
272
+ # @type Config: :class:`Tencentcloud::Es.v20250101.models.ChunkConfig`
273
+
274
+ attr_accessor :Document, :ModelName, :Config
275
+
276
+ def initialize(document=nil, modelname=nil, config=nil)
277
+ @Document = document
278
+ @ModelName = modelname
279
+ @Config = config
280
+ end
281
+
282
+ def deserialize(params)
283
+ unless params['Document'].nil?
284
+ @Document = ChunkDocument.new
285
+ @Document.deserialize(params['Document'])
286
+ end
287
+ @ModelName = params['ModelName']
288
+ unless params['Config'].nil?
289
+ @Config = ChunkConfig.new
290
+ @Config.deserialize(params['Config'])
291
+ end
292
+ end
293
+ end
294
+
295
+ # ChunkDocument返回参数结构体
296
+ class ChunkDocumentResponse < TencentCloud::Common::AbstractModel
297
+ # @param Chunks: 无
298
+ # @type Chunks: Array
299
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
300
+ # @type RequestId: String
301
+
302
+ attr_accessor :Chunks, :RequestId
303
+
304
+ def initialize(chunks=nil, requestid=nil)
305
+ @Chunks = chunks
306
+ @RequestId = requestid
307
+ end
308
+
309
+ def deserialize(params)
310
+ unless params['Chunks'].nil?
311
+ @Chunks = []
312
+ params['Chunks'].each do |i|
313
+ chunk_tmp = Chunk.new
314
+ chunk_tmp.deserialize(i)
315
+ @Chunks << chunk_tmp
316
+ end
317
+ end
318
+ @RequestId = params['RequestId']
319
+ end
320
+ end
321
+
322
+ # 文档信息
323
+ class Document < TencentCloud::Common::AbstractModel
324
+ # @param FileType: 文件类型。
325
+ # 支持的文件类型:PDF、DOC、DOCX、PPT、PPTX、MD、TXT、XLS、XLSX、CSV、PNG、JPG、JPEG、BMP、GIF、WEBP、HEIC、EPS、ICNS、IM、PCX、PPM、TIFF、XBM、HEIF、JP2
326
+ # 支持的文件大小:
327
+ # - PDF、DOC、DOCX、PPT、PPTX 支持100M
328
+ # - MD、TXT、XLS、XLSX、CSV 支持10M
329
+ # - 其他支持20M
330
+ # @type FileType: String
331
+ # @param FileUrl: 文件存储于腾讯云的 URL 可保障更高的下载速度和稳定性,使用腾讯云COS 文件地址。
332
+ # @type FileUrl: String
333
+ # @param FileContent: 文件的 base64 值,携带 MineType前缀信息。编码后的后的文件不超过 10M。
334
+ # 支持的文件大小:所下载文件经Base64编码后不超过 8M。文件下载时间不超过3秒。
335
+ # 支持的图片像素:单边介于20-10000px之间。
336
+ # @type FileContent: String
337
+ # @param FileName: 文件名称,当使用 base64上传的时候使用。
338
+ # @type FileName: String
339
+
340
+ attr_accessor :FileType, :FileUrl, :FileContent, :FileName
341
+
342
+ def initialize(filetype=nil, fileurl=nil, filecontent=nil, filename=nil)
343
+ @FileType = filetype
344
+ @FileUrl = fileurl
345
+ @FileContent = filecontent
346
+ @FileName = filename
347
+ end
348
+
349
+ def deserialize(params)
350
+ @FileType = params['FileType']
351
+ @FileUrl = params['FileUrl']
352
+ @FileContent = params['FileContent']
353
+ @FileName = params['FileName']
354
+ end
355
+ end
356
+
357
+ # 文档切片用量
358
+ class DocumentChunkUsage < TencentCloud::Common::AbstractModel
359
+ # @param PageNumber: 解析页面数量
360
+ # @type PageNumber: Integer
361
+ # @param TotalTokens: 消耗 token数量
362
+ # @type TotalTokens: Integer
363
+
364
+ attr_accessor :PageNumber, :TotalTokens
365
+
366
+ def initialize(pagenumber=nil, totaltokens=nil)
367
+ @PageNumber = pagenumber
368
+ @TotalTokens = totaltokens
369
+ end
370
+
371
+ def deserialize(params)
372
+ @PageNumber = params['PageNumber']
373
+ @TotalTokens = params['TotalTokens']
374
+ end
375
+ end
376
+
377
+ # 向量内容
378
+ class EmbeddingData < TencentCloud::Common::AbstractModel
379
+ # @param Embedding: embedding 内容
380
+ # 注意:此字段可能返回 null,表示取不到有效值。
381
+ # @type Embedding: Array
382
+ # @param Index: 索引序号
383
+ # 注意:此字段可能返回 null,表示取不到有效值。
384
+ # @type Index: Integer
385
+
386
+ attr_accessor :Embedding, :Index
387
+
388
+ def initialize(embedding=nil, index=nil)
389
+ @Embedding = embedding
390
+ @Index = index
391
+ end
392
+
393
+ def deserialize(params)
394
+ @Embedding = params['Embedding']
395
+ @Index = params['Index']
396
+ end
397
+ end
398
+
399
+ # GetDocumentChunkResult请求参数结构体
400
+ class GetDocumentChunkResultRequest < TencentCloud::Common::AbstractModel
401
+ # @param TaskId: 任务 ID
402
+ # @type TaskId: String
403
+
404
+ attr_accessor :TaskId
405
+
406
+ def initialize(taskid=nil)
407
+ @TaskId = taskid
408
+ end
409
+
410
+ def deserialize(params)
411
+ @TaskId = params['TaskId']
412
+ end
413
+ end
414
+
415
+ # GetDocumentChunkResult返回参数结构体
416
+ class GetDocumentChunkResultResponse < TencentCloud::Common::AbstractModel
417
+ # @param Status: 任务状态
418
+ # @type Status: Integer
419
+ # @param DocumentChunkResultUrl: 切片结果
420
+ # @type DocumentChunkResultUrl: String
421
+ # @param Usage: 用量
422
+ # @type Usage: :class:`Tencentcloud::Es.v20250101.models.DocumentChunkUsage`
423
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
424
+ # @type RequestId: String
425
+
426
+ attr_accessor :Status, :DocumentChunkResultUrl, :Usage, :RequestId
427
+
428
+ def initialize(status=nil, documentchunkresulturl=nil, usage=nil, requestid=nil)
429
+ @Status = status
430
+ @DocumentChunkResultUrl = documentchunkresulturl
431
+ @Usage = usage
432
+ @RequestId = requestid
433
+ end
434
+
435
+ def deserialize(params)
436
+ @Status = params['Status']
437
+ @DocumentChunkResultUrl = params['DocumentChunkResultUrl']
438
+ unless params['Usage'].nil?
439
+ @Usage = DocumentChunkUsage.new
440
+ @Usage.deserialize(params['Usage'])
441
+ end
442
+ @RequestId = params['RequestId']
443
+ end
444
+ end
445
+
446
+ # GetDocumentParseResult请求参数结构体
447
+ class GetDocumentParseResultRequest < TencentCloud::Common::AbstractModel
448
+ # @param TaskId: 任务 Id
449
+ # @type TaskId: String
450
+
451
+ attr_accessor :TaskId
452
+
453
+ def initialize(taskid=nil)
454
+ @TaskId = taskid
455
+ end
456
+
457
+ def deserialize(params)
458
+ @TaskId = params['TaskId']
459
+ end
460
+ end
461
+
462
+ # GetDocumentParseResult返回参数结构体
463
+ class GetDocumentParseResultResponse < TencentCloud::Common::AbstractModel
464
+ # @param Status: 任务状态
465
+ # @type Status: Integer
466
+ # @param DocumentParseResultUrl: 结果文件
467
+ # @type DocumentParseResultUrl: String
468
+ # @param FailedPages: 失败的页码
469
+ # 注意:此字段可能返回 null,表示取不到有效值。
470
+ # @type FailedPages: Array
471
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
472
+ # @type RequestId: String
473
+
474
+ attr_accessor :Status, :DocumentParseResultUrl, :FailedPages, :RequestId
475
+
476
+ def initialize(status=nil, documentparseresulturl=nil, failedpages=nil, requestid=nil)
477
+ @Status = status
478
+ @DocumentParseResultUrl = documentparseresulturl
479
+ @FailedPages = failedpages
480
+ @RequestId = requestid
481
+ end
482
+
483
+ def deserialize(params)
484
+ @Status = params['Status']
485
+ @DocumentParseResultUrl = params['DocumentParseResultUrl']
486
+ @FailedPages = params['FailedPages']
487
+ @RequestId = params['RequestId']
488
+ end
489
+ end
490
+
491
+ # GetTextEmbedding请求参数结构体
492
+ class GetTextEmbeddingRequest < TencentCloud::Common::AbstractModel
493
+ # @param ModelName: 模型名称
494
+ # @type ModelName: String
495
+ # @param Texts: 需进行向量化的文本集
496
+ # @type Texts: Array
497
+
498
+ attr_accessor :ModelName, :Texts
499
+
500
+ def initialize(modelname=nil, texts=nil)
501
+ @ModelName = modelname
502
+ @Texts = texts
503
+ end
504
+
505
+ def deserialize(params)
506
+ @ModelName = params['ModelName']
507
+ @Texts = params['Texts']
508
+ end
509
+ end
510
+
511
+ # GetTextEmbedding返回参数结构体
512
+ class GetTextEmbeddingResponse < TencentCloud::Common::AbstractModel
513
+ # @param Data: 结果集
514
+ # @type Data: Array
515
+ # @param Usage: 消耗token数量
516
+ # @type Usage: :class:`Tencentcloud::Es.v20250101.models.Usage`
517
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
518
+ # @type RequestId: String
519
+
520
+ attr_accessor :Data, :Usage, :RequestId
521
+
522
+ def initialize(data=nil, usage=nil, requestid=nil)
523
+ @Data = data
524
+ @Usage = usage
525
+ @RequestId = requestid
526
+ end
527
+
528
+ def deserialize(params)
529
+ unless params['Data'].nil?
530
+ @Data = []
531
+ params['Data'].each do |i|
532
+ embeddingdata_tmp = EmbeddingData.new
533
+ embeddingdata_tmp.deserialize(i)
534
+ @Data << embeddingdata_tmp
535
+ end
536
+ end
537
+ unless params['Usage'].nil?
538
+ @Usage = Usage.new
539
+ @Usage.deserialize(params['Usage'])
540
+ end
541
+ @RequestId = params['RequestId']
542
+ end
543
+ end
544
+
545
+ # 会话内容,按对话时间从旧到新在数组中排列,长度受模型窗口大小限制。
546
+ class Message < TencentCloud::Common::AbstractModel
547
+ # @param Role: 角色, ‘system', ‘user','assistant'或者'tool', 在message中, 除了system,其他必须是user与assistant交替(一问一答)
548
+ # @type Role: String
549
+ # @param Content: 具体文本内容
550
+ # @type Content: String
551
+
552
+ attr_accessor :Role, :Content
553
+
554
+ def initialize(role=nil, content=nil)
555
+ @Role = role
556
+ @Content = content
557
+ end
558
+
559
+ def deserialize(params)
560
+ @Role = params['Role']
561
+ @Content = params['Content']
562
+ end
563
+ end
564
+
565
+ # 联网搜索选项。
566
+ class OnlineSearchOptions < TencentCloud::Common::AbstractModel
567
+ # @param Engine: 搜索引擎。支持 bing 和 sogou。
568
+ # @type Engine: String
569
+
570
+ attr_accessor :Engine
571
+
572
+ def initialize(engine=nil)
573
+ @Engine = engine
574
+ end
575
+
576
+ def deserialize(params)
577
+ @Engine = params['Engine']
578
+ end
579
+ end
580
+
581
+ # 会话内容,按对话时间从旧到新在数组中排列,长度受模型窗口大小限制。
582
+ class OutputMessage < TencentCloud::Common::AbstractModel
583
+ # @param Role: 角色
584
+ # @type Role: String
585
+ # @param Content: 文本内容
586
+ # @type Content: String
587
+ # @param ReasoningContent: 推理内容
588
+ # @type ReasoningContent: String
589
+
590
+ attr_accessor :Role, :Content, :ReasoningContent
591
+
592
+ def initialize(role=nil, content=nil, reasoningcontent=nil)
593
+ @Role = role
594
+ @Content = content
595
+ @ReasoningContent = reasoningcontent
596
+ end
597
+
598
+ def deserialize(params)
599
+ @Role = params['Role']
600
+ @Content = params['Content']
601
+ @ReasoningContent = params['ReasoningContent']
602
+ end
603
+ end
604
+
605
+ # 文档信息
606
+ class ParseDocument < TencentCloud::Common::AbstractModel
607
+ # @param FileType: 文件类型。
608
+ # 支持的文件类型:PDF、DOC、DOCX、PPT、PPTX、MD、TXT、XLS、XLSX、CSV、PNG、JPG、JPEG、BMP、GIF、WEBP、HEIC、EPS、ICNS、IM、PCX、PPM、TIFF、XBM、HEIF、JP2
609
+ # 支持的文件大小:
610
+ # - PDF、DOC、DOCX、PPT、PPTX 支持100M
611
+ # - MD、TXT、XLS、XLSX、CSV 支持10M
612
+ # - 其他支持20M
613
+ # @type FileType: String
614
+ # @param FileUrl: 文件存储于腾讯云的 URL 可保障更高的下载速度和稳定性,使用腾讯云COS 文件地址。
615
+ # @type FileUrl: String
616
+ # @param FileContent: 文件的 base64 值,携带 MineType前缀信息。编码后的后的文件不超过 10M。
617
+ # 支持的文件大小:所下载文件经Base64编码后不超过 8M。文件下载时间不超过3秒。
618
+ # 支持的图片像素:单边介于20-10000px之间。
619
+ # @type FileContent: String
620
+
621
+ attr_accessor :FileType, :FileUrl, :FileContent
622
+
623
+ def initialize(filetype=nil, fileurl=nil, filecontent=nil)
624
+ @FileType = filetype
625
+ @FileUrl = fileurl
626
+ @FileContent = filecontent
627
+ end
628
+
629
+ def deserialize(params)
630
+ @FileType = params['FileType']
631
+ @FileUrl = params['FileUrl']
632
+ @FileContent = params['FileContent']
633
+ end
634
+ end
635
+
636
+ # ParseDocumentAsync请求参数结构体
637
+ class ParseDocumentAsyncRequest < TencentCloud::Common::AbstractModel
638
+ # @param Document: 文件信息
639
+ # @type Document: :class:`Tencentcloud::Es.v20250101.models.Document`
640
+ # @param ModelName: 模型名称
641
+ # @type ModelName: String
642
+
643
+ attr_accessor :Document, :ModelName
644
+
645
+ def initialize(document=nil, modelname=nil)
646
+ @Document = document
647
+ @ModelName = modelname
648
+ end
649
+
650
+ def deserialize(params)
651
+ unless params['Document'].nil?
652
+ @Document = Document.new
653
+ @Document.deserialize(params['Document'])
654
+ end
655
+ @ModelName = params['ModelName']
656
+ end
657
+ end
658
+
659
+ # ParseDocumentAsync返回参数结构体
660
+ class ParseDocumentAsyncResponse < TencentCloud::Common::AbstractModel
661
+ # @param TaskId: 任务 id
662
+ # @type TaskId: String
663
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
664
+ # @type RequestId: String
665
+
666
+ attr_accessor :TaskId, :RequestId
667
+
668
+ def initialize(taskid=nil, requestid=nil)
669
+ @TaskId = taskid
670
+ @RequestId = requestid
671
+ end
672
+
673
+ def deserialize(params)
674
+ @TaskId = params['TaskId']
675
+ @RequestId = params['RequestId']
676
+ end
677
+ end
678
+
679
+ # ParseDocument请求参数结构体
680
+ class ParseDocumentRequest < TencentCloud::Common::AbstractModel
681
+ # @param Document: 文件信息
682
+ # @type Document: :class:`Tencentcloud::Es.v20250101.models.ParseDocument`
683
+ # @param ModelName: 模型名称
684
+ # @type ModelName: String
685
+
686
+ attr_accessor :Document, :ModelName
687
+
688
+ def initialize(document=nil, modelname=nil)
689
+ @Document = document
690
+ @ModelName = modelname
691
+ end
692
+
693
+ def deserialize(params)
694
+ unless params['Document'].nil?
695
+ @Document = ParseDocument.new
696
+ @Document.deserialize(params['Document'])
697
+ end
698
+ @ModelName = params['ModelName']
699
+ end
700
+ end
701
+
702
+ # ParseDocument返回参数结构体
703
+ class ParseDocumentResponse < TencentCloud::Common::AbstractModel
704
+ # @param Progress: 进度
705
+ # @type Progress: String
706
+ # @param DocumentParseResultUrl: 解析文件结果
707
+ # @type DocumentParseResultUrl: String
708
+ # @param FailedPages: 失败页码
709
+ # @type FailedPages: Array
710
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
711
+ # @type RequestId: String
712
+
713
+ attr_accessor :Progress, :DocumentParseResultUrl, :FailedPages, :RequestId
714
+
715
+ def initialize(progress=nil, documentparseresulturl=nil, failedpages=nil, requestid=nil)
716
+ @Progress = progress
717
+ @DocumentParseResultUrl = documentparseresulturl
718
+ @FailedPages = failedpages
719
+ @RequestId = requestid
720
+ end
721
+
722
+ def deserialize(params)
723
+ @Progress = params['Progress']
724
+ @DocumentParseResultUrl = params['DocumentParseResultUrl']
725
+ @FailedPages = params['FailedPages']
726
+ @RequestId = params['RequestId']
727
+ end
728
+ end
729
+
730
+ # 输出结果
731
+ class RerankResult < TencentCloud::Common::AbstractModel
732
+ # @param Index: 对应的doc在输入候选doc数组中的位置索引值
733
+ # 注意:此字段可能返回 null,表示取不到有效值。
734
+ # @type Index: Integer
735
+ # @param RelevanceScore: 相似度分数
736
+ # 注意:此字段可能返回 null,表示取不到有效值。
737
+ # @type RelevanceScore: Float
738
+ # @param Document: doc原文内容
739
+ # 注意:此字段可能返回 null,表示取不到有效值。
740
+ # @type Document: String
741
+
742
+ attr_accessor :Index, :RelevanceScore, :Document
743
+
744
+ def initialize(index=nil, relevancescore=nil, document=nil)
745
+ @Index = index
746
+ @RelevanceScore = relevancescore
747
+ @Document = document
748
+ end
749
+
750
+ def deserialize(params)
751
+ @Index = params['Index']
752
+ @RelevanceScore = params['RelevanceScore']
753
+ @Document = params['Document']
754
+ end
755
+ end
756
+
757
+ # RunRerank请求参数结构体
758
+ class RunRerankRequest < TencentCloud::Common::AbstractModel
759
+ # @param ModelName: 模型名称
760
+ # @type ModelName: String
761
+ # @param Query: 查询文本
762
+ # @type Query: String
763
+ # @param Documents: 待排序的候选doc列表
764
+ # @type Documents: Array
765
+ # @param TopN: 排序返回的top文档数量, 如果没有指定则返回全部候选doc,如果指定的top_n值大于输入的候选doc数量,返回全部doc
766
+ # @type TopN: Integer
767
+ # @param ReturnDocuments: 返回的排序结果列表里面是否返回每一条document原文,默认值False
768
+ # @type ReturnDocuments: Boolean
769
+
770
+ attr_accessor :ModelName, :Query, :Documents, :TopN, :ReturnDocuments
771
+
772
+ def initialize(modelname=nil, query=nil, documents=nil, topn=nil, returndocuments=nil)
773
+ @ModelName = modelname
774
+ @Query = query
775
+ @Documents = documents
776
+ @TopN = topn
777
+ @ReturnDocuments = returndocuments
778
+ end
779
+
780
+ def deserialize(params)
781
+ @ModelName = params['ModelName']
782
+ @Query = params['Query']
783
+ @Documents = params['Documents']
784
+ @TopN = params['TopN']
785
+ @ReturnDocuments = params['ReturnDocuments']
786
+ end
787
+ end
788
+
789
+ # RunRerank返回参数结构体
790
+ class RunRerankResponse < TencentCloud::Common::AbstractModel
791
+ # @param Data: 输出结果集
792
+ # @type Data: Array
793
+ # @param Usage: 消耗token数量
794
+ # @type Usage: :class:`Tencentcloud::Es.v20250101.models.Usage`
795
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
796
+ # @type RequestId: String
797
+
798
+ attr_accessor :Data, :Usage, :RequestId
799
+
800
+ def initialize(data=nil, usage=nil, requestid=nil)
801
+ @Data = data
802
+ @Usage = usage
803
+ @RequestId = requestid
804
+ end
805
+
806
+ def deserialize(params)
807
+ unless params['Data'].nil?
808
+ @Data = []
809
+ params['Data'].each do |i|
810
+ rerankresult_tmp = RerankResult.new
811
+ rerankresult_tmp.deserialize(i)
812
+ @Data << rerankresult_tmp
813
+ end
814
+ end
815
+ unless params['Usage'].nil?
816
+ @Usage = Usage.new
817
+ @Usage.deserialize(params['Usage'])
818
+ end
819
+ @RequestId = params['RequestId']
820
+ end
821
+ end
822
+
823
+ # token使用量
824
+ class TokenUsage < TencentCloud::Common::AbstractModel
825
+ # @param PromptTokens: 表示prompt的tokens数,多次返回中保持不变
826
+ # @type PromptTokens: Integer
827
+ # @param CompletionTokens: 回答的token总数,在流式返回中,表示到目前为止所有completion的tokens总数,多次返回中持续累加
828
+ # @type CompletionTokens: Integer
829
+ # @param TotalTokens: 表示prompt_tokens和completion_tokens之和
830
+ # @type TotalTokens: Integer
831
+
832
+ attr_accessor :PromptTokens, :CompletionTokens, :TotalTokens
833
+
834
+ def initialize(prompttokens=nil, completiontokens=nil, totaltokens=nil)
835
+ @PromptTokens = prompttokens
836
+ @CompletionTokens = completiontokens
837
+ @TotalTokens = totaltokens
838
+ end
839
+
840
+ def deserialize(params)
841
+ @PromptTokens = params['PromptTokens']
842
+ @CompletionTokens = params['CompletionTokens']
843
+ @TotalTokens = params['TotalTokens']
844
+ end
845
+ end
846
+
847
+ # token消耗总数
848
+ class Usage < TencentCloud::Common::AbstractModel
849
+ # @param TotalTokens: tokens总数
850
+ # 注意:此字段可能返回 null,表示取不到有效值。
851
+ # @type TotalTokens: Integer
852
+
853
+ attr_accessor :TotalTokens
854
+
855
+ def initialize(totaltokens=nil)
856
+ @TotalTokens = totaltokens
857
+ end
858
+
859
+ def deserialize(params)
860
+ @TotalTokens = params['TotalTokens']
861
+ end
862
+ end
863
+
864
+ # 搜索结果网页信息。
865
+ class WebContent < TencentCloud::Common::AbstractModel
866
+ # @param Query: 搜素问题
867
+ # @type Query: String
868
+ # @param Title: 标题
869
+ # @type Title: String
870
+ # @param Url: 链接
871
+ # @type Url: String
872
+ # @param Time: 时间
873
+ # @type Time: String
874
+ # @param Content: 网页内容
875
+ # @type Content: String
876
+ # @param ChunkIndex: 切片索引
877
+ # @type ChunkIndex: String
878
+ # @param Score: 分数
879
+ # @type Score: String
880
+
881
+ attr_accessor :Query, :Title, :Url, :Time, :Content, :ChunkIndex, :Score
882
+
883
+ def initialize(query=nil, title=nil, url=nil, time=nil, content=nil, chunkindex=nil, score=nil)
884
+ @Query = query
885
+ @Title = title
886
+ @Url = url
887
+ @Time = time
888
+ @Content = content
889
+ @ChunkIndex = chunkindex
890
+ @Score = score
891
+ end
892
+
893
+ def deserialize(params)
894
+ @Query = params['Query']
895
+ @Title = params['Title']
896
+ @Url = params['Url']
897
+ @Time = params['Time']
898
+ @Content = params['Content']
899
+ @ChunkIndex = params['ChunkIndex']
900
+ @Score = params['Score']
901
+ end
902
+ end
903
+
904
+ end
905
+ end
906
+ end
907
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-es
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1037
4
+ version: 3.0.1038
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-09 00:00:00.000000000 Z
11
+ date: 2025-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common
@@ -35,6 +35,8 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - lib/v20180416/client.rb
37
37
  - lib/v20180416/models.rb
38
+ - lib/v20250101/client.rb
39
+ - lib/v20250101/models.rb
38
40
  - lib/tencentcloud-sdk-es.rb
39
41
  - lib/VERSION
40
42
  homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby