ruby_bots 0.0.2 → 0.0.4

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: 97bf25557fb288a1416c47c9e3e566e437c04c5d2c19fedab06ae83837e24408
4
- data.tar.gz: 26bb0781e3d5c2580b385539ae041eda38fb6ce2d323df20e80260780df78b88
3
+ metadata.gz: d0b84559e01ae6822b1c0df25903afac6558afd2deeec3a9168dd432a43f02c8
4
+ data.tar.gz: c7badfadd1f4281dcd83b813ff748203cb1618570eaab41929d8cc276cdeba56
5
5
  SHA512:
6
- metadata.gz: 7cefa94ef3b53ea79d46d39fb8256a3d96e96db852f45ae51feed2c58e0826fd2ba536acb43a1c801fdae83de8694be7f30e9e6541c344228d4bda1cac4dcbf7
7
- data.tar.gz: 2b2afd2c55c6878d52a5d9675bbcfc39b90a6df8374482fc06e762c68dec48afd88bf5282a36aa48859e77ec5697b7911e8a755fe5367d29734424225da701b7
6
+ metadata.gz: 81d3ad8d09dbc3ec62bafac7a227d6cdf76c70250993750e4e43b823a1e980a7b98b0f8fdd0ae9e3fd49877e48c3d3881fe24004644b5a7d416241b5225bd623
7
+ data.tar.gz: 34efdc886c8422f65e590d11a2071056c215d02f586bbf77d6e6f8e11bd364cc39be587a9e56db56e8d3e506453b5080fa2e66c4b3c212a021de000b0e3f4162
@@ -2,24 +2,25 @@ module RubyBots
2
2
  class OpenAIBot < OpenAITool
3
3
  attr_accessor :tools
4
4
 
5
- DEFAULT_DESCRIPTION = "This bot will use OpenAI to determine the appropriate tool."
6
-
7
- def initialize(name: "OpenAI bot", description: DEFAULT_DESCRIPTION, tools:)
8
- @name = name
9
- @description = description
10
- @tools = tools
11
- end
12
-
13
- def operate(inputs)
14
- params = {
15
- messages: [
16
- { role: :system, content: system_instructions },
17
- { role: :user, content: inputs }
18
- ]
19
- }.merge(default_params)
5
+ DEFAULT_DESCRIPTION = "This bot will use OpenAI to determine the appropriate tool."
6
+
7
+ def initialize(name: "OpenAI bot", description: DEFAULT_DESCRIPTION, tools:)
8
+ @name = name
9
+ @description = description
10
+ @tools = tools
11
+ end
12
+
13
+ def operate(inputs)
14
+ params = {
15
+ messages: [
16
+ { role: :system, content: system_instructions },
17
+ { role: :user, content: inputs }
18
+ ]
19
+ }.merge(default_params)
20
20
 
21
- response = client.chat(parameters: params)
21
+ response = client.chat(parameters: params)
22
22
 
23
- response.dig("choices", 0, "message", "content")
23
+ response.dig("choices", 0, "message", "content")
24
+ end
24
25
  end
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
data/lib/ruby_bots.rb CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  require "ruby_bots/tool"
19
19
  require "ruby_bots/bot"
20
+ require "ruby_bots/tools/openai_tool.rb"
20
21
  require "ruby_bots/bots/openai_bot.rb"
21
22
  require "ruby_bots/bots/pipeline_bot.rb"
22
- require "ruby_bots/bots/router_bot.rb"
23
- require "ruby_bots/tools/openai_tool.rb"
23
+ require "ruby_bots/bots/router_bot.rb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson