foobara-agent-backed-command 0.0.6 → 0.0.7

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: d4a95e6015814a8a5f4050a444e5ba64214a166d4fa2d17f65c7f8722304b182
4
- data.tar.gz: 89e75c0ddc7e951b2676e078af839319935c1aacd48137adf1ce41ea485d0d23
3
+ metadata.gz: dc71a16e925bc371058a8fa67197ffbb4628fc5b9a7201a41a19e9bb86b661b6
4
+ data.tar.gz: 1274e53472b00432601ad7ca1c9db89716e82d804816c2b6b35383d9f1dbffb4
5
5
  SHA512:
6
- metadata.gz: 62be54f5dbfe362382ac96f9b097a3d4bbec38b073f3704a4be9e0f311ee0fbd399abdae11dfa7dc966611388a203b0502b615785174022e06377b398ed12836
7
- data.tar.gz: e5109c393e91add730ce98de1a58c9d60a0c1b80b8b23b6666dec5b3658240c8d360b4c733da5a3c6c6e4582c541ec32add7f348ef81b1de529409bff8ca6708
6
+ metadata.gz: 74a9526f5b9e09496b5a0c0e162181af418d8a2aa9efecdaffe5bb9c6e0e2f04222dbcba84ceded5d7c14d3a0a2b24fefb3b54c8986d23832aa95ed6f3ec5686
7
+ data.tar.gz: 6c442453cec558c796c836ab9a24b74d0106307dda2cb51689611df1b86e28201adc158e8f3c18cede0b10c3ed662606152074fc2b70c6e2afc491d2460f2d3e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.7] - 2025-07-23
2
+
3
+ - Do not let ABCs use the #agent_options input of other ABCs
4
+
1
5
  ## [0.0.6] - 2025-07-21
2
6
 
3
7
  - Make sure foobara-ai gem is properly loaded
@@ -126,13 +126,12 @@ module Foobara
126
126
  end
127
127
  end
128
128
 
129
- agent_name = agent_options&.[](:agent_name) || self.class.agent_name || "#{self.class.scoped_short_name}Agent"
129
+ agent_name = agent_options&.[](:agent_name) || self.class.agent_name || self.class.scoped_short_name
130
130
 
131
131
  verbose = agent_options&.[](:verbose)
132
132
  verbose = self.class.verbose? if verbose.nil?
133
133
 
134
134
  opts = {
135
- command_classes:,
136
135
  include_message_to_user_in_result:,
137
136
  result_type: agent_result_type,
138
137
  verbose:,
@@ -164,6 +163,27 @@ module Foobara
164
163
  end
165
164
 
166
165
  self.agent = Foobara::Agent.new(**opts)
166
+
167
+ command_classes.each do |klass|
168
+ if klass.is_a?(::Symbol)
169
+ real_class = Namespace.global.foobara_lookup_command(
170
+ klass,
171
+ mode: Namespace::LookupMode::ABSOLUTE
172
+ )
173
+
174
+ if real_class
175
+ klass = real_class
176
+ end
177
+ end
178
+
179
+ opts = if klass.is_a?(Class) && klass < AgentBackedCommand
180
+ { inputs: { reject: [:agent_options] } }
181
+ else
182
+ {}
183
+ end
184
+
185
+ agent.connect(klass, **opts)
186
+ end
167
187
  end
168
188
 
169
189
  def agent_options
@@ -184,10 +204,9 @@ module Foobara
184
204
  goal = Util.underscore(goal)
185
205
  goal = Util.humanize(goal)
186
206
 
187
- goal = "You are an agent backed command named #{self.class.scoped_short_name}. Your goal is: #{goal}."
188
-
189
207
  if self.class.description
190
- goal += " The command description is: #{self.class.description}."
208
+ goal += "\n\nYour behavior has been described to the person or agent that chose to run you as: "
209
+ goal += self.class.description
191
210
  end
192
211
 
193
212
  inputs_type = self.class.inputs_type
@@ -209,7 +228,7 @@ module Foobara
209
228
  inputs_type,
210
229
  association_depth:
211
230
  )
212
- goal += " The inputs to this command have the following type:\n\n#{json_inputs_type}\n\n"
231
+ goal += "\n\nYour inputs to this command have the following type:\n\n#{json_inputs_type}\n\n"
213
232
 
214
233
  serializer = if pass_aggregates_to_llm?
215
234
  CommandConnectors::Serializers::AggregateSerializer
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi