Class: Async::Ollama::Client

Inherits:
REST::Resource
  • Object
show all
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, **options, &block)
	options[:prompt] = prompt
	options[:model] ||= 'llama2'
	
	Generate.post(self.with(path: '/api/generate'), options, &block)
end