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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1285ca282dd917cdb1193550613fafd8b73a0de6fa28e9b3bb54645b559c0f32
4
- data.tar.gz: 5db41d9063471ad5d537aac616ac6c66ab54f6bee854cc32dec4f8ca86b78e0a
3
+ metadata.gz: 44612bf50517981f612d5cc6da7ebf23149455f80ed3ff523c5c9453b2e9168e
4
+ data.tar.gz: 294abdb6334158e2544eeb171ce8405194544c461c83df6e0e57d6b78a540734
5
5
  SHA512:
6
- metadata.gz: 031bb05dfe8d289d7ceaa4a8ba6151644305c56dc7a670a4482e71f618226aebdee4dde73f492d057e8c571ba9cf60bdccbd83839d2ce74f811a288a43e9b383
7
- data.tar.gz: 7f723d58cf19367d5a0d3ecb31e77aa1b2563fd7be4f187ac8260e5d7c0f7c38ba76f1d40a49e5cd54df04be90875262c12dcaf6e87c2ba465fc5ea12ca2513d
6
+ metadata.gz: 9d94e43106f216cb08b4a6378fe571882656bb0526b9a340084f8a60c9090136d0f6cb0ccfb0e661417e87fb62f2294547643b7b516c6f19a0f66eb30b5e8e0d
7
+ data.tar.gz: 0cd7d6926331e9f8c0fa1665336291fa552fadd4ce8af8ccaffa3708b4135fda0c136edfdba01f87429651b99d0aeb0578adedd9019f57406783e0639633b1ed
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.5] - 2025-07-12
2
+
3
+ - Allow agent_options input to be removed
4
+
5
+ ## [0.0.4] - 2025-07-10
6
+
7
+ - Support DSL forms for several of the agent options
8
+
1
9
  ## [0.0.3] - 2025-07-09
2
10
 
3
11
  - Make use of Ai.default_llm_model
@@ -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 :is_verbose, :io_out, :io_err, :context, :agent_name, :llm_model, :max_llm_calls_per_minute,
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
- self.is_verbose = value
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
- unless self.class.pass_aggregates_to_llm.nil?
128
- opts[:pass_aggregates_to_llm] = self.class.pass_aggregates_to_llm
129
- end
130
- else
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
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.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi