ruby_bots 0.0.10 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57e874e57f241c81e6b20156905a336fca1dae1226e5363f00ba1e884ddabe75
4
- data.tar.gz: dc6e8a2ff203144a09951fdd13c7785dc10feb32c0f5ebd6cede8579380b9a61
3
+ metadata.gz: d056426306b21ae19a4901ebf8dca46b49b5a424ab5a4620aa34dbfe358234e1
4
+ data.tar.gz: 94a30da43cd0a60b01c2bebab8da16bc43430e7581cd3360b72a2cec333fa260
5
5
  SHA512:
6
- metadata.gz: 07cad20b223b0a8e5408b7b5a6f92b089ff582b207f745d8ee6c0ca8c46f3e6a5b9f962e2bc697787ddd982d14aeadcdfeedcf78507459812f5f2d767a4e2efb
7
- data.tar.gz: ac91e36c241e80139a11ab00f44ec01f40e2d817a1ebe374b30f1a0a8ab3fd54e2e7d40eeff51dc59bf377fdb11ad857ca6872e412b0ec9a34f7cd7065ba0522
6
+ metadata.gz: c7329d7a8665e3cbff333d619069425a32ece7971004c84d057e445695823de8be148301fb6f779f05ba2cbcebff11f9cdac8eec5de5a5f35439b258fac6547d
7
+ data.tar.gz: 55c71a7ffa660ff3f0ef92739e8a317915fd32c55db3498f4c0beea96302a6fa2ba71d6b3bb965ddb0b7cb4b3c44e7287f86586dcefd24697e7faf646cb12501
data/lib/ruby_bots/bot.rb CHANGED
@@ -7,6 +7,8 @@ module RubyBots
7
7
  super(name: name, description: description)
8
8
  end
9
9
 
10
+ private
11
+
10
12
  def run(inputs)
11
13
  raise NotImplementedError
12
14
  end
@@ -8,6 +8,8 @@ module RubyBots
8
8
  @tools = tools
9
9
  super(name: name, description: description)
10
10
  end
11
+
12
+ private
11
13
 
12
14
  def run(inputs)
13
15
  params = {
@@ -5,6 +5,8 @@ module RubyBots
5
5
  def initialize(name: "Pipeline bot", description: DEFAULT_DESCRIPTION, tools:)
6
6
  super(name: name, description: description, tools: tools)
7
7
  end
8
+
9
+ private
8
10
 
9
11
  def run(inputs)
10
12
  tools.each do |tool|
@@ -16,6 +16,8 @@ module RubyBots
16
16
  If no tools match the user's request respond with "I'm sorry, I am still learning." and nothing more.
17
17
  PROMPT
18
18
  end
19
+
20
+ private
19
21
 
20
22
  def run(inputs)
21
23
  params = {
@@ -10,6 +10,10 @@ module RubyBots
10
10
  @output_validators ||= []
11
11
  end
12
12
 
13
+ class << self
14
+ attr_accessor :input_validators, :output_validators
15
+ end
16
+
13
17
  def self.validate_inputs(method)
14
18
  @input_validators ||= []
15
19
  @input_validators << method
@@ -20,20 +24,22 @@ module RubyBots
20
24
  @output_validators << method
21
25
  end
22
26
 
23
- def run(inputs)
24
- raise NotImplementedError
25
- end
26
-
27
27
  def response(input)
28
- @input_validators.each do |validator|
28
+ self.class.input_validators.each do |validator|
29
29
  validator.call(input)
30
30
  end
31
31
 
32
32
  output = run(input)
33
-
34
- @output_validators.each do |validator|
33
+
34
+ self.class.output_validators.each do |validator|
35
35
  validator.call(output)
36
36
  end
37
37
  end
38
+
39
+ private
40
+
41
+ def run(inputs)
42
+ raise NotImplementedError
43
+ end
38
44
  end
39
45
  end
@@ -24,6 +24,8 @@ module RubyBots
24
24
  def system_instructions
25
25
  "You are a helpful assistant."
26
26
  end
27
+
28
+ private
27
29
 
28
30
  def run(inputs)
29
31
  params = {
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = "0.0.10".freeze
2
+ VERSION = "0.0.12".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2023-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug