Add outbound agent response boundary
This commit is contained in:
25
app/main.py
25
app/main.py
@@ -128,6 +128,31 @@ async def test_message(session_id: str = Form(...), message: str = Form(...), us
|
||||
}
|
||||
|
||||
|
||||
@app.post("/admin/test-agent-response")
|
||||
async def test_agent_response(
|
||||
session_id: str = Form(...),
|
||||
message: str = Form(...),
|
||||
mode: str = Form("admin"),
|
||||
) -> dict:
|
||||
"""Send a test agent response through the outbound boundary."""
|
||||
if not orchestrator:
|
||||
raise HTTPException(status_code=503, detail="Orchestrator not initialized")
|
||||
|
||||
delivery = await orchestrator.emit_agent_response(
|
||||
session_id=session_id,
|
||||
message=message,
|
||||
mode=mode,
|
||||
)
|
||||
if not delivery.get("sent"):
|
||||
raise HTTPException(status_code=404, detail=delivery.get("reason", "send_failed"))
|
||||
|
||||
return {
|
||||
"status": "agent_response_emitted",
|
||||
"delivery": delivery,
|
||||
"timestamp": datetime.utcnow().isoformat(),
|
||||
}
|
||||
|
||||
|
||||
@app.get("/admin/ledger")
|
||||
async def get_ledger(session_id: str) -> dict:
|
||||
"""Get the markdown ledger for a session."""
|
||||
|
||||
Reference in New Issue
Block a user