Class: MistralModels::StreamedCompletionResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#choicesObject (readonly)

Returns the value of attribute choices.



77
78
79
# File 'lib/mistral_rb/response_models.rb', line 77

def choices
  @choices
end

#createdObject (readonly)

Returns the value of attribute created.



77
78
79
# File 'lib/mistral_rb/response_models.rb', line 77

def created
  @created
end

#idObject (readonly)

Returns the value of attribute id.



77
78
79
# File 'lib/mistral_rb/response_models.rb', line 77

def id
  @id
end

#modelObject (readonly)

Returns the value of attribute model.



77
78
79
# File 'lib/mistral_rb/response_models.rb', line 77

def model
  @model
end

#objectObject (readonly)

Returns the value of attribute object.



77
78
79
# File 'lib/mistral_rb/response_models.rb', line 77

def object
  @object
end