Development environment setup - #22160
Conversation
- Create RealtimePrettyView component that renders structured session config, conversation turns with transcripts, and token breakdowns - Update PrettyMessagesView to detect realtime responses (via isRealtimeResponse helper) and delegate to the new component - Session card shows model, voice, modalities, temperature, instructions in a collapsible panel - Conversation turns show status, per-turn token usage, and audio/text transcripts with appropriate icons - Add 24 tests for RealtimePrettyView and 3 tests for PrettyMessagesView - All 75 LogDetailsDrawer tests pass Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
…ut header - Add purple 'N turns' tag to Session card header for at-a-glance turn count - Add 'Turns: N' to the Output section header next to tokens/cost - Extend SectionHeader to accept optional turnCount prop - Add 3 new tests for turn count display (singular, plural, output header) Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Greptile SummaryThis PR adds a "Pretty View" for OpenAI Realtime API logs in the LiteLLM dashboard, rendering structured session configuration, conversation turns, and token usage instead of raw JSON.
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.tsx | New component for rendering realtime API logs. Has a mismatch between event types detected by isRealtimeResponse() and those actually rendered, which can cause fallback display for valid realtime responses. |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.tsx | Clean integration — detects realtime responses early and delegates to the new specialized view. The routing correctness depends on isRealtimeResponse being accurate. |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx | Minimal change adding an optional turnCount prop displayed in the header. Clean and backwards-compatible. |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.test.tsx | Comprehensive test suite covering rendering, interactions, edge cases, and token display. Follows AGENTS.md testing conventions well. |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.test.tsx | Good integration tests verifying routing between standard and realtime views. Tests follow project conventions. |
| ui/litellm-dashboard/package-lock.json | Lock file changes removing dev: true flags from some dependencies. Auto-generated, no functional risk. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PrettyMessagesView] -->|response| B{isRealtimeResponse?}
B -->|true| C[RealtimePrettyView]
B -->|false| D[Standard InputCard + OutputCard]
C --> E{Parse events}
E -->|session.created / session.updated| F[SessionCard]
E -->|response.done| G[ConversationCard]
E -->|No matching events| H["Fallback: No recognized events"]
G --> I[ResponseTurn per response]
I --> J[OutputMessage with transcripts]
I --> K[TokenBreakdown details]
F --> L[ConfigRow grid + Instructions]
Last reviewed commit: 1f0cb47
| export function isRealtimeResponse(response: any): boolean { | ||
| if (!response || !response.results || !Array.isArray(response.results) || response.results.length === 0) { | ||
| return false; | ||
| } | ||
|
|
||
| return response.results.some( | ||
| (r: any) => | ||
| r.type === 'session.created' || | ||
| r.type === 'session.updated' || | ||
| r.type === 'response.done' || | ||
| r.type === 'response.audio.done' || | ||
| r.type === 'conversation.item.created' | ||
| ); | ||
| } |
There was a problem hiding this comment.
Detection/rendering event type mismatch
isRealtimeResponse() recognizes five event types (session.created, session.updated, response.done, response.audio.done, conversation.item.created), but RealtimePrettyView only renders session.created/session.updated and response.done. If a realtime response contains only response.audio.done or conversation.item.created events, isRealtimeResponse returns true and PrettyMessagesView routes to this component, but it will display "No recognized realtime events found" instead of the standard chat view.
Either the detection function should only match event types that the view actually handles, or the view should handle all the detected types.
| export function isRealtimeResponse(response: any): boolean { | |
| if (!response || !response.results || !Array.isArray(response.results) || response.results.length === 0) { | |
| return false; | |
| } | |
| return response.results.some( | |
| (r: any) => | |
| r.type === 'session.created' || | |
| r.type === 'session.updated' || | |
| r.type === 'response.done' || | |
| r.type === 'response.audio.done' || | |
| r.type === 'conversation.item.created' | |
| ); | |
| } | |
| export function isRealtimeResponse(response: any): boolean { | |
| if (!response || !response.results || !Array.isArray(response.results) || response.results.length === 0) { | |
| return false; | |
| } | |
| return response.results.some( | |
| (r: any) => | |
| r.type === 'session.created' || | |
| r.type === 'session.updated' || | |
| r.type === 'response.done' | |
| ); | |
| } |
| return ( | ||
| <div | ||
| style={{ | ||
| marginBottom: index >= 0 ? 12 : 0, |
There was a problem hiding this comment.
Always-true condition in ternary
index >= 0 is always true since array .map() indices start at 0, making the : 0 branch unreachable dead code. If the intent was to skip margin on the last item, this should compare against the total count. As-is, it's equivalent to just marginBottom: 12.
| marginBottom: index >= 0 ? 12 : 0, | |
| marginBottom: 12, |
- Remove response.audio.done and conversation.item.created from isRealtimeResponse() detection since the view doesn't render them; prevents misleading fallback for responses with only those events - Remove dead code: index >= 0 is always true in .map() callback Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
* feat: add pretty view for realtime API logs in dashboard - Create RealtimePrettyView component that renders structured session config, conversation turns with transcripts, and token breakdowns - Update PrettyMessagesView to detect realtime responses (via isRealtimeResponse helper) and delegate to the new component - Session card shows model, voice, modalities, temperature, instructions in a collapsible panel - Conversation turns show status, per-turn token usage, and audio/text transcripts with appropriate icons - Add 24 tests for RealtimePrettyView and 3 tests for PrettyMessagesView - All 75 LogDetailsDrawer tests pass Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * chore: remove dev_config.yaml from tracked files Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * feat: show turn count in realtime pretty view session header and output header - Add purple 'N turns' tag to Session card header for at-a-glance turn count - Add 'Turns: N' to the Output section header next to tokens/cost - Extend SectionHeader to accept optional turnCount prop - Add 3 new tests for turn count display (singular, plural, output header) Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * fix: address Greptile review feedback - Remove response.audio.done and conversation.item.created from isRealtimeResponse() detection since the view doesn't render them; prevents misleading fallback for responses with only those events - Remove dead code: index >= 0 is always true in .map() callback Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
* feat: add pretty view for realtime API logs in dashboard - Create RealtimePrettyView component that renders structured session config, conversation turns with transcripts, and token breakdowns - Update PrettyMessagesView to detect realtime responses (via isRealtimeResponse helper) and delegate to the new component - Session card shows model, voice, modalities, temperature, instructions in a collapsible panel - Conversation turns show status, per-turn token usage, and audio/text transcripts with appropriate icons - Add 24 tests for RealtimePrettyView and 3 tests for PrettyMessagesView - All 75 LogDetailsDrawer tests pass Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * chore: remove dev_config.yaml from tracked files Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * feat: show turn count in realtime pretty view session header and output header - Add purple 'N turns' tag to Session card header for at-a-glance turn count - Add 'Turns: N' to the Output section header next to tokens/cost - Extend SectionHeader to accept optional turnCount prop - Add 3 new tests for turn count display (singular, plural, output header) Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> * fix: address Greptile review feedback - Remove response.audio.done and conversation.item.created from isRealtimeResponse() detection since the view doesn't render them; prevents misleading fallback for responses with only those events - Remove dead code: index >= 0 is always true in .map() callback Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
[Feat] Realtime API show logs / session runs
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
✅ Test
Changes
This PR introduces a "Pretty View" for realtime API logs within the LiteLLM dashboard, improving readability over the raw JSON display.
RealtimePrettyViewcomponent: Renders structured information for realtime logs, including session configuration (model, voice, modalities, temperature, instructions) and conversation turns (status, transcripts, detailed token breakdowns for text, audio, image, and cached tokens).isRealtimeResponse()helper function to identify realtime API responses based on specific event types (session.created,response.done) in theresultsarray.PrettyMessagesView: The existingPrettyMessagesViewnow automatically detects realtime responses and delegates rendering to the newRealtimePrettyViewcomponent.RealtimePrettyViewand 3 forPrettyMessagesView) to ensure correct rendering, interaction, collapse behavior, token display, and edge case handling.