Class: MistralModels::StreamedChoice

Inherits:
Object
  • Object
show all
Defined in:
lib/mistral_rb/response_models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice_hash) ⇒ StreamedChoice

Returns a new instance of StreamedChoice.



91
92
93
94
95
# File 'lib/mistral_rb/response_models.rb', line 91

def initialize(choice_hash)
  @index = choice_hash["index"]
  @delta = Delta.new(choice_hash["delta"]) if choice_hash["delta"]
  @finish_reason = choice_hash["finish_reason"]
end

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



89
90
91
# File 'lib/mistral_rb/response_models.rb', line 89

def delta
  @delta
end

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



89
90
91
# File 'lib/mistral_rb/response_models.rb', line 89

def finish_reason
  @finish_reason
end

#indexObject (readonly)

Returns the value of attribute index.



89
90
91
# File 'lib/mistral_rb/response_models.rb', line 89

def index
  @index
end