View Source ExOpenAI.Components.CreateChatCompletionResponse (ex_openai.ex v2.0.0-beta2)
Represents a chat completion response returned by model, based on the provided input.
Fields
:choices- required -[{:%{}, [], [{{:required, [], [:finish_reason]}, {:|, [], [{:|, [], [{:|, [], [{:|, [], [:stop, :length]}, :tool_calls]}, :content_filter]}, :function_call]}}, {{:required, [], [:index]}, {:integer, [], []}}, {{:required, [], [:logprobs]}, {:|, [], [{:%{}, [], [{{:required, [], [:content]}, {:|, [], [{:list, [], [{{:., [], [ExOpenAI.Components.ChatCompletionTokenLogprob, :t]}, [], []}]}, {:any, [], []}]}}, {{:required, [], [:refusal]}, {:|, [], [{:list, [], [{{:., [], [ExOpenAI.Components.ChatCompletionTokenLogprob, :t]}, [], []}]}, {:any, [], []}]}}]}, {:any, [], []}]}}, {{:required, [], [:message]}, {{:., [], [ExOpenAI.Components.ChatCompletionResponseMessage, :t]}, [], []}}]}]
A list of chat completion choices. Can be more than one ifnis greater than 1.:created- required -integer()
The Unix timestamp (in seconds) of when the chat completion was created.:id- required -String.t()
A unique identifier for the chat completion.:model- required -String.t()
The model used for the chat completion.:object- required -:"chat.completion"
The object type, which is alwayschat.completion.
Allowed values:"chat.completion":service_tier- optional -ExOpenAI.Components.ServiceTier.t():system_fingerprint- optional -String.t()
This fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
:usage- optional -ExOpenAI.Components.CompletionUsage.t()
Summary
Types
@type t() :: %ExOpenAI.Components.CreateChatCompletionResponse{ choices: [ %{ finish_reason: (((:stop | :length) | :tool_calls) | :content_filter) | :function_call, index: integer(), logprobs: %{ content: [ExOpenAI.Components.ChatCompletionTokenLogprob.t()] | any(), refusal: [ExOpenAI.Components.ChatCompletionTokenLogprob.t()] | any() } | any(), message: ExOpenAI.Components.ChatCompletionResponseMessage.t() } ], created: integer(), id: String.t(), model: String.t(), object: :"chat.completion", service_tier: ExOpenAI.Components.ServiceTier.t() | nil, system_fingerprint: String.t() | nil, usage: ExOpenAI.Components.CompletionUsage.t() | nil }