Class: LastLLM::Completion
- Inherits:
-
Object
- Object
- LastLLM::Completion
- Defined in:
- lib/last_llm/completion.rb
Overview
Represents a completion response from an LLM provider Contains the generated text and any additional metadata
Instance Method Summary collapse
-
#generate(prompt, options = {}) ⇒ String
Generate text completion in a single response.
-
#initialize(client) ⇒ Completion
constructor
A new instance of Completion.
Constructor Details
#initialize(client) ⇒ Completion
Returns a new instance of Completion.
7 8 9 |
# File 'lib/last_llm/completion.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#generate(prompt, options = {}) ⇒ String
Generate text completion in a single response
15 16 17 |
# File 'lib/last_llm/completion.rb', line 15 def generate(prompt, = {}) @client.provider.generate_text(prompt, ) end |