Spaces:
Runtime error
Runtime error
Download src/backend/models/trace.py from HAK-Tech/ciro-backend: direct link, hf CLI and curl.
- Browser
- Download file 909 Bytes
-
https://huggingface.co/spaces/HAK-Tech/ciro-backend/resolve/main/src/backend/models/trace.py
- Command line
-
hf download hf://spaces/HAK-Tech/ciro-backend/src/backend/models/trace.py
-
curl -L -o trace.py https://huggingface.co/spaces/HAK-Tech/ciro-backend/resolve/main/src/backend/models/trace.py
909 Bytes
| """ | |
| Agent trace schemas — Phase 13. | |
| AgentTrace is the complete pipeline reasoning record for a single crisis event. | |
| Persisted to Firestore agent_logs and served via GET /api/crisis/{id}/trace, | |
| which powers the in-app reasoning timeline on AgentTraceScreen. | |
| """ | |
| from __future__ import annotations | |
| from datetime import datetime, timezone | |
| from typing import Literal | |
| from pydantic import BaseModel, Field | |
| class AgentTraceStep(BaseModel): | |
| step_number: int | |
| agent_name: str | |
| action: str | |
| reasoning: str | |
| confidence: float | None | |
| output_summary: str | |
| timestamp: datetime | |
| FinalOutcome = Literal["responded", "denied", "inconclusive", "low_risk_auto"] | |
| class AgentTrace(BaseModel): | |
| crisis_id: str | |
| steps: list[AgentTraceStep] | |
| total_duration_seconds: float | |
| final_outcome: FinalOutcome | |
| created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc)) | |