Refactor the Action/Function components, and refactor the basic architecture of Agent Task/Todo.

This commit is contained in:
Liu Zhicong
2023-12-17 18:23:40 -08:00
parent 3d00095650
commit 29594c0319
41 changed files with 2687 additions and 1108 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
from typing import Optional
from aios.environment.environment import Environment
from aios.environment.sql_database_function import GetTableInfosFunction, ExecuteSqlFunction
from aios.ai_functions.sql_database_function import GetTableInfosFunction, ExecuteSqlFunction
class DBQuerierEnvironment(Environment):
+67 -2
View File
@@ -45,11 +45,76 @@ known_info_tips = """
tools_tips = """
"""
[behavior.review_task]
type="ReviewTaskProcess"
process_description="""
你得到的输入来自你自己之前记录在TaskList系统里的一个Task。现在你并不需要完成该Task,而是结合已知信息对Task进行一次Review.Review的过程是你独立完成的,你在形成结论的过程中可以使用工具,但不能和其它人交流。
1. 理性的思考如何一步一步的高效的,在潜在的截止时间前完成该Task。明确拒绝超出自己能力范围的Task。
2. 尝试对Task进行确认操作。确认操作的关键在于任务有了明确的执行时间。
3. 对于需要多个步骤才能完成的Task,对Task进行TODO Plan。尤其注意与相关人员确认的步骤
4. 对于不需要拆分TODO,且可立刻执行的任务。直接执行该任务。
"""
reply_format = """
The Response must be directly parsed by `python json.loads`. Here is an example:
{
think:'$think step-by-step to be sure you have the right answer.'
plans:[ #Optional
{"todo":"$todo_name","detail":"$todo_detail,"category":"$todo_category"}
...
],
tags: ['tag1', 'tag2'], #Optional,If the task involves important things and people, you can mark by 1-3 tags.
actions: [{
name: '$action_name',
$param_name: '$parm' #Optional, fill in only if the action has parameters.
}]
}
"""
# action_list: ['cancle','confirm', 'execute']
LLMContext.action_list = ['cancle','confirm', 'execute']
context="Your master now in {location}, time: {now}, weather: {weather}."
known_info_tips = """
"""
tools_tips = """
"""
[llm_context.actions]
enable = ["agent.memory.append_chatlog"]
[llm_context.functions]
enable = []
[behavior.do] # do TODO
type="DoTodoProcess"
process_description="""
1. TODOTODO$200
2. TODOTaskPlan
3. TODO使访ActionList
4. TODO
5. TODOTODOTODO
7. TODO
"""
reply_format = """
The Response must be directly parsed by `python json.loads`. Here is an example:
{
think:'我的思考.'
tags: ['tag1', 'tag2'], #Optional,If the TODO involves important things and people, you can mark by 1-3 tags.
actions: [{
name: '$action1_name',
$param_name: '$parm' #Optional, fill in only if the action has parameters.
}, ...
]
}
"""
#[behavior.self_thinking]
#[behavior.review_task]
#[behavior.do]
#[behavior.check]