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 7785796121
commit e72add6882

View file

@ -887,7 +887,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,
@ -1235,7 +1235,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>
@ -1342,7 +1342,10 @@ const ChatUI: React.FC<ChatUIProps> = ({
</label>
<ShadcnSelect value={selectedVoice} onValueChange={handleVoiceChange}>
<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) => (