mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
[Feat] LiteLLM Tag/Policy Management (#9813)
* rendering tags on UI * use /models for building tags * CRUD endpoints for Tag management * fix tag management * working api for LIST tags * working tag management * refactor UI components * fixes ui tag management * clean up ui tag management * fix tag management ui * fix show allowed llms * e2e tag controls * stash change for rendering tags on UI * ui working tag selector on Test Key page * fixes for tag management * clean up tag info * fix code quality * test for tag management * ui clarify what tag routing is
This commit is contained in:
parent
ac9f03beae
commit
ff3a6830a4
16 changed files with 1595 additions and 9 deletions
|
@ -31,6 +31,7 @@ import { litellmModeMapping, ModelMode, EndpointType, getEndpointType } from "./
|
|||
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import { coy } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
||||
import EndpointSelector from "./chat_ui/EndpointSelector";
|
||||
import TagSelector from "./tag_management/TagSelector";
|
||||
import { determineEndpointType } from "./chat_ui/EndpointUtils";
|
||||
import {
|
||||
SendOutlined,
|
||||
|
@ -40,7 +41,8 @@ import {
|
|||
RobotOutlined,
|
||||
UserOutlined,
|
||||
DeleteOutlined,
|
||||
LoadingOutlined
|
||||
LoadingOutlined,
|
||||
TagsOutlined
|
||||
} from "@ant-design/icons";
|
||||
|
||||
interface ChatUIProps {
|
||||
|
@ -73,6 +75,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
const [endpointType, setEndpointType] = useState<string>(EndpointType.CHAT);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const abortControllerRef = useRef<AbortController | null>(null);
|
||||
const [selectedTags, setSelectedTags] = useState<string[]>([]);
|
||||
|
||||
const chatEndRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
|
@ -202,6 +205,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
(chunk, model) => updateTextUI("assistant", chunk, model),
|
||||
selectedModel,
|
||||
effectiveApiKey,
|
||||
selectedTags,
|
||||
signal
|
||||
);
|
||||
} else if (endpointType === EndpointType.IMAGE) {
|
||||
|
@ -211,6 +215,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
(imageUrl, model) => updateImageUI(imageUrl, model),
|
||||
selectedModel,
|
||||
effectiveApiKey,
|
||||
selectedTags,
|
||||
signal
|
||||
);
|
||||
}
|
||||
|
@ -343,6 +348,18 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
endpointType={endpointType}
|
||||
onEndpointChange={handleEndpointChange}
|
||||
className="mb-4"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Text className="font-medium block mb-2 text-gray-700 flex items-center">
|
||||
<TagsOutlined className="mr-2" /> Tags
|
||||
</Text>
|
||||
<TagSelector
|
||||
value={selectedTags}
|
||||
onChange={setSelectedTags}
|
||||
className="mb-4"
|
||||
accessToken={accessToken || ""}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue