From 8bff66168c2e350c4f3bfaf9caed5dabefc137b8 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sun, 26 May 2024 14:48:57 -0700 Subject: [PATCH] fix linting errors --- .../src/components/model_hub.tsx | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/ui/litellm-dashboard/src/components/model_hub.tsx b/ui/litellm-dashboard/src/components/model_hub.tsx index d08a45ba687..1ec1e9dd4d4 100644 --- a/ui/litellm-dashboard/src/components/model_hub.tsx +++ b/ui/litellm-dashboard/src/components/model_hub.tsx @@ -16,21 +16,27 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; interface ModelHubProps { - userID: string; - userRole: string; - token: string; - accessToken: string; - keys: any; // Replace with the appropriate type for 'keys' prop - premiumUser: boolean; } +interface ModelInfo { + model_group: string; + mode: string; + supports_function_calling: boolean; + supports_vision: boolean; + max_input_tokens?: number; + max_output_tokens?: number; + + // Add other properties if needed + + } + const ModelHub: React.FC = ({ @@ -49,22 +55,15 @@ const ModelHub: React.FC = ({ }) => { - - - const [modelHubData, setModelHubData] = useState(null); - + const [modelHubData, setModelHubData] = useState(null); const [isModalVisible, setIsModalVisible] = useState(false); - - const [selectedModel, setSelectedModel] = useState(null); - + const [selectedModel, setSelectedModel] = useState(null); useEffect(() => { if (!accessToken || !token || !userRole || !userID) { - return; - } @@ -95,7 +94,7 @@ const ModelHub: React.FC = ({ - const showModal = (model) => { + const showModal = (model: ModelInfo) => { setSelectedModel(model); @@ -125,7 +124,7 @@ const ModelHub: React.FC = ({ - const copyToClipboard = (text) => { + const copyToClipboard = (text: string) => { navigator.clipboard.writeText(text); @@ -163,7 +162,7 @@ const ModelHub: React.FC = ({
- {modelHubData && modelHubData.map((model: any) => ( + {modelHubData && modelHubData.map((model: ModelInfo) => (