mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-10 20:29:42 +00:00
feat: add text editor plugin with file read, write, and patch capabilities
This commit is contained in:
parent
f7b7683918
commit
1d2425cce1
15 changed files with 633 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
from python.helpers.extension import Extension
|
||||
from python.helpers import plugins
|
||||
from agent import Agent, LoopData
|
||||
|
||||
|
||||
class TextEditorPrompt(Extension):
|
||||
|
||||
async def execute(
|
||||
self,
|
||||
system_prompt: list[str] = [],
|
||||
loop_data: LoopData = LoopData(),
|
||||
**kwargs,
|
||||
):
|
||||
config = plugins.get_plugin_config("text_editor", agent=self.agent) or {}
|
||||
default_line_count = config.get("default_line_count", 100)
|
||||
prompt = self.agent.read_prompt(
|
||||
"agent.system.tool.text_editor.md",
|
||||
default_line_count=default_line_count,
|
||||
)
|
||||
system_prompt.append(prompt)
|
||||
Loading…
Add table
Add a link
Reference in a new issue