foobara-agent-backed-command 0.0.5 → 0.0.6
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/CHANGELOG.md +4 -0
- data/lib/foobara/agent_backed_command.rb +1 -0
- data/src/agent_backed_command.rb +13 -6
- 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: d4a95e6015814a8a5f4050a444e5ba64214a166d4fa2d17f65c7f8722304b182
|
4
|
+
data.tar.gz: 89e75c0ddc7e951b2676e078af839319935c1aacd48137adf1ce41ea485d0d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62be54f5dbfe362382ac96f9b097a3d4bbec38b073f3704a4be9e0f311ee0fbd399abdae11dfa7dc966611388a203b0502b615785174022e06377b398ed12836
|
7
|
+
data.tar.gz: e5109c393e91add730ce98de1a58c9d60a0c1b80b8b23b6666dec5b3658240c8d360b4c733da5a3c6c6e4582c541ec32add7f348ef81b1de529409bff8ca6708
|
data/CHANGELOG.md
CHANGED
data/src/agent_backed_command.rb
CHANGED
@@ -30,8 +30,8 @@ module Foobara
|
|
30
30
|
[
|
31
31
|
:agent_name,
|
32
32
|
:llm_model,
|
33
|
-
:
|
34
|
-
:
|
33
|
+
:result_entity_depth,
|
34
|
+
:maximum_command_calls
|
35
35
|
].each do |method_name|
|
36
36
|
define_method method_name do |*args|
|
37
37
|
case args.size
|
@@ -60,8 +60,11 @@ module Foobara
|
|
60
60
|
one_of: Ai::AnswerBot::Types::ModelEnum,
|
61
61
|
default: Ai.default_llm_model,
|
62
62
|
description: "The model to use for the LLM"
|
63
|
-
max_llm_calls_per_minute :integer, :allow_nil
|
64
63
|
pass_aggregates_to_llm :boolean, :allow_nil
|
64
|
+
maximum_command_calls :integer,
|
65
|
+
:allow_nil,
|
66
|
+
default: 25,
|
67
|
+
description: "Maximum number of commands to run before giving up"
|
65
68
|
result_entity_depth :symbol, :allow_nil, one_of: Foobara::AssociationDepth
|
66
69
|
end
|
67
70
|
end
|
@@ -137,9 +140,7 @@ module Foobara
|
|
137
140
|
io_err: agent_options&.[](:io_err) || self.class.io_err,
|
138
141
|
agent_name:,
|
139
142
|
context: agent_options&.[](:context) || self.class.context,
|
140
|
-
llm_model: agent_options&.[](:llm_model) || self.class.llm_model
|
141
|
-
# TODO: eliminate this now that we have backoffs for 529s and 429s
|
142
|
-
max_llm_calls_per_minute: agent_options&.[](:max_llm_calls_per_minute) || self.class.max_llm_calls_per_minute
|
143
|
+
llm_model: agent_options&.[](:llm_model) || self.class.llm_model
|
143
144
|
}
|
144
145
|
|
145
146
|
if agent_options&.[](:result_entity_depth).nil?
|
@@ -156,6 +157,12 @@ module Foobara
|
|
156
157
|
agent_options[:pass_aggregates_to_llm]
|
157
158
|
end
|
158
159
|
|
160
|
+
maximum_command_calls = agent_options&.[](:maximum_command_calls) || self.class.maximum_command_calls
|
161
|
+
|
162
|
+
if maximum_command_calls
|
163
|
+
opts[:maximum_command_calls] = maximum_command_calls
|
164
|
+
end
|
165
|
+
|
159
166
|
self.agent = Foobara::Agent.new(**opts)
|
160
167
|
end
|
161
168
|
|