forked from agentdafler007/Jarvis35
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubordinate_agent.py
23 lines (20 loc) · 919 Bytes
/
subordinate_agent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from .base_agent import BaseAgent
from models.language_model import LanguageModel
class SubordinateAgent(BaseAgent):
def __init__(self, name: str, model_path: str, tools_dir: str, agent_type: str):
super().__init__(name)
self.model = LanguageModel(model_path)
self.tools_dir = tools_dir
self.agent_type = agent_type
async def perform_task(self, task_description: str) -> str:
self.log(f"Starting task: {task_description}")
result = await self.model.process(task_description)
self.log(f"Task result: {result}")
return result
async def specialize(self):
if self.agent_type == "code":
await self.model.fine_tune_for_coding()
elif self.agent_type == "research":
await self.model.fine_tune_for_research()
elif self.agent_type == "creative":
await self.model.fine_tune_for_creativity()