mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-02 13:40:35 +00:00
v0.7 testing
Testing batch for v0.7 - extensions framework - auto memory - solutions memory - memory threshold fix, filters, areas - tools prompts split - ui updates
This commit is contained in:
parent
d233e0c94f
commit
e209a0c213
44 changed files with 1205 additions and 920 deletions
|
|
@ -0,0 +1,23 @@
|
|||
from python.helpers.extension import Extension
|
||||
from agent import Agent, LoopData
|
||||
|
||||
|
||||
class RecallMemories(Extension):
|
||||
|
||||
INTERVAL = 3
|
||||
HISTORY = 5
|
||||
RESULTS = 3
|
||||
THRESHOLD = 0.1
|
||||
|
||||
async def execute(self, loop_data: LoopData = LoopData(), **kwargs):
|
||||
# collect and concatenate tool instructions
|
||||
sys = concat_tool_prompts(self.agent)
|
||||
# append to system message
|
||||
loop_data.system.append(sys)
|
||||
|
||||
|
||||
def concat_tool_prompts(agent: Agent):
|
||||
tools = agent.read_prompts("agent.system.tool.*.md")
|
||||
tools = "\n\n".join(tools)
|
||||
sys = agent.read_prompt("agent.system.tools.md", tools=tools)
|
||||
return sys
|
||||
Loading…
Add table
Add a link
Reference in a new issue