[Fix] UI - Fixed Label for vLLM in Model Create Flow (#16285)

* Fixed Label for vLLM

* Make vLLM api key not required
This commit is contained in:
yuneng-jiang 2025-11-05 16:03:01 -08:00 committed by GitHub
parent 2541a54023
commit f1191578ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 4 deletions

View file

@ -44,4 +44,22 @@ describe("ProviderSpecificFields", () => {
expect(apiKeyLabel).toBeInTheDocument();
});
});
it("should render the provider specific fields for vLLM", async () => {
const { getByLabelText, getByPlaceholderText } = render(
<Form>
<ProviderSpecificFields selectedProvider={"Hosted_Vllm" as Providers} />
</Form>,
);
await waitFor(() => {
const apiBaseInput = getByPlaceholderText("https://...");
expect(apiBaseInput).toBeInTheDocument();
expect(apiBaseInput).toHaveAttribute("type", "text");
// Check for API Key field
const apiKeyLabel = getByLabelText("vLLM API Key");
expect(apiKeyLabel).toBeInTheDocument();
});
});
});

View file

@ -507,9 +507,9 @@ const PROVIDER_CREDENTIAL_FIELDS: Record<Providers, ProviderCredentialField[]> =
},
{
key: "api_key",
label: "OpenAI API Key",
label: "vLLM API Key",
type: "password",
required: true,
required: false,
},
],
[Providers.Voyage]: [
@ -581,7 +581,7 @@ const PROVIDER_CREDENTIAL_FIELDS: Record<Providers, ProviderCredentialField[]> =
label: "API Key",
type: "password",
required: true,
}
},
],
};

View file

@ -17,7 +17,7 @@ interface GenerateCodeParams {
selectedVectorStores: string[];
selectedGuardrails: string[];
selectedMCPTools: string[];
selectedVoice: string;
selectedVoice?: string;
endpointType: string;
selectedModel: string | undefined;
selectedSdk: "openai" | "azure";