Skip to content

Commit

Permalink
Add DEFAULT_MODEL constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Nov 26, 2024
1 parent 59ebaf3 commit e4dbb96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/async/ollama/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Client < Async::REST::Resource
# @parameter prompt [String] The prompt to generate a response from.
def generate(prompt, **options, &block)
options[:prompt] = prompt
options[:model] ||= "llama3"
options[:model] ||= DEFAULT_MODEL

Generate.post(self.with(path: "/api/generate"), options) do |resource, response|
if block_given?
Expand Down
2 changes: 1 addition & 1 deletion lib/async/ollama/conversation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module Async
module Ollama
class Conversation
def initialize(client, model: "llama3", context: nil)
def initialize(client, model: DEFAULT_MODEL, context: nil)
@client = client

@toolbox = Toolbox.new
Expand Down
2 changes: 2 additions & 0 deletions lib/async/ollama/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

module Async
module Ollama
DEFAULT_MODEL = "llama3"

class Generate < Async::REST::Representation[Wrapper]
# The response to the prompt.
def response
Expand Down

0 comments on commit e4dbb96

Please sign in to comment.