Change placeholder for Azure in Add Model (#16597)

This commit is contained in:
yuneng-jiang 2025-11-18 20:13:48 -08:00 committed by GitHub
parent 2e007505da
commit ab8704f60d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 1 deletions

View file

@ -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();
});
});

View file

@ -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) {