diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx index 3e165c7065c..df04eece289 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx @@ -1832,6 +1832,7 @@ const ChatUI: React.FC = ({ accessToken={apiKeySource === "session" ? accessToken || "" : apiKey} selectedModel={selectedModel || ""} customProxyBaseUrl={customProxyBaseUrl || undefined} + selectedGuardrails={selectedGuardrails.length > 0 ? selectedGuardrails : undefined} /> ) : ( <> diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/RealtimePlayground.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/RealtimePlayground.tsx index 87305385bc8..a3dd864b894 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/RealtimePlayground.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/RealtimePlayground.tsx @@ -24,12 +24,14 @@ interface RealtimePlaygroundProps { accessToken: string; selectedModel: string; customProxyBaseUrl?: string; + selectedGuardrails?: string[]; } const RealtimePlayground: React.FC = ({ accessToken, selectedModel, customProxyBaseUrl, + selectedGuardrails, }) => { const [messages, setMessages] = useState([]); const [inputText, setInputText] = useState(""); @@ -107,7 +109,10 @@ const RealtimePlayground: React.FC = ({ const baseUrl = customProxyBaseUrl || getProxyBaseUrl(); const wsBase = baseUrl.replace(/^http/, "ws"); - const url = `${wsBase}/v1/realtime?model=${encodeURIComponent(selectedModel)}`; + let url = `${wsBase}/v1/realtime?model=${encodeURIComponent(selectedModel)}`; + if (selectedGuardrails && selectedGuardrails.length > 0) { + url += `&guardrails=${encodeURIComponent(selectedGuardrails.join(","))}`; + } const ws = new WebSocket(url, ["realtime", `openai-insecure-api-key.${accessToken}`]); @@ -197,7 +202,7 @@ const RealtimePlayground: React.FC = ({ addMessage("status", `Connection failed: ${err.message}`); setIsConnecting(false); } - }, [accessToken, selectedModel, selectedVoice, customProxyBaseUrl, addMessage, appendAssistantText, playAudioChunk]); + }, [accessToken, selectedModel, selectedVoice, customProxyBaseUrl, selectedGuardrails, addMessage, appendAssistantText, playAudioChunk]); const disconnect = useCallback(() => { stopRecording();