mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Add test connection
This commit is contained in:
parent
6742d3cb10
commit
9be24adaca
2 changed files with 15 additions and 1 deletions
|
|
@ -9,6 +9,8 @@ import AdvancedSettings from "./advanced_settings";
|
|||
import { Providers, providerLogoMap, getPlaceholder } from "../provider_info_helpers";
|
||||
import type { Team } from "../key_team_helpers/key_list";
|
||||
import { CredentialItem } from "../networking";
|
||||
import { testModelConnection } from "./handle_add_model_submit";
|
||||
|
||||
interface AddModelTabProps {
|
||||
form: FormInstance;
|
||||
handleOk: () => void;
|
||||
|
|
@ -22,6 +24,7 @@ interface AddModelTabProps {
|
|||
setShowAdvancedSettings: (show: boolean) => void;
|
||||
teams: Team[] | null;
|
||||
credentials: CredentialItem[];
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
const { Title, Link } = Typography;
|
||||
|
|
@ -39,7 +42,14 @@ const AddModelTab: React.FC<AddModelTabProps> = ({
|
|||
setShowAdvancedSettings,
|
||||
teams,
|
||||
credentials,
|
||||
accessToken,
|
||||
}) => {
|
||||
// Add a function to handle test connection
|
||||
const handleTestConnection = async () => {
|
||||
const formValues = form.getFieldsValue();
|
||||
await testModelConnection(formValues, accessToken);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title level={2}>Add new model</Title>
|
||||
|
|
@ -184,7 +194,10 @@ const AddModelTab: React.FC<AddModelTabProps> = ({
|
|||
Need Help?
|
||||
</Typography.Link>
|
||||
</Tooltip>
|
||||
<Button htmlType="submit">Add Model</Button>
|
||||
<div className="space-x-2">
|
||||
<Button onClick={handleTestConnection}>Test Connect</Button>
|
||||
<Button htmlType="submit">Add Model</Button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -1140,6 +1140,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
|||
setShowAdvancedSettings={setShowAdvancedSettings}
|
||||
teams={teams}
|
||||
credentials={credentialsList}
|
||||
accessToken={accessToken}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue