omniai 1.4.0 → 1.4.1

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: 8b3d66712c9a2fd460abf00c29b056b87ff8cdd08c8b38d69ece0755d8c76578
4
- data.tar.gz: f0fdf7b20e3f3cc3c4e2bee6d21b68bd917d9267c9f1297dec91f2f8bccc71e9
3
+ metadata.gz: 2e94a411496cb1e8f10e775a2a6487de99def946de6a4cc1e6c1c873ce160760
4
+ data.tar.gz: 5ec7d8ba1b1bbaf67fd3fe633af99b2e4c3d95edc0114313446b8a666bb1f0d6
5
5
  SHA512:
6
- metadata.gz: 98c6c3380181aaf7ad858968b998adab49f8cd200d94755ff6cf79423378dd401c4c538147aeb416b023c47fe7f1806a8742a9486429e90bcc487eb8944cba52
7
- data.tar.gz: f251bb7436e9536275a285508f63964693a067378f55a72b3cf01fb9cb801f55ef96fd8a64c9b4e5790c6c400ee6adcee64f6dc5dc413e92b42d5f869afce45f
6
+ metadata.gz: 4265b9413acdf6bfe5dde9c4081c9e83b212c7ac51b5a77f3bc4c1dd0d2d6c030f48f3830e431ee2556a1bc58cbef980c98757f714c97192fb88a948743ce1e5
7
+ data.tar.gz: 2d8ba0d77348b88ccdc064014528ae56c9be5fc14e716ed961c74f8d462b4dac822eacb1f493b28aa65a4178391a19c3f98e1974ca93393153cf9a8e87c09703
data/lib/omniai/chat.rb CHANGED
@@ -99,12 +99,14 @@ module OmniAI
99
99
 
100
100
  Stream.new(response:).stream! do |chunk|
101
101
  case @stream
102
- when IO then @stream << chunk
102
+ when IO
103
+ @stream << chunk.choice.delta.content
104
+ @stream.flush
103
105
  else @stream.call(chunk)
104
106
  end
105
107
  end
106
108
 
107
- @stream.flush if @stream.is_a?(IO)
109
+ @stream.puts if @stream.is_a?(IO)
108
110
  end
109
111
 
110
112
  # @return [Array<Hash>]
@@ -21,6 +21,7 @@ module OmniAI
21
21
 
22
22
  loop do
23
23
  @stdout.print('# ')
24
+ @stdout.flush
24
25
  prompt = @stdin.gets&.chomp
25
26
 
26
27
  break if prompt.nil? || prompt.match?(/\A(exit|quit)\z/i)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = '1.4.0'
4
+ VERSION = '1.4.1'
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.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre