Spaces:
Running
Running
Download extensions/python/system_prompt/_10_main_prompt.py from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/extensions/python/system_prompt/_10_main_prompt.py
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/extensions/python/system_prompt/_10_main_prompt.py
-
curl -L -o _10_main_prompt.py https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/extensions/python/system_prompt/_10_main_prompt.py
533 Bytes
| 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) | |
| async def build_prompt(agent: Agent) -> str: | |
| return agent.read_prompt("agent.system.main.md") | |