View Source ExOpenAI.Components.CreateCompletionResponse (ex_openai.ex v2.0.0-beta2)
Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).
Fields
:choices- required -[{:%{}, [], [{{:required, [], [:finish_reason]}, {:|, [], [{:|, [], [:stop, :length]}, :content_filter]}}, {{:required, [], [:index]}, {:integer, [], []}}, {{:required, [], [:logprobs]}, {:|, [], [{:%{}, [], [{{:optional, [], [:text_offset]}, {:list, [], [{:integer, [], []}]}}, {{:optional, [], [:token_logprobs]}, {:list, [], [{:number, [], []}]}}, {{:optional, [], [:tokens]}, {:list, [], [{{:., [], [{:__aliases__, [alias: false], [:String]}, :t]}, [], []}]}}, {{:optional, [], [:top_logprobs]}, {:list, [], [{:map, [], []}]}}]}, {:any, [], []}]}}, {{:required, [], [:text]}, {{:., [], [{:__aliases__, [alias: false], [:String]}, :t]}, [], []}}]}]
The list of completion choices the model generated for the input prompt.:created- required -integer()
The Unix timestamp (in seconds) of when the completion was created.:id- required -String.t()
A unique identifier for the completion.:model- required -String.t()
The model used for completion.:object- required -:text_completion
The object type, which is always "text_completion"
Allowed values:"text_completion":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.CreateCompletionResponse{ choices: [ %{ finish_reason: (:stop | :length) | :content_filter, index: integer(), logprobs: %{ optional(:text_offset) => [integer()], optional(:token_logprobs) => [number()], optional(:tokens) => [String.t()], optional(:top_logprobs) => [map()] } | any(), text: String.t() } ], created: integer(), id: String.t(), model: String.t(), object: :text_completion, system_fingerprint: String.t() | nil, usage: ExOpenAI.Components.CompletionUsage.t() | nil }