Class: Async::Ollama::Generate
- Inherits:
-
Object
- Object
- Async::Ollama::Generate
- Defined in:
- lib/async/ollama/generate.rb
Instance Method Summary collapse
-
#context ⇒ Object
The conversation context.
-
#generate(prompt, &block) ⇒ Object
Generate a new response from the given prompt.
-
#model ⇒ Object
The model used to generate the response.
-
#response ⇒ Object
The response to the prompt.
Instance Method Details
#context ⇒ Object
The conversation context. Used to maintain state between prompts.
18 19 20 |
# File 'lib/async/ollama/generate.rb', line 18 def context self.value[:context] end |
#generate(prompt, &block) ⇒ Object
Generate a new response from the given prompt.
30 31 32 |
# File 'lib/async/ollama/generate.rb', line 30 def generate(prompt, &block) self.class.post(self.resource, prompt: prompt, context: self.context, model: self.model, &block) end |
#model ⇒ Object
The model used to generate the response.
23 24 25 |
# File 'lib/async/ollama/generate.rb', line 23 def model self.value[:model] end |
#response ⇒ Object
The response to the prompt.
13 14 15 |
# File 'lib/async/ollama/generate.rb', line 13 def response self.value[:response] end |