This commit is contained in:
Jim Aldon D'Souza 2026-09-27 16:13:04 -04:00 • committed by GitHub
commit 2fe14008f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 1 deletions

View file

@ -3105,6 +3105,34 @@
],
"default_model_placeholder": "soniox/stt-async-v5"
},
{
"provider": "Tencent",
"provider_display_name": "Tencent",
"litellm_provider": "tencent",
"credential_fields": [
{
"key": "api_base",
"label": "API Base",
"placeholder": "https://tokenhub-intl.tencentcloudmaas.com/v1",
"tooltip": null,
"required": false,
"field_type": "text",
"options": null,
"default_value": null
},
{
"key": "api_key",
"label": "API Key",
"placeholder": null,
"tooltip": null,
"required": true,
"field_type": "password",
"options": null,
"default_value": null
}
],
"default_model_placeholder": "tencent/deepseek-v4-pro"
},
{
"provider": "TEXT_COMPLETION_CODESTRAL",
"provider_display_name": "Text-Completion-Codestral",

View file

@ -377,6 +377,31 @@ def test_chatgpt_provider_fields():
assert chatgpt["credential_fields"] == []
def test_tencent_provider_fields():
app_instance = FastAPI()
app_instance.include_router(router)
test_client = TestClient(app_instance)
response = test_client.get("/public/providers/fields")
assert response.status_code == 200
providers = response.json()
tencent = next((p for p in providers if p["provider"] == "Tencent"), None)
assert tencent is not None, "Tencent provider entry not found"
assert tencent["provider_display_name"] == "Tencent"
assert tencent["litellm_provider"] == LlmProviders.TENCENT.value
assert tencent["default_model_placeholder"].startswith("tencent/")
fields_by_key = {f["key"]: f for f in tencent["credential_fields"]}
assert fields_by_key["api_key"]["required"] is True
assert fields_by_key["api_key"]["field_type"] == "password"
assert fields_by_key["api_base"]["field_type"] == "text"
assert fields_by_key["api_base"]["required"] is False
ADD_MODEL_UNLISTED_PROVIDERS: Final = frozenset(
{
"a2a",
@ -412,7 +437,6 @@ ADD_MODEL_UNLISTED_PROVIDERS: Final = frozenset(
"scaleway",
"stability",
"synthetic",
"tencent",
"tensormesh",
"text-completion-inception",
"transcribe",

View file

@ -195,6 +195,7 @@ describe("provider_info_helpers", () => {
Providers.PG_VECTOR,
Providers.PREDIBASE,
Providers.Sail,
Providers.Tencent,
Providers.WANDB,
Providers.ZAI,
];
@ -309,6 +310,10 @@ describe("provider_info_helpers", () => {
expect(getPlaceholder("CHATGPT")).toBe("chatgpt/gpt-5.4");
});
it("should return a tencent/ placeholder for the Tencent provider", () => {
expect(getPlaceholder(Providers.Tencent)).toBe("tencent/deepseek-v4-pro");
});
it("should return default gpt-3.5-turbo placeholder for unknown provider", () => {
expect(getPlaceholder("UnknownProvider" as any)).toBe("gpt-3.5-turbo");
});

View file

@ -167,6 +167,7 @@ export enum Providers {
Snowflake = "Snowflake",
Soniox = "Soniox",
TEXT_COMPLETION_CODESTRAL = "Text-Completion-Codestral",
Tencent = "Tencent",
TogetherAI = "TogetherAI",
TOPAZ = "Topaz",
Triton = "Triton",
@ -286,6 +287,7 @@ export const provider_map: Record<string, string> = {
Snowflake: "snowflake",
Soniox: "soniox",
TEXT_COMPLETION_CODESTRAL: "text-completion-codestral",
Tencent: "tencent",
TogetherAI: "together_ai",
TOPAZ: "topaz",
Triton: "triton",
@ -453,6 +455,7 @@ const providerPlaceholderMap: Partial<Record<Providers, string>> = {
[Providers.Sail]: "sail/openai/gpt-oss-120b",
[Providers.SCX_AI]: "scx-ai/GLM-5.2",
[Providers.Snowflake]: "snowflake/mistral-7b",
[Providers.Tencent]: "tencent/deepseek-v4-pro",
[Providers.Vertex_AI]: "gemini-pro",
[Providers.VolcEngine]: "volcengine/<any-model-on-volcengine>",
[Providers.Voyage]: "voyage/",