Async::OllamaSourceAsyncOllamaGenerate

class Generate

Definitions

def response

The response to the prompt.

Implementation

def response
	self.value[:response]
end

def context

The conversation context. Used to maintain state between prompts.

Implementation

def context
	self.value[:context]
end

def model

The model used to generate the response.

Implementation

def model
	self.value[:model]
end

def generate(prompt, &block)

Generate a new response from the given prompt.

Signature

parameter prompt String

The prompt to generate a response from.

yields {|response| ...}

Optional streaming response.

Implementation

def generate(prompt, &block)
	self.class.post(self.resource, prompt: prompt, context: self.context, model: self.model, &block)
end