fix(ui): show human labels on playground virtual key source select

Base UI SelectValue renders the raw value unless children supply the
label, so map session/custom to Current UI Session and Virtual Key
This commit is contained in:
mubashir1osmani 2026-08-06 15:02:48 -07:00
parent 65203b2920
commit 7ff6f26b93

View file

@ -857,7 +857,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
const requestProxyBaseUrl =
simplified && proxySettings
? proxySettings.LITELLM_UI_API_DOC_BASE_URL ?? proxySettings.PROXY_BASE_URL ?? undefined
? (proxySettings.LITELLM_UI_API_DOC_BASE_URL ?? proxySettings.PROXY_BASE_URL ?? undefined)
: customProxyBaseUrl || undefined;
await makeOpenAIChatCompletionRequest(
apiChatHistory,
@ -1205,7 +1205,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
}}
>
<SelectTrigger className="w-full" size="sm" aria-label="Virtual Key Source">
<SelectValue />
<SelectValue>{apiKeySource === "custom" ? "Virtual Key" : "Current UI Session"}</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="session">Current UI Session</SelectItem>
@ -1331,7 +1331,10 @@ const ChatUI: React.FC<ChatUIProps> = ({
}}
>
<SelectTrigger className="w-full" size="sm" aria-label="Voice">
<SelectValue />
<SelectValue>
{OPEN_AI_VOICE_SELECT_OPTIONS.find((voice) => voice.value === selectedVoice)?.label ??
selectedVoice}
</SelectValue>
</SelectTrigger>
<SelectContent>
{OPEN_AI_VOICE_SELECT_OPTIONS.map((voice) => (