File size: 581 Bytes
104f157
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# AI_Agent/chains/task_decomposer_chain.py
class TaskDecomposerChain:
    def __init__(self, llm_adapter):
        self.llm = llm_adapter

    async def run(self, brief: str):
        prompt = (
            "You are a software project analyst. "
            "Given the following project brief, break it into clear, actionable technical tasks.\n\n"
            f"Project Brief: {brief}\n\n"
            "Return a numbered list of tasks."
        )
        out = await self.llm.generate(prompt, max_tokens=300)
        return {"tasks_text": out["text"], "tasks_raw": out.get("raw")}