omniai 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e94a411496cb1e8f10e775a2a6487de99def946de6a4cc1e6c1c873ce160760
4
- data.tar.gz: 5ec7d8ba1b1bbaf67fd3fe633af99b2e4c3d95edc0114313446b8a666bb1f0d6
3
+ metadata.gz: df4f1096ec0d74c8ab26e5cfc8db4902009d1bb398ed9913e801b31203d1ae66
4
+ data.tar.gz: 9cff5f3ecdc6a540bbbd3ca6501dbd07585a1f9dfe8127a09ee6421a51f79c2f
5
5
  SHA512:
6
- metadata.gz: 4265b9413acdf6bfe5dde9c4081c9e83b212c7ac51b5a77f3bc4c1dd0d2d6c030f48f3830e431ee2556a1bc58cbef980c98757f714c97192fb88a948743ce1e5
7
- data.tar.gz: 2d8ba0d77348b88ccdc064014528ae56c9be5fc14e716ed961c74f8d462b4dac822eacb1f493b28aa65a4178391a19c3f98e1974ca93393153cf9a8e87c09703
6
+ metadata.gz: db82f7cf3e8b43f55080c1ae1af2f6f9767dec7870bf23e2424eee8a272671b565f279829d9768fbb447eec8821fcd7da22058da8a4016b4de271a389a115c1c
7
+ data.tar.gz: 84362d233dbafa2dd6403b3d65056c7b836eb0b2ce420f4395c86188887f12ba7cb59caead7cfbc44d80bfa03ad2ef342b62f8235ace58afd0284e8e25b5c243
data/lib/omniai/chat.rb CHANGED
@@ -89,7 +89,7 @@ module OmniAI
89
89
 
90
90
  # @param response [OmniAI::Chat::Completion]
91
91
  def complete!(response:)
92
- Completion.new(data: response.parse)
92
+ self.class::Completion.new(data: response.parse)
93
93
  end
94
94
 
95
95
  # @param response [HTTP::Response]
@@ -97,7 +97,7 @@ module OmniAI
97
97
  def stream!(response:)
98
98
  raise Error, "#{self.class.name}#stream! unstreamable" unless @stream
99
99
 
100
- Stream.new(response:).stream! do |chunk|
100
+ self.class::Stream.new(response:).stream! do |chunk|
101
101
  case @stream
102
102
  when IO
103
103
  @stream << chunk.choice.delta.content
@@ -113,7 +113,7 @@ module OmniAI
113
113
  def messages
114
114
  arrayify(@messages).map do |content|
115
115
  case content
116
- when String then { role: OmniAI::Chat::Role::USER, content: }
116
+ when String then { role: Role::USER, content: }
117
117
  when Hash then content
118
118
  else raise Error, "Unsupported content=#{content.inspect}"
119
119
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = '1.4.1'
4
+ VERSION = '1.4.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre