class

OpenAI::CreateCompletionResponse

Inherits JSON::Serializable < Reference < Object

Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).

Constructors

new(id : String = "", choices : Array(CreateCompletionResponseChoicesItem) = [] of CreateCompletionResponseChoicesItem, created : Int64 = 0, model : String = "", system_fingerprint : String | Nil = nil, object : CreateCompletionResponseObject = CreateCompletionResponseObject::TextCompletion, usage : CompletionUsage | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

choices

The list of completion choices the model generated for the input prompt.

Source
choices=(choices : Array(CreateCompletionResponseChoicesItem))

The list of completion choices the model generated for the input prompt.

Source
created

The Unix timestamp (in seconds) of when the completion was created.

Source
created=(created : Int64)

The Unix timestamp (in seconds) of when the completion was created.

Source
id

A unique identifier for the completion.

Source
id=(id : String)

A unique identifier for the completion.

Source
model

The model used for completion.

Source
model=(model : String)

The model used for completion.

Source
object

The object type, which is always "text_completion"

Source
object=(object : CreateCompletionResponseObject)

The object type, which is always "text_completion"

Source
system_fingerprint

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.

Source
system_fingerprint=(system_fingerprint : String | Nil)

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.

Source
usage
Source
usage=(usage : CompletionUsage | Nil)
Source