curiouscurrent commited on
Commit
a0b95f0
·
verified ·
1 Parent(s): e66e1ef

Create task_assigner_chain.py

Browse files
AI_Agent/chains/task_assigner_chain.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AI_Agent/chains/task_assigner_chain.py
2
+ class TaskAssignerChain:
3
+ """
4
+ Assign each task to either Frontend or Backend.
5
+ """
6
+ def __init__(self, llm_adapter):
7
+ self.llm = llm_adapter
8
+
9
+ async def run(self, tasks_text: str):
10
+ prompt = (
11
+ "You are a project manager AI. Given a numbered list of technical tasks, "
12
+ "assign each task to either the Frontend or Backend team. "
13
+ "Return the results as a numbered list in the format: '1. Task description -> Frontend/Backend'.\n\n"
14
+ f"Tasks:\n{tasks_text}"
15
+ )
16
+ out = await self.llm.generate(prompt, max_tokens=300)
17
+ return {"assigned_tasks_text": out["text"], "assigned_tasks_raw": out.get("raw")}