fix: verbose logic & insight wording & file_read anchor skip
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
Facts(L2): ../memory/global_mem.txt | Code: ../ | SOPs(L3): ../memory/*.md or *.py | META-SOP(L0): ../memory/memory_management_sop.md
|
||||
Insight是极简索引,L2/L3变更时同步Insight,索引必须极简。写记忆前先读META-SOP(L0)。
|
||||
L1 Insight是极简索引,L2/L3变更时同步L1,索引必须极简。写记忆前先读META-SOP(L0)。
|
||||
|
||||
[CONSTITUTION]
|
||||
1. 改自身源码先请示;./内可自主实验,允许装包和portable工具
|
||||
2. 决策前查记忆库;未查证不断言
|
||||
2. 决策前查记忆,有SOP/utils必用;多次失败回看SOP;未查证不断言
|
||||
3. 分步执行,控制粒度,限制失败半径;3次失败请求干预
|
||||
4. 密钥文件仅引用,不读取/移动
|
||||
5. 写任何记忆前读META-SOP核验,memory下文件只能patch修改(除非新建)
|
||||
|
||||
7
ga.py
7
ga.py
@@ -413,7 +413,7 @@ class GenericAgentHandler(BaseHandler):
|
||||
result = tips + result
|
||||
if ' ... [TRUNCATED]' in result: result += '\n\n(某些行被截断,如需完整内容可改用 code_run 读取)'
|
||||
result = smart_format(result, max_str_len=20000, omit_str='\n\n[omitted long content]\n\n')
|
||||
next_prompt = self._get_anchor_prompt()
|
||||
next_prompt = self._get_anchor_prompt(skip=args.get('_index', 0) > 0)
|
||||
log_memory_access(path)
|
||||
if 'memory' in path or 'sop' in path:
|
||||
next_prompt += "\n[SYSTEM TIPS] 正在读取记忆或SOP文件,若决定按sop执行请提取sop中的关键点(特别是靠后的)update working memory."
|
||||
@@ -493,8 +493,9 @@ class GenericAgentHandler(BaseHandler):
|
||||
prompt += f"\nCurrent turn: {self.current_turn}\n"
|
||||
if self.working.get('key_info'): prompt += f"\n<key_info>{self.working.get('key_info')}</key_info>"
|
||||
if self.working.get('related_sop'): prompt += f"\n有不清晰的地方请再次读取{self.working.get('related_sop')}"
|
||||
try: print(prompt)
|
||||
except: pass
|
||||
if getattr(self.parent, 'verbose', False):
|
||||
try: print(prompt)
|
||||
except: pass
|
||||
return prompt
|
||||
|
||||
def next_prompt_patcher(self, next_prompt, outcome, turn):
|
||||
|
||||
Reference in New Issue
Block a user