Class: Durable::Llm::Providers::Huggingface::HuggingfaceChoice

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/huggingface.rb

Overview

Individual choice from Hugging Face completion response.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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_sObject



149
150
151
# File 'lib/durable/llm/providers/huggingface.rb', line 149

def to_s
  @text
end