eroha-agentapi / engine /tasks /task_engine.py
Yermek68's picture
Add TaskEngine strategic planning layer
83f0cbe verified
raw
history blame contribute delete
787 Bytes
from engine.model import EngineModel
class TaskEngine:
"""
TaskEngine v1
-------------
- Strategic goal decomposition
- Structured execution planning
- Clean separation from API layer
"""
@staticmethod
async def execute_goal(goal: str) -> dict:
"""
Takes a high-level goal and returns a structured execution plan.
"""
planning_prompt = f"""
You are an advanced AI strategic planner.
Break down the following goal into:
1. Strategic Objective
2. Step-by-step Action Plan
3. Potential Risks
4. Success Criteria
Goal:
{goal}
Return clean, well-structured output.
"""
response = await EngineModel.generate(planning_prompt)
return {
"goal": goal,
"plan": response
}