ruby_bots 0.0.22 → 0.0.24
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 +4 -4
- data/lib/ruby_bots/bots/openai_react_bot.rb +45 -45
- data/lib/ruby_bots/version.rb +1 -1
- data/lib/ruby_bots.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3581263e6de8ee4810087bbb80aa161c2fa6c30020342ea71f96ce5a4aa39f47
|
4
|
+
data.tar.gz: 703e4c8597a8fcc7f3531754cfeb0864430ff7ce906e801c84662006544f8f59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20da69e567d336ff178f818008f91d290abbd3e8cf1dd8ac6d660f90fdd1b3d359cc8382cf1adcdf5bf1911d0f5ecdb37ccda6b33af2c6cb4c4a068a2fc54ef3
|
7
|
+
data.tar.gz: 78c6d3a0db366cb3f5f1c8a437b4ba5d295ab6447f44f8f80a0974c8e17688a5c447b15abc36240ffa072043c5650b510775f135e3f439d4cfd8f97734088bca
|
@@ -10,56 +10,56 @@ module RubyBots
|
|
10
10
|
]
|
11
11
|
|
12
12
|
def initialize(name: "OpenAI ReAct bot", description: DEFAULT_DESCRIPTION, tools: DEFAULT_TOOLS)
|
13
|
-
|
14
|
-
super(name: name, description: description)
|
13
|
+
super(name: name, description: description, tools: tools)
|
15
14
|
end
|
16
15
|
|
17
16
|
def examples
|
18
|
-
[
|
19
|
-
<<~EXAMPLE
|
20
|
-
User: What is the current temperature in the city Julia Roberts was born in?
|
21
|
-
Thought: I need to know where Julia Roberts was born.
|
22
|
-
Action: search[Julia Roberts birthplace]
|
23
|
-
Observation: Smyrna, Georgia
|
24
|
-
Thought: I need to know the current temperature in Smyrna, Georgia.
|
25
|
-
Action: search[current temperature Smyrna, Georgia]
|
26
|
-
Observation: 72 degrees Fahrenheit
|
27
|
-
Thought: I need to tell the user the current temperature in the city Julia Roberts was born in.
|
28
|
-
Answer: 72 degrees Fahrenheit
|
29
|
-
EXAMPLE
|
30
|
-
,
|
31
|
-
<<~EXAMPLE
|
32
|
-
User: What is the square of the age of Albert Einstein at his death?
|
33
|
-
Thought: I need to know the age of Albert Einstein at his death.
|
34
|
-
Action: search[Albert Einstein age at death]
|
35
|
-
Observation: 76 years old
|
36
|
-
Thought: I need to know the square of 76.
|
37
|
-
Action: calculate[76^2]
|
38
|
-
Observation: 5776
|
39
|
-
Thought: I need to tell the user the square of the age of Albert Einstein at his death.
|
40
|
-
Answer: 5776
|
41
|
-
EXAMPLE
|
42
|
-
,
|
43
|
-
<<~EXAMPLE
|
44
|
-
User: What is half of the amount of years that have passed since the year the first airplane flew?
|
45
|
-
Thought: I need to know the year the first airplane flew.
|
46
|
-
Action: search[first airplane flight year]
|
47
|
-
Observation: 1903
|
48
|
-
Thought: I need to know the current year.
|
49
|
-
Action: search[current year]
|
50
|
-
Observation: 2023
|
51
|
-
Thought: I need to know the amount of years that have passed since 1903.
|
52
|
-
Action: calculate[2023 - 1903]
|
53
|
-
Observation: 120
|
54
|
-
Thought: I need to know half of 120.
|
55
|
-
Action: calculate[120 / 2]
|
56
|
-
Observation: 60
|
57
|
-
Thought: I need to tell the user half of the amount of years that have passed since the year the first airplane flew.
|
58
|
-
Answer: 60
|
59
|
-
EXAMPLE
|
60
|
-
]
|
17
|
+
[ EXAMPLE_ONE, EXAMPLE_TWO, EXAMPLE_THREE ]
|
61
18
|
end
|
62
19
|
|
20
|
+
|
21
|
+
EXAMPLE_ONE = <<~EXAMPLE
|
22
|
+
User: What is the current temperature in the city Julia Roberts was born in?
|
23
|
+
Thought: I need to know where Julia Roberts was born.
|
24
|
+
Action: search[Julia Roberts birthplace]
|
25
|
+
Observation: Smyrna, Georgia
|
26
|
+
Thought: I need to know the current temperature in Smyrna, Georgia.
|
27
|
+
Action: search[current temperature Smyrna, Georgia]
|
28
|
+
Observation: 72 degrees Fahrenheit
|
29
|
+
Thought: I need to tell the user the current temperature in the city Julia Roberts was born in.
|
30
|
+
Answer: 72 degrees Fahrenheit
|
31
|
+
EXAMPLE
|
32
|
+
|
33
|
+
EXAMPLE_TWO = <<~EXAMPLE
|
34
|
+
User: What is the square of the age of Albert Einstein at his death?
|
35
|
+
Thought: I need to know the age of Albert Einstein at his death.
|
36
|
+
Action: search[Albert Einstein age at death]
|
37
|
+
Observation: 76 years old
|
38
|
+
Thought: I need to know the square of 76.
|
39
|
+
Action: calculate[76^2]
|
40
|
+
Observation: 5776
|
41
|
+
Thought: I need to tell the user the square of the age of Albert Einstein at his death.
|
42
|
+
Answer: 5776
|
43
|
+
EXAMPLE
|
44
|
+
|
45
|
+
EXAMPLE_THREE = <<~EXAMPLE
|
46
|
+
User: What is half of the amount of years that have passed since the year the first airplane flew?
|
47
|
+
Thought: I need to know the year the first airplane flew.
|
48
|
+
Action: search[first airplane flight year]
|
49
|
+
Observation: 1903
|
50
|
+
Thought: I need to know the current year.
|
51
|
+
Action: search[current year]
|
52
|
+
Observation: 2023
|
53
|
+
Thought: I need to know the amount of years that have passed since 1903.
|
54
|
+
Action: calculate[2023 - 1903]
|
55
|
+
Observation: 120
|
56
|
+
Thought: I need to know half of 120.
|
57
|
+
Action: calculate[120 / 2]
|
58
|
+
Observation: 60
|
59
|
+
Thought: I need to tell the user half of the amount of years that have passed since the year the first airplane flew.
|
60
|
+
Answer: 60
|
61
|
+
EXAMPLE
|
62
|
+
|
63
63
|
def system_instructions
|
64
64
|
<<~PROMPT
|
65
65
|
You are an assistant designed to provide solutions for a user. You are provided with the user's input.
|
data/lib/ruby_bots/version.rb
CHANGED
data/lib/ruby_bots.rb
CHANGED
@@ -30,10 +30,10 @@ module RubyBots
|
|
30
30
|
class InvalidOutputError < Error; end
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
require_relative "ruby_bots/tool"
|
34
|
+
require_relative "ruby_bots/bot"
|
35
|
+
require_relative "ruby_bots/tools/openai_tool.rb"
|
36
|
+
require_relative "ruby_bots/bots/openai_bot.rb"
|
37
|
+
require_relative "ruby_bots/bots/pipeline_bot.rb"
|
38
|
+
require_relative "ruby_bots/bots/router_bot.rb"
|
39
|
+
require_relative "ruby_bots/bots/openai_react_bot.rb"
|