Spaces:
Paused
Paused
Download python/tools/call_subordinate.py from OnyxMunk/GravityFalls: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/OnyxMunk/GravityFalls/resolve/c425c4043529634171dcfbb3aa5a94de613d28a8/python/tools/call_subordinate.py
- Command line
-
hf download hf://spaces/OnyxMunk/GravityFalls@c425c4043529634171dcfbb3aa5a94de613d28a8/python/tools/call_subordinate.py
-
curl -L -o call_subordinate.py https://huggingface.co/spaces/OnyxMunk/GravityFalls/resolve/c425c4043529634171dcfbb3aa5a94de613d28a8/python/tools/call_subordinate.py
786 Bytes
| from agent import Agent | |
| from python.helpers.tool import Tool, Response | |
| from python.helpers import files | |
| from python.helpers.print_style import PrintStyle | |
| class Delegation(Tool): | |
| def execute(self, message="", reset="", **kwargs): | |
| # create subordinate agent using the data object on this agent and set superior agent to his data object | |
| if self.agent.get_data("subordinate") is None or str(reset).lower().strip() == "true": | |
| subordinate = Agent(self.agent.number+1, self.agent.config) | |
| subordinate.set_data("superior", self.agent) | |
| self.agent.set_data("subordinate", subordinate) | |
| # run subordinate agent message loop | |
| return Response( message=self.agent.get_data("subordinate").message_loop(message), break_loop=False) |