Class: Async::Ollama::Client
- Inherits:
-
REST::Resource
- Object
- REST::Resource
- Async::Ollama::Client
- Defined in:
- lib/async/ollama/client.rb
Overview
Represents a connection to the Ollama service.
Constant Summary collapse
- ENDPOINT =
Async::HTTP::Endpoint.parse('http://localhost:11434')
Instance Method Summary collapse
Instance Method Details
#generate(prompt, **options, &block) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/async/ollama/client.rb', line 15 def generate(prompt, **, &block) [:prompt] = prompt [:model] ||= 'llama2' Generate.post(self.with(path: '/api/generate'), , &block) end |