| 1 | from typing import Any |
| 2 | |
| 3 | from helpers.extension import Extension, extensible |
| 4 | from agent import Agent, LoopData |
| 5 | |
| 6 | |
| 7 | class MainPrompt(Extension): |
| 8 | |
| 9 | async def execute( |
| 10 | self, |
| 11 | system_prompt: list[str] = [], |
| 12 | loop_data: LoopData = LoopData(), |
| 13 | **kwargs: Any, |
| 14 | ): |
| 15 | if not self.agent: |
| 16 | return |
| 17 | prompt = await build_prompt(self.agent) |
| 18 | system_prompt.append(prompt) |
| 19 | |
| 20 | |
| 21 | @extensible |
| 22 | async def build_prompt(agent: Agent) -> str: |
| 23 | return agent.read_prompt("agent.system.main.md") |