Class: MistralModels::CompletionResponse
- Inherits:
-
Object
- Object
- MistralModels::CompletionResponse
- Defined in:
- lib/mistral_rb/response_models.rb
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ CompletionResponse
constructor
A new instance of CompletionResponse.
Constructor Details
#initialize(response_hash) ⇒ CompletionResponse
Returns a new instance of CompletionResponse.
5 6 7 8 9 10 11 12 |
# File 'lib/mistral_rb/response_models.rb', line 5 def initialize(response_hash) @id = response_hash["id"] @object = response_hash["object"] @created = response_hash["created"] @model = response_hash["model"] @choices = response_hash["choices"].map { |choice| Choice.new(choice) } @usage = response_hash["usage"] end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def choices @choices end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def created @created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def id @id end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def model @model end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def object @object end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
3 4 5 |
# File 'lib/mistral_rb/response_models.rb', line 3 def usage @usage end |