mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Add Azure AD Token field to Add Model Azure and make API Key not required (#16331)
This commit is contained in:
parent
ee50f09e73
commit
b5956e0595
3 changed files with 45 additions and 7 deletions
|
|
@ -62,4 +62,39 @@ describe("ProviderSpecificFields", () => {
|
|||
expect(apiKeyLabel).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("should render the provider specific fields for Azure", async () => {
|
||||
const { getByLabelText, getByPlaceholderText } = render(
|
||||
<Form>
|
||||
<ProviderSpecificFields selectedProvider={Providers.Azure} />
|
||||
</Form>,
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
// Check for API Base field
|
||||
const apiBaseInput = getByPlaceholderText("https://...");
|
||||
expect(apiBaseInput).toBeInTheDocument();
|
||||
expect(apiBaseInput).toHaveAttribute("type", "text");
|
||||
|
||||
// Check for API Version field
|
||||
const apiVersionInput = getByPlaceholderText("2023-07-01-preview");
|
||||
expect(apiVersionInput).toBeInTheDocument();
|
||||
|
||||
// Check for Base Model field
|
||||
const baseModelInput = getByPlaceholderText("azure/gpt-3.5-turbo");
|
||||
expect(baseModelInput).toBeInTheDocument();
|
||||
|
||||
// Check for API Key field
|
||||
const apiKeyInput = getByLabelText("Azure API Key");
|
||||
expect(apiKeyInput).toBeInTheDocument();
|
||||
expect(apiKeyInput).toHaveAttribute("type", "password");
|
||||
expect(apiKeyInput).toHaveAttribute("placeholder", "Enter your Azure API Key");
|
||||
|
||||
// Check for Azure AD Token field
|
||||
const azureAdTokenInput = getByLabelText("Azure AD Token");
|
||||
expect(azureAdTokenInput).toBeInTheDocument();
|
||||
expect(azureAdTokenInput).toHaveAttribute("type", "password");
|
||||
expect(azureAdTokenInput).toHaveAttribute("placeholder", "Enter your Azure AD Token");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,7 +164,15 @@ const PROVIDER_CREDENTIAL_FIELDS: Record<Providers, ProviderCredentialField[]> =
|
|||
key: "api_key",
|
||||
label: "Azure API Key",
|
||||
type: "password",
|
||||
required: true,
|
||||
placeholder: "Enter your Azure API Key",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
key: "azure_ad_token",
|
||||
label: "Azure AD Token",
|
||||
type: "password",
|
||||
placeholder: "Enter your Azure AD Token",
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
[Providers.Azure_AI_Studio]: [
|
||||
|
|
|
|||
|
|
@ -512,12 +512,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
|
|||
}}
|
||||
>
|
||||
<div>
|
||||
<Button
|
||||
style={{ width: "150px" }}
|
||||
onClick={() =>
|
||||
setIsAddSSOModalVisible(true)
|
||||
}
|
||||
>
|
||||
<Button style={{ width: "150px" }} onClick={() => setIsAddSSOModalVisible(true)}>
|
||||
{ssoConfigured ? "Edit SSO Settings" : "Add SSO"}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue