Subset of the trace useful for the UI as a decision card.
(trace: "RequestTrace")
| 2533 | |
| 2534 | |
| 2535 | def _trace_decision_card(trace: "RequestTrace") -> dict[str, Any]: |
| 2536 | """Subset of the trace useful for the UI as a decision card.""" |
| 2537 | return { |
| 2538 | "model": trace.model, |
| 2539 | "decision_tier": trace.decision_tier or trace.tier, |
| 2540 | "served_quality": trace.served_quality, |
| 2541 | "capability_lane": trace.capability_lane, |
| 2542 | "raw_confidence": trace.raw_confidence, |
| 2543 | "latency_us": trace.latency_us, |
| 2544 | "estimated_cost": trace.estimated_cost, |
| 2545 | "route_reasoning": trace.route_reasoning, |
| 2546 | "feature_tags": list(trace.feature_tags or []), |
| 2547 | "constraint_tags": list(trace.constraint_tags or []), |
| 2548 | "hint_tags": list(trace.hint_tags or []), |
| 2549 | "transport": trace.transport, |
| 2550 | "transport_reason": trace.transport_reason, |
| 2551 | "attempts_payload": list(trace.attempts_payload or []), |
| 2552 | "fallback_reason": trace.fallback_reason, |
| 2553 | } |
| 2554 | |
| 2555 | |
| 2556 | def _assemble_conversation( |
no outgoing calls
no test coverage detected