omniai 1.6.1 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc0ef904482119dedd44057ac782fdf5c0c43a72f4a212c9a10736ba6389bd9d
4
- data.tar.gz: 9d8c20309d3652207719f0d95253df5d4bb422658f42d724aa509bec0595721b
3
+ metadata.gz: fe2124a214845732f67f1944d0d9538927a7fe034948f67485fb923d232ce3e7
4
+ data.tar.gz: 41849074c457cde063e0a14866c43370046b9a33c3e9354655ea5167201f5781
5
5
  SHA512:
6
- metadata.gz: 00462515ed1392ccc2a94dcdc1bc61e18ce316306dbbaf77523938a47e49e33d7f6e17d37ecc921edc82b04f8f7a8de7a122fdd0eeb787cabf95cf8c42092309
7
- data.tar.gz: 894271b6a222be666bad5a2502ab4b040ab4e8c7f31c6c3e3dd3226b296a8198a0f3030e31c75de0fea30db8d0b5e27c0601b13d99127ab0121dbbef5b128943
6
+ metadata.gz: c11a71d77fd58667c3fb618284e0b5706c0e12d28ae6f09119123cc3d90f5410338a1fda3448c6b213d38af140d46a4baa3e509d55eaed6c6d338a6680715662
7
+ data.tar.gz: 56b16d80a3ec823d2d4a43e93553d904849a65e24e8aefebbf69b0cce5a2d8ba0427e7a039c4373c4e59875994f290559a013bef1ae634f6c706d8b5af26a0dd
data/lib/omniai/client.rb CHANGED
@@ -124,7 +124,7 @@ module OmniAI
124
124
 
125
125
  # @raise [OmniAI::Error]
126
126
  #
127
- # @param messages [String, Array, Hash]
127
+ # @param messages [String] optional
128
128
  # @param model [String] optional
129
129
  # @param format [Symbol] optional :text or :json
130
130
  # @param temperature [Float, nil] optional
@@ -135,7 +135,7 @@ module OmniAI
135
135
  # @yieldparam prompt [OmniAI::Chat::Prompt]
136
136
  #
137
137
  # @return [OmniAI::Chat::Completion]
138
- def chat(messages, model:, temperature: nil, format: nil, stream: nil, tools: nil, &)
138
+ def chat(messages = nil, model:, temperature: nil, format: nil, stream: nil, tools: nil, &)
139
139
  raise NotImplementedError, "#{self.class.name}#chat undefined"
140
140
  end
141
141
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = '1.6.1'
4
+ VERSION = '1.6.3'
5
5
  end
data/lib/omniai.rb CHANGED
@@ -17,12 +17,18 @@ module OmniAI
17
17
 
18
18
  # An error that wraps an HTTP::Response for non-OK requests.
19
19
  class HTTPError < Error
20
+ # @return [HTTP::Response]
20
21
  attr_accessor :response
21
22
 
22
23
  # @param response [HTTP::Response]
23
24
  def initialize(response)
24
- super("status=#{response.status.inspect} headers=#{response.headers.inspect} body=#{response.body}")
25
+ super("status=#{response.status} body=#{response.body}")
26
+
25
27
  @response = response
26
28
  end
29
+
30
+ def inspect
31
+ "#<#{self.class} status=#{@response.status} body=#{@response.body}>"
32
+ end
27
33
  end
28
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-18 00:00:00.000000000 Z
11
+ date: 2024-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser