Class: Durable::Llm::Providers::Groq::GroqResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Groq::GroqResponse
- Defined in:
- lib/durable/llm/providers/groq.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
-
#initialize(response) ⇒ GroqResponse
constructor
A new instance of GroqResponse.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ GroqResponse
Returns a new instance of GroqResponse.
88 89 90 |
# File 'lib/durable/llm/providers/groq.rb', line 88 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
86 87 88 |
# File 'lib/durable/llm/providers/groq.rb', line 86 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
92 93 94 |
# File 'lib/durable/llm/providers/groq.rb', line 92 def choices @raw_response['choices'].map { |choice| GroqChoice.new(choice) } end |
#to_h ⇒ Object
100 101 102 |
# File 'lib/durable/llm/providers/groq.rb', line 100 def to_h @raw_response.dup end |
#to_s ⇒ Object
96 97 98 |
# File 'lib/durable/llm/providers/groq.rb', line 96 def to_s choices.map(&:to_s).join(' ') end |