ruby_bots 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_bots/bots/openai_react_bot.rb +44 -43
- 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: f033f968d4ac24541d10ae38913ea8752d1c6a08c538b3bab6716bcd72365e7a
|
4
|
+
data.tar.gz: c1f905d49c704475e7c96f0ab8957ac78cf422fc6fdfd38e0b15c0a2e3fe4671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b361259f543091c9a252419bcbe9d07a839b4b92249f790d58e8f09c7d421e62225d1e4f704d5dbad2932fb436f3668215c8e4f863550d2802475c00d776b46b
|
7
|
+
data.tar.gz: 011546a87f231642929daaf6a6edcd9a483da7961992958f30a0dfa8f402125c843860466c270407986c665d1a0e557a1e21652a543175374991cee1f68741b7
|
@@ -15,51 +15,52 @@ module RubyBots
|
|
15
15
|
end
|
16
16
|
|
17
17
|
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
|
-
]
|
18
|
+
[ EXAMPLE_ONE, EXAMPLE_TWO, EXAMPLE_THREE ]
|
61
19
|
end
|
62
20
|
|
21
|
+
|
22
|
+
EXAMPLE_ONE = <<~EXAMPLE
|
23
|
+
User: What is the current temperature in the city Julia Roberts was born in?
|
24
|
+
Thought: I need to know where Julia Roberts was born.
|
25
|
+
Action: search[Julia Roberts birthplace]
|
26
|
+
Observation: Smyrna, Georgia
|
27
|
+
Thought: I need to know the current temperature in Smyrna, Georgia.
|
28
|
+
Action: search[current temperature Smyrna, Georgia]
|
29
|
+
Observation: 72 degrees Fahrenheit
|
30
|
+
Thought: I need to tell the user the current temperature in the city Julia Roberts was born in.
|
31
|
+
Answer: 72 degrees Fahrenheit
|
32
|
+
EXAMPLE
|
33
|
+
|
34
|
+
EXAMPLE_TWO = <<~EXAMPLE
|
35
|
+
User: What is the square of the age of Albert Einstein at his death?
|
36
|
+
Thought: I need to know the age of Albert Einstein at his death.
|
37
|
+
Action: search[Albert Einstein age at death]
|
38
|
+
Observation: 76 years old
|
39
|
+
Thought: I need to know the square of 76.
|
40
|
+
Action: calculate[76^2]
|
41
|
+
Observation: 5776
|
42
|
+
Thought: I need to tell the user the square of the age of Albert Einstein at his death.
|
43
|
+
Answer: 5776
|
44
|
+
EXAMPLE
|
45
|
+
|
46
|
+
EXAMPLE_THREE = <<~EXAMPLE
|
47
|
+
User: What is half of the amount of years that have passed since the year the first airplane flew?
|
48
|
+
Thought: I need to know the year the first airplane flew.
|
49
|
+
Action: search[first airplane flight year]
|
50
|
+
Observation: 1903
|
51
|
+
Thought: I need to know the current year.
|
52
|
+
Action: search[current year]
|
53
|
+
Observation: 2023
|
54
|
+
Thought: I need to know the amount of years that have passed since 1903.
|
55
|
+
Action: calculate[2023 - 1903]
|
56
|
+
Observation: 120
|
57
|
+
Thought: I need to know half of 120.
|
58
|
+
Action: calculate[120 / 2]
|
59
|
+
Observation: 60
|
60
|
+
Thought: I need to tell the user half of the amount of years that have passed since the year the first airplane flew.
|
61
|
+
Answer: 60
|
62
|
+
EXAMPLE
|
63
|
+
|
63
64
|
def system_instructions
|
64
65
|
<<~PROMPT
|
65
66
|
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"
|