foobara-agent 0.0.20 → 0.1.0

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: 17773b8b47ace046d920b37565e0b5327fad2bba050f867c9a951ee89b780a93
4
- data.tar.gz: 861120d98c2c9cce6f5194403cc950d7ff6c096061be4ebd8cd7a3f93f43c78f
3
+ metadata.gz: b2c6928861e690e60fc4df800ced4434015b64dc29fde57208299e4134126ce3
4
+ data.tar.gz: f7cd28971c47aeab1f04b5646630615b30da5dd49bc8904f1ba4e7b5d8a51b85
5
5
  SHA512:
6
- metadata.gz: be3168705a2ef7bfcc7a9ab2cde4713c91451857fbb762f121ada60d48cf590d5b0c184ca514221c58fb2b2bdbef08e20f95b7783ba54e83cb9f55fa37546350
7
- data.tar.gz: c02c9a0b4dd95b228a8d723ed84af909040f50c8bb2694aea0b30e30a1ab7356f5f074d6a8e64a1ba47b5a113b69e013ad1db0f5fb98ded799ffcc8d5e89760d
6
+ metadata.gz: 83c3cbdb2cd4efb990c15b935c468aa9d04f3410ff712d50d5b40bf2f8e1b0ae88b75b5a4d59ff11bf54f0eb0844a27e81f9f19f3b10cc97a0ed5e461f7d4bad
7
+ data.tar.gz: d4f6719365a7f0a4374615a3bf61701c9fdcca3a3b730ef6bb3de97b9ebc3a139552efc377a34878bd06a5bf8b2918430ecc98cde36b7d703078dbe148366763
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.0] - 2025-08-22
2
+
3
+ - Allow killing the agent before setting a goal
4
+
5
+ ## [0.0.21] - 2025-07-23
6
+
7
+ - Attempt to fix some regressions in some demo projects by reverting some llm instruction changes
8
+
1
9
  ## [0.0.20] - 2025-07-23
2
10
 
3
11
  - Fix bug with result type being an array without any message to the user
@@ -17,8 +17,15 @@ module Foobara
17
17
  end
18
18
 
19
19
  def build_llm_instructions(assistant_association_depth, goal, previous_goals)
20
- instructions = "You are part of an agent implementation. " \
21
- "Your task is to decide which command to run next.\n\n"
20
+ instructions = "You are the implementation of a command called #{scoped_full_name}"
21
+
22
+ instructions += if description && !description.empty?
23
+ " which has the following description:\n\n#{description}\n\n"
24
+ else
25
+ # :nocov:
26
+ ". "
27
+ # :nocov:
28
+ end
22
29
 
23
30
  result_schema = result_json_schema(assistant_association_depth)
24
31
 
@@ -31,25 +38,13 @@ module Foobara
31
38
  end
32
39
  end
33
40
 
34
- instructions += "You are working towards accomplishing the following goal: #{goal}\n\n"
35
-
36
- instructions += "You will answer with the name of the next command to run and, if needed, its inputs. " \
37
- "Choose whichever command is best to make progress towards accomplishing the current goal " \
38
- "based on the progress made so far. " \
39
- "If the goal has been accomplished then choose the " \
40
- "NotifyUserThatCurrentGoalHasBeenAccomplished command. " \
41
- "If you are stuck either due to errors " \
42
- "or because you do not have the command you need to accomplish the " \
43
- "goal, then choose GiveUp.\n\n"
41
+ instructions += "You are working towards accomplishing the following goal:\n\n#{goal}\n\n"
44
42
 
43
+ instructions += "Your response of which command to run next should match the following JSON schema:"
44
+ instructions += "\n\n#{result_schema}\n\n"
45
45
  instructions += "You can get more details about the inputs and result schemas for a specific command by " \
46
- "choosing the DescribeCommand command.\n\n"
47
-
48
- instructions += "Your result type is described by the following JSON schema:" \
49
- "\n\n#{result_schema}\n\n" \
50
- "You will reply with nothing more than the JSON that you've " \
51
- "generated that adheres to this result type schema " \
52
- "so that the calling code " \
46
+ "choosing the DescribeCommand command. " \
47
+ "You will reply with nothing more than the JSON you've generated so that the calling code " \
53
48
  "can successfully parse your answer."
54
49
 
55
50
  instructions
@@ -59,8 +54,7 @@ module Foobara
59
54
  description "Returns the name of the next command to run and its inputs given the progress " \
60
55
  "towards accomplishing the current goal. " \
61
56
  "If the goal has been accomplished it will choose the " \
62
- "NotifyUserThatCurrentGoalHasBeenAccomplished command. It will choose GiveUp if it runs into an " \
63
- "error it cannot get around or does not believe it has the proper commands to accomplish its goal."
57
+ "NotifyUserThatCurrentGoalHasBeenAccomplished command."
64
58
 
65
59
  result do
66
60
  command :string, :required
data/src/foobara/agent.rb CHANGED
@@ -112,8 +112,9 @@ module Foobara
112
112
  def kill!
113
113
  current_accomplish_goal_command&.kill!
114
114
  state_machine.perform_transition!(:kill) do
115
- if context
116
- context.current_goal.state = Goal::States::KILLED
115
+ current_goal = context&.current_goal
116
+ if current_goal
117
+ current_goal.state = Goal::States::KILLED
117
118
  end
118
119
  end
119
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.136
18
+ version: 0.1.1
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 2.0.0
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 0.0.136
28
+ version: 0.1.1
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: 2.0.0