Class: Durable::Llm::Providers::Huggingface::HuggingfaceResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Huggingface::HuggingfaceResponse
- Defined in:
- lib/durable/llm/providers/huggingface.rb
Overview
Response wrapper for Hugging Face completion API responses.
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
-
#initialize(response) ⇒ HuggingfaceResponse
constructor
A new instance of HuggingfaceResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ HuggingfaceResponse
128 129 130 |
# File 'lib/durable/llm/providers/huggingface.rb', line 128 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
126 127 128 |
# File 'lib/durable/llm/providers/huggingface.rb', line 126 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
132 133 134 |
# File 'lib/durable/llm/providers/huggingface.rb', line 132 def choices [HuggingfaceChoice.new(@raw_response)] end |
#to_s ⇒ Object
136 137 138 |
# File 'lib/durable/llm/providers/huggingface.rb', line 136 def to_s choices.map(&:to_s).join(' ') end |