ai-agent1 / AI_Agent /chains /task_decomposer_chain.py
curiouscurrent's picture
Create chains/task_decomposer_chain.py
104f157 verified
raw
history blame contribute delete
581 Bytes
# 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")}