| 33 | |
| 34 | @dataclass |
| 35 | class RequestTrace: |
| 36 | timestamp: float |
| 37 | request_id: str |
| 38 | model: str |
| 39 | status_code: int |
| 40 | requested_model: str = "" |
| 41 | mode: str = "" |
| 42 | tier: str = "" |
| 43 | decision_tier: str = "" |
| 44 | served_quality: str = "" |
| 45 | served_quality_target: str = "" |
| 46 | served_quality_floor: str = "" |
| 47 | capability_lane: str = "" |
| 48 | method: str = "" |
| 49 | api_format: str = "openai" |
| 50 | endpoint: str = "chat_completions" |
| 51 | is_virtual: bool = False |
| 52 | session_id: str | None = None |
| 53 | streaming: bool = False |
| 54 | prompt_preview: str = "" |
| 55 | prompt_hash: str = "" |
| 56 | step_type: str = "general" |
| 57 | route_reasoning: str = "" |
| 58 | confidence: float = 0.0 |
| 59 | raw_confidence: float = 0.0 |
| 60 | confidence_source: str = "" |
| 61 | calibration_version: str = "" |
| 62 | calibration_sample_count: int = 0 |
| 63 | calibration_temperature: float = 1.0 |
| 64 | calibration_applied_tags: list[str] | tuple[str, ...] | None = None |
| 65 | complexity: float = 0.33 |
| 66 | estimated_cost: float = 0.0 |
| 67 | baseline_cost: float = 0.0 |
| 68 | actual_cost: float | None = None |
| 69 | savings: float = 0.0 |
| 70 | latency_us: float = 0.0 |
| 71 | usage_input_tokens: int = 0 |
| 72 | usage_output_tokens: int = 0 |
| 73 | cache_read_input_tokens: int = 0 |
| 74 | cache_write_input_tokens: int = 0 |
| 75 | cache_hit_ratio: float = 0.0 |
| 76 | transport: str = "openai-chat" |
| 77 | requested_transport: str = "" |
| 78 | transport_reason: str = "" |
| 79 | transport_preference_source: str = "" |
| 80 | cache_mode: str = "none" |
| 81 | cache_family: str = "generic" |
| 82 | cache_breakpoints: int = 0 |
| 83 | input_tokens_before: int = 0 |
| 84 | input_tokens_after: int = 0 |
| 85 | artifacts_created: int = 0 |
| 86 | compacted_messages: int = 0 |
| 87 | semantic_summaries: int = 0 |
| 88 | semantic_calls: int = 0 |
| 89 | semantic_failures: int = 0 |
| 90 | semantic_quality_fallbacks: int = 0 |
| 91 | checkpoint_created: bool = False |
| 92 | rehydrated_artifacts: int = 0 |
no outgoing calls