Add reflection route to thinking.py
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user