omniai 0.2.0 → 1.0.0

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: 1694fba08fa9ef9bd8dc3496ce1acbc3c321357d082303869df74ee667a83a65
4
- data.tar.gz: c0d98caa29e034c610d20654cc175e42eeb69cef414ba79a5fda61d883d2d9f3
3
+ metadata.gz: a227888b197b576509bec7208b79f125e2c55baac317ce32b3fed8e2101f11cc
4
+ data.tar.gz: 16fe842b15ef266556c9887b1625c32a62edbbdba21dea0a8b21e418d76cd435
5
5
  SHA512:
6
- metadata.gz: ddfcd3c15811a63b401290577b36170573e4e170064a8cf64686ceacfc1ddb2c3e5af10ab2a7bb1057db9fe691b8359a94da24c0ce774f71ed5df50063b3925b
7
- data.tar.gz: 66dcd111279e7de048473789cfae9020a0c6bb9b812bdd10a1bb2c2c12ee246bd9cebf6b7890322fdcc4a72743033746bd9e5a3f8d283b43ae0bbea5315de05e
6
+ metadata.gz: a4bc067e862d142036dcc15721fb7f3cf5084112145676b3884977e5d3e7025f34637eab3520ad2a1f2d524909f5e8a55b7a2bee35c139062cb481ffc64b3071
7
+ data.tar.gz: c95602154261e59d7e42fbc94d7afb42f836f54287c4842c0c982a82ced52271ac8c41afbb6cb620865ca948d55971c789c94967f5f18e2af8305271e1c2885b
@@ -69,7 +69,7 @@ module OmniAI
69
69
  end
70
70
 
71
71
  # @param response [HTTP::Response]
72
- # @return [OmniAI::Chat::Chunk]
72
+ # @return [OmniAI::Chat::Stream]
73
73
  def stream!(response:)
74
74
  raise Error, "#{self.class.name}#stream! unstreamable" unless @stream
75
75
 
data/lib/omniai/chat.rb CHANGED
@@ -17,6 +17,8 @@ module OmniAI
17
17
  #
18
18
  # @param client [OmniAI::Client] the client
19
19
  class Chat
20
+ JSON_PROMPT = 'Respond with valid JSON. Do not include any non-JSON in the response.'
21
+
20
22
  module Role
21
23
  ASSISTANT = 'assistant'
22
24
  USER = 'user'
data/lib/omniai/client.rb CHANGED
@@ -27,6 +27,12 @@ module OmniAI
27
27
  @logger = logger
28
28
  end
29
29
 
30
+ # @return [String]
31
+ def inspect
32
+ masked_api_key = "#{api_key[..2]}***" if api_key
33
+ "#<#{self.class.name} api_key=#{masked_api_key.inspect}>"
34
+ end
35
+
30
36
  # @return [HTTP::Client]
31
37
  def connection
32
38
  raise NotImplementedError, "#{self.class.name}#connection undefined"
data/lib/omniai/config.rb CHANGED
@@ -4,5 +4,11 @@ module OmniAI
4
4
  # A configuration for each agent w/ `api_key` / `host` / `logger`.
5
5
  class Config
6
6
  attr_accessor :api_key, :host, :logger
7
+
8
+ # @return [String]
9
+ def inspect
10
+ masked_api_key = "#{api_key[..2]}***" if api_key
11
+ "#<#{self.class.name} api_key=#{masked_api_key.inspect} host=#{host.inspect}>"
12
+ end
7
13
  end
8
14
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = '0.2.0'
4
+ VERSION = '1.0.0'
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: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre