Class: Durable::Llm::Providers::Huggingface::HuggingfaceStreamToken
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Huggingface::HuggingfaceStreamToken
- Defined in:
- lib/durable/llm/providers/huggingface.rb
Overview
Individual token from Hugging Face streaming response.
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(token) ⇒ HuggingfaceStreamToken
constructor
A new instance of HuggingfaceStreamToken.
- #to_s ⇒ Object
Constructor Details
#initialize(token) ⇒ HuggingfaceStreamToken
Returns a new instance of HuggingfaceStreamToken.
184 185 186 |
# File 'lib/durable/llm/providers/huggingface.rb', line 184 def initialize(token) @text = token['token']['text'] end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
182 183 184 |
# File 'lib/durable/llm/providers/huggingface.rb', line 182 def text @text end |
Instance Method Details
#to_s ⇒ Object
188 189 190 |
# File 'lib/durable/llm/providers/huggingface.rb', line 188 def to_s @text || '' end |