Add reflection route to thinking.py

This commit is contained in:
2026-03-22 23:27:06 +00:00
parent 827b15653e
commit e1156d1ac8

View File

@@ -61,3 +61,11 @@ async def thought_chain_api(thought_id: str):
}
for t in chain
]
@router.post("/reflect", response_class=JSONResponse)
async def trigger_reflection():
"""Trigger a self-reflection cycle."""
reflection = await thinking_engine.reflect()
if not reflection:
return JSONResponse({"error": "Failed to generate reflection"}, status_code=500)
return {"status": "ok", "reflection": reflection}