Class: TencentCloud::Es::V20250101::ChatCompletionsResponse

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20250101/models.rb

Overview

ChatCompletions返回参数结构体

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, choices = nil, usage = nil, onlinesearchcontent = nil, requestid = nil) ⇒ ChatCompletionsResponse

Returns a new instance of ChatCompletionsResponse.



108
109
110
111
112
113
114
# File 'lib/v20250101/models.rb', line 108

def initialize(id=nil, choices=nil, usage=nil, onlinesearchcontent=nil, requestid=nil)
  @Id = id
  @Choices = choices
  @Usage = usage
  @OnlineSearchContent = onlinesearchcontent
  @RequestId = requestid
end

Instance Attribute Details

#ChoicesObject

注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Id:

    此次请求的id

  • Choices:

    回复内容

  • Usage:

    token使用量

  • OnlineSearchContent:

    联网搜索结果。

  • RequestId:

    唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header “X-TC-RequestId” 中。



106
107
108
# File 'lib/v20250101/models.rb', line 106

def Choices
  @Choices
end

#IdObject

注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Id:

    此次请求的id

  • Choices:

    回复内容

  • Usage:

    token使用量

  • OnlineSearchContent:

    联网搜索结果。

  • RequestId:

    唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header “X-TC-RequestId” 中。



106
107
108
# File 'lib/v20250101/models.rb', line 106

def Id
  @Id
end

#OnlineSearchContentObject

注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Id:

    此次请求的id

  • Choices:

    回复内容

  • Usage:

    token使用量

  • OnlineSearchContent:

    联网搜索结果。

  • RequestId:

    唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header “X-TC-RequestId” 中。



106
107
108
# File 'lib/v20250101/models.rb', line 106

def OnlineSearchContent
  @OnlineSearchContent
end

#RequestIdObject

注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Id:

    此次请求的id

  • Choices:

    回复内容

  • Usage:

    token使用量

  • OnlineSearchContent:

    联网搜索结果。

  • RequestId:

    唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header “X-TC-RequestId” 中。



106
107
108
# File 'lib/v20250101/models.rb', line 106

def RequestId
  @RequestId
end

#UsageObject

注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Id:

    此次请求的id

  • Choices:

    回复内容

  • Usage:

    token使用量

  • OnlineSearchContent:

    联网搜索结果。

  • RequestId:

    唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header “X-TC-RequestId” 中。



106
107
108
# File 'lib/v20250101/models.rb', line 106

def Usage
  @Usage
end

Instance Method Details

#deserialize(params) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/v20250101/models.rb', line 116

def deserialize(params)
  @Id = params['Id']
  unless params['Choices'].nil?
    @Choices = []
    params['Choices'].each do |i|
      choice_tmp = Choice.new
      choice_tmp.deserialize(i)
      @Choices << choice_tmp
    end
  end
  unless params['Usage'].nil?
    @Usage = TokenUsage.new
    @Usage.deserialize(params['Usage'])
  end
  unless params['OnlineSearchContent'].nil?
    @OnlineSearchContent = []
    params['OnlineSearchContent'].each do |i|
      webcontent_tmp = WebContent.new
      webcontent_tmp.deserialize(i)
      @OnlineSearchContent << webcontent_tmp
    end
  end
  @RequestId = params['RequestId']
end