foobara-agent-backed-command 0.0.3 → 0.0.5
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 +8 -0
- data/src/agent_backed_command.rb +41 -12
- 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: 44612bf50517981f612d5cc6da7ebf23149455f80ed3ff523c5c9453b2e9168e
|
4
|
+
data.tar.gz: 294abdb6334158e2544eeb171ce8405194544c461c83df6e0e57d6b78a540734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d94e43106f216cb08b4a6378fe571882656bb0526b9a340084f8a60c9090136d0f6cb0ccfb0e661417e87fb62f2294547643b7b516c6f19a0f66eb30b5e8e0d
|
7
|
+
data.tar.gz: 0cd7d6926331e9f8c0fa1665336291fa552fadd4ce8af8ccaffa3708b4135fda0c136edfdba01f87429651b99d0aeb0578adedd9019f57406783e0639633b1ed
|
data/CHANGELOG.md
CHANGED
data/src/agent_backed_command.rb
CHANGED
@@ -9,15 +9,42 @@ module Foobara
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
# TODO: does this need to be a Concern for proper inheritance?
|
12
|
-
attr_accessor :
|
13
|
-
:pass_aggregates_to_llm, :result_entity_depth
|
12
|
+
attr_accessor :io_out, :io_err, :context
|
14
13
|
|
15
14
|
def verbose(value = true)
|
16
|
-
|
15
|
+
@is_verbose = value
|
17
16
|
end
|
18
17
|
|
19
18
|
def verbose?
|
20
|
-
is_verbose
|
19
|
+
@is_verbose
|
20
|
+
end
|
21
|
+
|
22
|
+
def pass_aggregates_to_llm(value = true)
|
23
|
+
@should_pass_aggregates_to_llm = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def pass_aggregates_to_llm?
|
27
|
+
@should_pass_aggregates_to_llm
|
28
|
+
end
|
29
|
+
|
30
|
+
[
|
31
|
+
:agent_name,
|
32
|
+
:llm_model,
|
33
|
+
:max_llm_calls_per_minute,
|
34
|
+
:result_entity_depth
|
35
|
+
].each do |method_name|
|
36
|
+
define_method method_name do |*args|
|
37
|
+
case args.size
|
38
|
+
when 0
|
39
|
+
instance_variable_get("@#{method_name}")
|
40
|
+
when 1
|
41
|
+
instance_variable_set("@#{method_name}", args[0])
|
42
|
+
else
|
43
|
+
# :nocov:
|
44
|
+
raise ArgumentError, "Unexpected number of arguments: #{args.size}"
|
45
|
+
# :nocov:
|
46
|
+
end
|
47
|
+
end
|
21
48
|
end
|
22
49
|
end
|
23
50
|
|
@@ -123,20 +150,22 @@ module Foobara
|
|
123
150
|
opts[:result_entity_depth] = agent_options[:result_entity_depth]
|
124
151
|
end
|
125
152
|
|
126
|
-
if agent_options&.[](:pass_aggregates_to_llm).nil?
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
opts[:pass_aggregates_to_llm] = agent_options[:pass_aggregates_to_llm]
|
132
|
-
end
|
153
|
+
opts[:pass_aggregates_to_llm] = if agent_options&.[](:pass_aggregates_to_llm).nil?
|
154
|
+
self.class.pass_aggregates_to_llm?
|
155
|
+
else
|
156
|
+
agent_options[:pass_aggregates_to_llm]
|
157
|
+
end
|
133
158
|
|
134
159
|
self.agent = Foobara::Agent.new(**opts)
|
135
160
|
end
|
136
161
|
|
162
|
+
def agent_options
|
163
|
+
@agent_options ||= inputs[:agent_options] || {}
|
164
|
+
end
|
165
|
+
|
137
166
|
def pass_aggregates_to_llm?
|
138
167
|
if agent_options&.[](:pass_aggregates_to_llm).nil?
|
139
|
-
self.class.pass_aggregates_to_llm
|
168
|
+
self.class.pass_aggregates_to_llm?
|
140
169
|
else
|
141
170
|
agent_options[:pass_aggregates_to_llm]
|
142
171
|
end
|