fix(models): hide unsupported Gemini Live discovery (#11710)

Obrigado! Validado em lote combinado (8 PRs, release/v3.8.51):

- Follow-up correto de #10590/#10591 — omite modelos Gemini Live-only da descoberta dinâmica, preserva chat para modelos híbridos.
- Teste focado atualizado: `tests/unit/gemini-models-parser.test.ts` — 6/6 verde.
- Gates estáticos do lote OK (typecheck, lint sem regressão, complexity, cognitive, file-size, changelog-integrity).
This commit is contained in:
Ravi Tharuma
2026-08-28 03:14:45 +02:00
committed by GitHub
parent a45e80af43
commit 9be4fd0a0e
3 changed files with 26 additions and 8 deletions

View File

@@ -72,14 +72,21 @@ test("parseGeminiModelsList maps generateContent image models to the chat endpoi
assert.deepEqual(proImage!.supportedEndpoints, ["chat"]);
});
test("parseGeminiModelsList maps embedContent and bidiGenerateContent", () => {
test("parseGeminiModelsList maps embeddings without advertising unsupported Gemini Live", () => {
const models = parseGeminiModelsList(SAMPLE);
assert.deepEqual(models.find((m) => m.id === "text-embedding-004")!.supportedEndpoints, [
"embeddings",
]);
assert.deepEqual(models.find((m) => m.id === "gemini-live-2.5-flash")!.supportedEndpoints, [
"audio",
]);
assert.equal(models.some((m) => m.id === "gemini-live-2.5-flash"), false);
const [hybrid] = parseGeminiModelsList({
models: [
{
name: "models/gemini-live-hybrid",
supportedGenerationMethods: ["generateContent", "bidiGenerateContent"],
},
],
});
assert.deepEqual(hybrid.supportedEndpoints, ["chat"]);
});
test("parseGeminiModelsList maps Veo predictLongRunning models to the videos endpoint", () => {