Class: Durable::Llm::Providers::Huggingface::HuggingfaceChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Huggingface::HuggingfaceChoice
- Defined in:
- lib/durable/llm/providers/huggingface.rb
Overview
Individual choice from Hugging Face completion response.
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(choice) ⇒ HuggingfaceChoice
constructor
A new instance of HuggingfaceChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ HuggingfaceChoice
Returns a new instance of HuggingfaceChoice.
145 146 147 |
# File 'lib/durable/llm/providers/huggingface.rb', line 145 def initialize(choice) @text = choice['generated_text'] end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
143 144 145 |
# File 'lib/durable/llm/providers/huggingface.rb', line 143 def text @text end |
Instance Method Details
#to_s ⇒ Object
149 150 151 |
# File 'lib/durable/llm/providers/huggingface.rb', line 149 def to_s @text end |