foobara-agent-backed-command 0.0.2 → 0.0.4
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 +39 -13
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 485915c4c74a0e92159692aa22963ed96c487bcee80ab76a7acc43d803de48ae
|
4
|
+
data.tar.gz: ab01f8d12e59e7b5171d969da98e7b8562b42d4b7e54ba26230b4cb19d5ad5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc558acd211fac9831e5bbac810232dea7a165d4729cfb6b9ecf1223bda23bfab3eb8ad8a8fa8275660d8b1c1873dae3aa610f252117d81b4c6421dd043bcf9f
|
7
|
+
data.tar.gz: 9bb9274e270b987c4aa2dd3d708f6e81f74658a99c1526b9aae3aa71525329a0ef55497c0aba2b8419b130bd86f5e0e2693ef8e06d534a008ccd10e85a7001f6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.0.4] - 2025-07-10
|
2
|
+
|
3
|
+
- Support DSL forms for several of the agent options
|
4
|
+
|
5
|
+
## [0.0.3] - 2025-07-09
|
6
|
+
|
7
|
+
- Make use of Ai.default_llm_model
|
8
|
+
|
1
9
|
## [0.0.2] - 2025-07-08
|
2
10
|
|
3
11
|
- Better handle serialization/pre-commit loading for different inputs/result scenarios
|
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
|
|
@@ -30,7 +57,8 @@ module Foobara
|
|
30
57
|
agent_name :string, :allow_nil
|
31
58
|
llm_model :string,
|
32
59
|
:allow_nil,
|
33
|
-
one_of:
|
60
|
+
one_of: Ai::AnswerBot::Types::ModelEnum,
|
61
|
+
default: Ai.default_llm_model,
|
34
62
|
description: "The model to use for the LLM"
|
35
63
|
max_llm_calls_per_minute :integer, :allow_nil
|
36
64
|
pass_aggregates_to_llm :boolean, :allow_nil
|
@@ -122,20 +150,18 @@ module Foobara
|
|
122
150
|
opts[:result_entity_depth] = agent_options[:result_entity_depth]
|
123
151
|
end
|
124
152
|
|
125
|
-
if agent_options&.[](:pass_aggregates_to_llm).nil?
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
opts[:pass_aggregates_to_llm] = agent_options[:pass_aggregates_to_llm]
|
131
|
-
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
|
132
158
|
|
133
159
|
self.agent = Foobara::Agent.new(**opts)
|
134
160
|
end
|
135
161
|
|
136
162
|
def pass_aggregates_to_llm?
|
137
163
|
if agent_options&.[](:pass_aggregates_to_llm).nil?
|
138
|
-
self.class.pass_aggregates_to_llm
|
164
|
+
self.class.pass_aggregates_to_llm?
|
139
165
|
else
|
140
166
|
agent_options[:pass_aggregates_to_llm]
|
141
167
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-agent-backed-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
@@ -16,6 +16,9 @@ dependencies:
|
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: 0.0.1
|
19
|
+
- - "<"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.0
|
19
22
|
type: :runtime
|
20
23
|
prerelease: false
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -23,6 +26,9 @@ dependencies:
|
|
23
26
|
- - ">="
|
24
27
|
- !ruby/object:Gem::Version
|
25
28
|
version: 0.0.1
|
29
|
+
- - "<"
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 2.0.0
|
26
32
|
email:
|
27
33
|
- azimux@gmail.com
|
28
34
|
executables: []
|