mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 15:31:08 +00:00
skills cleanup, minor fixes
removed frameworks standardized directories cleanup of prompt injection fix of chat reset
This commit is contained in:
parent
f9545bf860
commit
724e06ae9d
22 changed files with 82 additions and 141 deletions
|
|
@ -3,7 +3,7 @@ from python.helpers.extension import Extension
|
|||
from python.helpers.mcp_handler import MCPConfig
|
||||
from agent import Agent, LoopData
|
||||
from python.helpers.settings import get_settings
|
||||
from python.helpers import projects
|
||||
from python.helpers import projects, skills
|
||||
|
||||
|
||||
class SystemPrompt(Extension):
|
||||
|
|
@ -18,6 +18,7 @@ class SystemPrompt(Extension):
|
|||
main = get_main_prompt(self.agent)
|
||||
tools = get_tools_prompt(self.agent)
|
||||
mcp_tools = get_mcp_tools_prompt(self.agent)
|
||||
skills = get_skills_prompt(self.agent)
|
||||
secrets_prompt = get_secrets_prompt(self.agent)
|
||||
project_prompt = get_project_prompt(self.agent)
|
||||
|
||||
|
|
@ -25,11 +26,13 @@ class SystemPrompt(Extension):
|
|||
system_prompt.append(tools)
|
||||
if mcp_tools:
|
||||
system_prompt.append(mcp_tools)
|
||||
if skills:
|
||||
system_prompt.append(skills)
|
||||
if secrets_prompt:
|
||||
system_prompt.append(secrets_prompt)
|
||||
if project_prompt:
|
||||
system_prompt.append(project_prompt)
|
||||
|
||||
|
||||
|
||||
def get_main_prompt(agent: Agent):
|
||||
return agent.read_prompt("agent.system.main.md")
|
||||
|
|
@ -81,4 +84,13 @@ def get_project_prompt(agent: Agent):
|
|||
result += "\n\n" + agent.read_prompt("agent.system.projects.inactive.md")
|
||||
return result
|
||||
|
||||
def get_skills_prompt(agent: Agent):
|
||||
available = skills.list_skills(agent)
|
||||
result = []
|
||||
for skill in available:
|
||||
name = skill.name.strip().replace("\n", " ")[:100]
|
||||
descr = skill.description.replace("\n", " ")[:500]
|
||||
result.append(f"**{name}** {descr}")
|
||||
|
||||
if result:
|
||||
return agent.read_prompt("agent.system.skills.md", skills="\n".join(result))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue