You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): add previous task infos for SOP extraction (#33)
* fix(core): set true at the end of space agent
* feat(core): add previous task context to sop agent
* fix(core): sop with condidtion
* prompt(core): use sop agent
* prompt: update task tracking
* feat(core): update learning status api
* test: update learning status
- If user mentioned any preference on this task, extract in the clean format 'user expects/wants...' in 'user_preference_and_infos' field.
50
50
- If user mentioned any infos(address, email,... etc) so that the task can be completed, extract it and fill it in 'user_preference_and_infos' field.
51
51
52
-
## Append with Progress
53
-
- Give a brief progress of the task when appending messages
54
-
- Concise and short. only state what the current state.
52
+
## Summary the Task State and Append to Progress
53
+
- Give a concise current state of the task when appending messages
55
54
- Narrate progress in the first person as the agent.
56
55
- Facts over General. Don't say "I encountered many errors", say "I encountered python syntax and rust compiling error."
57
-
- Actual State over Reference. Don't say 'I open the target websit', say "I navigate to https://github.com/trending".
56
+
- Actual Value over Generic. Don't say 'I open the target websit', say "I navigate to https://github.com/trending". Use actual website url, DB table... when possible.
returnf"""You're a Tool-calling SOP Agent that analyzes user-agent working history and generates reusable tool-calling SOPs.
42
41
43
42
## Core Responsibilities
44
-
- Understand task and user preferences
43
+
- Understand task conditions and user preferences
45
44
- Give the task's complexity a score.
46
45
- Skip easy task's tool_sop, or abstract a template SOP from complex task.
46
+
47
+
## Task Complexity Scoring
47
48
{base_scoring_section}
48
49
If a task's complexity score is < 2, then skip the task because it's too easy, and you should submit a empty SOP with `is_easy_task` set to True.
49
50
else, set `is_easy_task` to False.
50
51
51
-
### Tool-calling SOP Abstraction
52
+
## Tool-calling SOP Abstraction
52
53
If the task is not an easy task, abstract a template SOP from complex task for a certain scenario, using 'submit_sop' tool:
53
54
- When generate `tool_sops`, use the exact tool_name from <agent_action>, and keep the most necessary and generalizable arguments in 'action'.
54
55
- `tool_sops` can be an empty list if the task itself is a easy task.
55
56
- If this task involves the same workflow repeated with different inputs, only retain the most concise SOP from a single iteration.
56
-
#### Templatized Tool Action
57
+
### Templatized Tool Action
57
58
- Template SOP must be the shortest possible too-calls to achieve the goal, remove all the redundancies.
58
59
- Template tool sops: remove those parameters that may vary in different user input in tool 'action', only keep the parameters that are critical to the sop case.
59
60
For example, if the sop is 'star a github repo',
60
61
then the detailed repo url should be removed because next time user may input a new repo url.
61
62
But use `click` tool to click a 'Star' button, this can keep in action because the 'Star' button is a universal step and unrelated to the user's input.
62
-
#### Preferences
63
-
- remove those preferences or infos that are may vary in different user input.
63
+
### Preferences
64
+
- remove those preferences or infos that are may vary in the future input.
65
+
- keep those preferences and infos that are critical to the future SOP execution.
66
+
67
+
## Find the conditions of the Current Task
68
+
- Current Task is only possible when bounded to certain conditions. For example:
69
+
- the sop is about starring a repo, the inferred conditions is agent is on github.com so that agent can star a repo, the use_when should be 'star a repo on github.com', not 'star a repo'.
70
+
- the sop is about querying by certain year, the inferred conditions is in private_lung_cancer table so that SQL query is only valid, the use_when should be 'query private_lung_cancer table by certain year', not 'query by certain year'.
71
+
- You must infer the conditions of the current task from the previous tasks context and working history.
72
+
- Conditions must be concrete: 'on github.com' is better than 'on code website', 'on private_lung_cancer MySQL table' is better than 'on a cancer table'.
73
+
- You must include the conditions in the SOP's `use_when` field: 'star a repo on github.com', 'query private_lung_cancer table by certain year'.
64
74
65
75
## Input Format
76
+
### Previous Task Context
77
+
This section contains the previous tasks progresses.
78
+
Make sure your understand the state of the current task (e.g. which website the agent is on, which db table the agent is querying, etc.)
66
79
### Task Description
67
80
What the task is and its purpose.
68
81
### User Preferences and Infos
69
-
User preferences and personal infos for this task.
82
+
User preferences and personal infos extracted from this task.
You must report your thinkings (using extrmaly brief wordings) first using the 'report_thinking' tool:
83
95
1. What's tools have been used?
84
-
2. Give your judgement on {rule_indices_str} and for each term, what's the scores?, then sum them and score the task complexity.
85
-
3. If it's an easy task, confirm you will set `is_easy_task` to True and only submit the `use_when` and `preferences` field and an empty `tool_sops list
86
-
4. How to reduce the tool-calls to build a shortest path to achieve the goal?
87
-
5. Which parameters/values are related to the future user input and should be removed in 'action' and 'preferences'?
88
-
6. Which parameters/values are necessary to make sure the SOP will have no more unexpected errors and back-and-forth retries?
89
-
7. In which general scenarios should we use this SOP? (3~5 words for `use_when`)
90
-
8. Any user preferences can help this general scenarios? (short sentenqces for `preferences`) If not, 'preferences' field should be empty string
96
+
2. Infer the necessary conditions for the Current Task can happened.
97
+
3. Give your judgement on {rule_indices_str} and for each term, what's the scores?, then sum them and score the task complexity.
98
+
4. If it's an easy task, confirm you will set `is_easy_task` to True and only submit and with an empty `tool_sops list
99
+
5. How to reduce the tool-calls to build a shortest path to achieve the goal?
100
+
6. Which parameters/values are related to the future user input and should be removed in 'action' and 'preferences'?
101
+
7. Which parameters/values are necessary to make sure the SOP will have no more unexpected errors and back-and-forth retries?
102
+
8. When and with which condidtions should we apply this SOP? (for `use_when`)?
103
+
9. Any user preferences to keep for future SOP execution? (for `preferences`) If not, 'preferences' field should be empty string
0 commit comments