| 484 | get<TraceRecord>(`/v1/traces/${encodeURIComponent(requestId)}`); |
| 485 | |
| 486 | export async function submitFeedback( |
| 487 | requestId: string, |
| 488 | signal: "ok" | "weak" | "strong", |
| 489 | ): Promise<FeedbackResult | null> { |
| 490 | try { |
| 491 | const res = await fetch("/v1/feedback", { |
| 492 | method: "POST", |
| 493 | headers: { "Content-Type": "application/json" }, |
| 494 | body: JSON.stringify({ request_id: requestId, signal }), |
| 495 | }); |
| 496 | const text = await res.text(); |
| 497 | if (!text) return null; |
| 498 | return JSON.parse(text) as FeedbackResult; |
| 499 | } catch { |
| 500 | return null; |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | export interface RoutePreviewResult { |
| 505 | tier: number; |