Class: TencentCloud::Es::V20250101::Client
- Inherits:
-
Common::AbstractClient
- Object
- Common::AbstractClient
- TencentCloud::Es::V20250101::Client
- Defined in:
- lib/v20250101/client.rb
Instance Method Summary collapse
-
#ChatCompletions(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChatCompletionsResponse`.
-
#ChunkDocument(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChunkDocumentResponse`.
-
#ChunkDocumentAsync(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChunkDocumentAsyncResponse`.
-
#GetDocumentChunkResult(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetDocumentChunkResultResponse`.
-
#GetDocumentParseResult(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetDocumentParseResultResponse`.
-
#GetMultiModalEmbedding(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetMultiModalEmbeddingResponse`.
-
#GetTextEmbedding(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetTextEmbeddingResponse`.
-
#initialize(credential, region, profile = nil) ⇒ Client
constructor
A new instance of Client.
-
#ParseDocument(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ParseDocumentResponse`.
-
#ParseDocumentAsync(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ParseDocumentAsyncResponse`.
-
#RunRerank(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::RunRerankResponse`.
Constructor Details
#initialize(credential, region, profile = nil) ⇒ Client
Returns a new instance of Client.
24 25 26 27 28 29 |
# File 'lib/v20250101/client.rb', line 24 def initialize(credential, region, profile = nil) api_version = '2025-01-01' api_endpoint = 'es.tencentcloudapi.com' sdk_version = 'ES_' + File.read(File.('../VERSION', __dir__)).strip super(credential, region, api_version, api_endpoint, sdk_version, profile) end |
Instance Method Details
#ChatCompletions(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChatCompletionsResponse`
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/v20250101/client.rb', line 38 def ChatCompletions(request) body = send_request('ChatCompletions', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ChatCompletionsResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#ChunkDocument(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChunkDocumentResponse`
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/v20250101/client.rb', line 63 def ChunkDocument(request) body = send_request('ChunkDocument', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ChunkDocumentResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#ChunkDocumentAsync(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ChunkDocumentAsyncResponse`
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/v20250101/client.rb', line 88 def ChunkDocumentAsync(request) body = send_request('ChunkDocumentAsync', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ChunkDocumentAsyncResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#GetDocumentChunkResult(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetDocumentChunkResultResponse`
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/v20250101/client.rb', line 112 def GetDocumentChunkResult(request) body = send_request('GetDocumentChunkResult', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = GetDocumentChunkResultResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#GetDocumentParseResult(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetDocumentParseResultResponse`
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/v20250101/client.rb', line 136 def GetDocumentParseResult(request) body = send_request('GetDocumentParseResult', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = GetDocumentParseResultResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#GetMultiModalEmbedding(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetMultiModalEmbeddingResponse`
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/v20250101/client.rb', line 160 def GetMultiModalEmbedding(request) body = send_request('GetMultiModalEmbedding', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = GetMultiModalEmbeddingResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#GetTextEmbedding(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::GetTextEmbeddingResponse`
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/v20250101/client.rb', line 185 def GetTextEmbedding(request) body = send_request('GetTextEmbedding', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = GetTextEmbeddingResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#ParseDocument(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ParseDocumentResponse`
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/v20250101/client.rb', line 210 def ParseDocument(request) body = send_request('ParseDocument', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ParseDocumentResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#ParseDocumentAsync(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::ParseDocumentAsyncResponse`
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/v20250101/client.rb', line 235 def ParseDocumentAsync(request) body = send_request('ParseDocumentAsync', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = ParseDocumentAsyncResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |
#RunRerank(request) ⇒ Object
@rtype: :class:‘Tencentcloud::es::V20250101::RunRerankResponse`
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/v20250101/client.rb', line 260 def RunRerank(request) body = send_request('RunRerank', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = RunRerankResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, , reqid) end rescue TencentCloud::Common::TencentCloudSDKException => e raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end |