foobara-agent-backed-command 0.0.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1285ca282dd917cdb1193550613fafd8b73a0de6fa28e9b3bb54645b559c0f32
4
- data.tar.gz: 5db41d9063471ad5d537aac616ac6c66ab54f6bee854cc32dec4f8ca86b78e0a
3
+ metadata.gz: 485915c4c74a0e92159692aa22963ed96c487bcee80ab76a7acc43d803de48ae
4
+ data.tar.gz: ab01f8d12e59e7b5171d969da98e7b8562b42d4b7e54ba26230b4cb19d5ad5f4
5
5
  SHA512:
6
- metadata.gz: 031bb05dfe8d289d7ceaa4a8ba6151644305c56dc7a670a4482e71f618226aebdee4dde73f492d057e8c571ba9cf60bdccbd83839d2ce74f811a288a43e9b383
7
- data.tar.gz: 7f723d58cf19367d5a0d3ecb31e77aa1b2563fd7be4f187ac8260e5d7c0f7c38ba76f1d40a49e5cd54df04be90875262c12dcaf6e87c2ba465fc5ea12ca2513d
6
+ metadata.gz: cc558acd211fac9831e5bbac810232dea7a165d4729cfb6b9ecf1223bda23bfab3eb8ad8a8fa8275660d8b1c1873dae3aa610f252117d81b4c6421dd043bcf9f
7
+ data.tar.gz: 9bb9274e270b987c4aa2dd3d708f6e81f74658a99c1526b9aae3aa71525329a0ef55497c0aba2b8419b130bd86f5e0e2693ef8e06d534a008ccd10e85a7001f6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.4] - 2025-07-10
2
+
3
+ - Support DSL forms for several of the agent options
4
+
1
5
  ## [0.0.3] - 2025-07-09
2
6
 
3
7
  - 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,18 @@ 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
 
137
162
  def pass_aggregates_to_llm?
138
163
  if agent_options&.[](:pass_aggregates_to_llm).nil?
139
- self.class.pass_aggregates_to_llm
164
+ self.class.pass_aggregates_to_llm?
140
165
  else
141
166
  agent_options[:pass_aggregates_to_llm]
142
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi