Class: MistralModels::StreamedCompletionResponse
- Inherits:
-
Object
- Object
- MistralModels::StreamedCompletionResponse
- 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.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ StreamedCompletionResponse
constructor
A new instance of StreamedCompletionResponse.
Constructor Details
#initialize(response_hash) ⇒ StreamedCompletionResponse
Returns a new instance of StreamedCompletionResponse.
79 80 81 82 83 84 85 |
# File 'lib/mistral_rb/response_models.rb', line 79 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| StreamedChoice.new(choice) } end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
77 78 79 |
# File 'lib/mistral_rb/response_models.rb', line 77 def choices @choices end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
77 78 79 |
# File 'lib/mistral_rb/response_models.rb', line 77 def created @created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
77 78 79 |
# File 'lib/mistral_rb/response_models.rb', line 77 def id @id end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
77 78 79 |
# File 'lib/mistral_rb/response_models.rb', line 77 def model @model end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
77 78 79 |
# File 'lib/mistral_rb/response_models.rb', line 77 def object @object end |