Class: OpenAI::Models::Completion
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Completion
- Defined in:
- lib/openai/models/completion.rb
Overview
Instance Attribute Summary collapse
-
#choices ⇒ Array<OpenAI::Models::CompletionChoice>
The list of completion choices the model generated for the input prompt.
-
#created ⇒ Integer
The Unix timestamp (in seconds) of when the completion was created.
-
#id ⇒ String
A unique identifier for the completion.
-
#model ⇒ String
The model used for completion.
-
#object ⇒ Symbol, :text_completion
The object type, which is always "text_completion".
-
#system_fingerprint ⇒ String?
This fingerprint represents the backend configuration that the model runs with.
-
#usage ⇒ OpenAI::Models::CompletionUsage?
Usage statistics for the completion request.
Instance Method Summary collapse
-
#initialize(id: , choices: , created: , model: , system_fingerprint: nil, usage: nil, object: :text_completion) ⇒ void
constructor
Some parameter documentations has been truncated, see Completion for more details.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(id: , choices: , created: , model: , system_fingerprint: nil, usage: nil, object: :text_completion) ⇒ void
Some parameter documentations has been truncated, see OpenAI::Models::Completion for more details.
Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).
|
|
# File 'lib/openai/models/completion.rb', line 54
|
Instance Attribute Details
#choices ⇒ Array<OpenAI::Models::CompletionChoice>
The list of completion choices the model generated for the input prompt.
19 |
# File 'lib/openai/models/completion.rb', line 19 required :choices, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::CompletionChoice] } |
#created ⇒ Integer
The Unix timestamp (in seconds) of when the completion was created.
25 |
# File 'lib/openai/models/completion.rb', line 25 required :created, Integer |
#id ⇒ String
A unique identifier for the completion.
13 |
# File 'lib/openai/models/completion.rb', line 13 required :id, String |
#model ⇒ String
The model used for completion.
31 |
# File 'lib/openai/models/completion.rb', line 31 required :model, String |
#object ⇒ Symbol, :text_completion
The object type, which is always "text_completion"
37 |
# File 'lib/openai/models/completion.rb', line 37 required :object, const: :text_completion |
#system_fingerprint ⇒ String?
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.
46 |
# File 'lib/openai/models/completion.rb', line 46 optional :system_fingerprint, String |
#usage ⇒ OpenAI::Models::CompletionUsage?
Usage statistics for the completion request.
52 |
# File 'lib/openai/models/completion.rb', line 52 optional :usage, -> { OpenAI::CompletionUsage } |