lib/v20240522/client.rb in tencentcloud-sdk-lkeap-3.0.976 vs lib/v20240522/client.rb in tencentcloud-sdk-lkeap-3.0.977

- old
+ new

@@ -487,9 +487,34 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 多轮改写(QueryRewrite)主要用于多轮对话中,进行指代消解和省略补全。使用本接口,无需输入prompt描述,根据对话历史即可生成更精确的用户查询。在应用场景上,本接口可应用于智能问答、对话式搜索等多种场景。 + # 开通[产品体验](https://lke.cloud.tencent.com/lke/#/trialProduct)后可获得50wtoken体验额度。本接口(QueryRewrite)有单账号调用上限控制,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。 + + # @param request: Request instance for QueryRewrite. + # @type request: :class:`Tencentcloud::lkeap::V20240522::QueryRewriteRequest` + # @rtype: :class:`Tencentcloud::lkeap::V20240522::QueryRewriteResponse` + def QueryRewrite(request) + body = send_request('QueryRewrite', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = QueryRewriteResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 准实时文档解析接口,使用HTTP SSE 协议通信。 # @param request: Request instance for ReconstructDocumentSSE. # @type request: :class:`Tencentcloud::lkeap::V20240522::ReconstructDocumentSSERequest` # @rtype: :class:`Tencentcloud::lkeap::V20240522::ReconstructDocumentSSEResponse` \ No newline at end of file