Skip to content

Commit e4dbb96

Browse files
committed
Add DEFAULT_MODEL constant.
1 parent 59ebaf3 commit e4dbb96

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/async/ollama/client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Client < Async::REST::Resource
1919
# @parameter prompt [String] The prompt to generate a response from.
2020
def generate(prompt, **options, &block)
2121
options[:prompt] = prompt
22-
options[:model] ||= "llama3"
22+
options[:model] ||= DEFAULT_MODEL
2323

2424
Generate.post(self.with(path: "/api/generate"), options) do |resource, response|
2525
if block_given?

lib/async/ollama/conversation.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
module Async
1010
module Ollama
1111
class Conversation
12-
def initialize(client, model: "llama3", context: nil)
12+
def initialize(client, model: DEFAULT_MODEL, context: nil)
1313
@client = client
1414

1515
@toolbox = Toolbox.new

lib/async/ollama/generate.rb

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
module Async
1010
module Ollama
11+
DEFAULT_MODEL = "llama3"
12+
1113
class Generate < Async::REST::Representation[Wrapper]
1214
# The response to the prompt.
1315
def response

0 commit comments

Comments
 (0)