mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Change placeholder for Azure in Add Model (#16597)
This commit is contained in:
parent
2e007505da
commit
ab8704f60d
2 changed files with 31 additions and 1 deletions
|
|
@ -0,0 +1,30 @@
|
|||
import { render } from "@testing-library/react";
|
||||
import { Form } from "antd";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getPlaceholder, Providers } from "../provider_info_helpers";
|
||||
import LiteLLMModelNameField from "./litellm_model_name";
|
||||
|
||||
describe("LitellmModelNameField", () => {
|
||||
it("should render", () => {
|
||||
const { getByText } = render(
|
||||
<Form>
|
||||
<LiteLLMModelNameField
|
||||
selectedProvider={Providers.OpenAI}
|
||||
providerModels={[]}
|
||||
getPlaceholder={getPlaceholder}
|
||||
/>
|
||||
</Form>,
|
||||
);
|
||||
expect(getByText("LiteLLM Model Name(s)")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should show Azure placeholder as 'my-deployment'", () => {
|
||||
const { getByPlaceholderText, queryByPlaceholderText } = render(
|
||||
<Form>
|
||||
<LiteLLMModelNameField selectedProvider={Providers.Azure} providerModels={[]} getPlaceholder={getPlaceholder} />
|
||||
</Form>,
|
||||
);
|
||||
expect(getByPlaceholderText("my-deployment")).toBeInTheDocument();
|
||||
expect(queryByPlaceholderText("gpt-3.5-turbo")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
@ -176,7 +176,7 @@ export const getPlaceholder = (selectedProvider: string): string => {
|
|||
} else if (selectedProvider == Providers.Azure_AI_Studio) {
|
||||
return "azure_ai/command-r-plus";
|
||||
} else if (selectedProvider == Providers.Azure) {
|
||||
return "azure/my-deployment";
|
||||
return "my-deployment";
|
||||
} else if (selectedProvider == Providers.Oracle) {
|
||||
return "oci/xai.grok-4";
|
||||
} else if (selectedProvider == Providers.Snowflake) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue