mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
feat(ui_sso.py): Allows users to use test key pane, and have team budget limits be enforced for their use-case (#7666)
This commit is contained in:
parent
6df8faf15f
commit
63926f484c
5 changed files with 47 additions and 2 deletions
|
@ -35,6 +35,7 @@ interface ChatUIProps {
|
|||
token: string | null;
|
||||
userRole: string | null;
|
||||
userID: string | null;
|
||||
disabledPersonalKeyCreation: boolean;
|
||||
}
|
||||
|
||||
async function generateModelResponse(
|
||||
|
@ -81,8 +82,11 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
token,
|
||||
userRole,
|
||||
userID,
|
||||
disabledPersonalKeyCreation,
|
||||
}) => {
|
||||
const [apiKeySource, setApiKeySource] = useState<'session' | 'custom'>('session');
|
||||
const [apiKeySource, setApiKeySource] = useState<'session' | 'custom'>(
|
||||
disabledPersonalKeyCreation ? 'custom' : 'session'
|
||||
);
|
||||
const [apiKey, setApiKey] = useState("");
|
||||
const [inputMessage, setInputMessage] = useState("");
|
||||
const [chatHistory, setChatHistory] = useState<{ role: string; content: string; model?: string }[]>([]);
|
||||
|
@ -240,6 +244,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
<Col>
|
||||
<Text>API Key Source</Text>
|
||||
<Select
|
||||
disabled={disabledPersonalKeyCreation}
|
||||
defaultValue="session"
|
||||
style={{ width: "100%" }}
|
||||
onChange={(value) => setApiKeySource(value as "session" | "custom")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue