Skip to content

Commit

Permalink
Fix missing block in chat API
Browse files Browse the repository at this point in the history
  • Loading branch information
ksylvest committed Jul 18, 2024
1 parent 641e2a3 commit ac16ce7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
omniai (1.6.0)
omniai (1.6.1)
event_stream_parser
http
zeitwerk
Expand Down
6 changes: 5 additions & 1 deletion lib/omniai/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def self.process!(...)
# @param stream [Proc, IO, nil] optional
# @param tools [Array<OmniAI::Tool>] optional
# @param format [Symbol, nil] optional - :json
# @yield [prompt] optional
#
# @yield [prompt]
# @yieldparam prompt [OmniAI::Chat::Prompt]
#
# @return [OmniAi::Chat]
def initialize(prompt = nil, client:, model:, temperature: nil, stream: nil, tools: nil, format: nil, &block)
raise ArgumentError, 'prompt or block is required' if !prompt && !block

Expand Down
4 changes: 3 additions & 1 deletion lib/omniai/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def connection
# @param stream [Proc, nil] optional
# @param tools [Array<OmniAI::Tool>] optional
#
# @yield [prompt] optional
#
# @return [OmniAI::Chat::Completion]
def chat(messages, model:, temperature: nil, format: nil, stream: nil, tools: nil)
def chat(messages, model:, temperature: nil, format: nil, stream: nil, tools: nil, &)
raise NotImplementedError, "#{self.class.name}#chat undefined"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/omniai/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OmniAI
VERSION = '1.6.0'
VERSION = '1.6.1'
end

0 comments on commit ac16ce7

Please sign in to comment.