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