mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-15 19:32:20 +03:00
fix(models): normalize media endpoint metadata (#11397)
Validado em lote combinado (batch-0824g) contra o tip de release/v3.8.50: typecheck:core limpo, gates estáticos OK, 62/62 testes focados passando (endpoint/parser/schema/static-model + catálogo). Canonicaliza metadados de endpoint legados (video/audio) para IDs específicos por operação, mantendo compatibilidade retroativa via `normalizeModelSupportedEndpoints` (valores antigos `audio`/`video` continuam válidos como entrada e são normalizados na escrita). Obrigado pela contribuição, primeira PR bem-vinda!
This commit is contained in:
@@ -6,6 +6,10 @@ import {
|
||||
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
|
||||
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
|
||||
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
|
||||
import {
|
||||
MODEL_SUPPORTED_ENDPOINT_VALUES,
|
||||
normalizeModelSupportedEndpoints,
|
||||
} from "@/shared/constants/modelSupportedEndpoints";
|
||||
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
|
||||
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
|
||||
import {
|
||||
@@ -238,22 +242,12 @@ export const providerModelMutationSchema = z.object({
|
||||
"audio-transcriptions",
|
||||
"audio-speech",
|
||||
"images-generations",
|
||||
"video",
|
||||
])
|
||||
.default("chat-completions"),
|
||||
supportedEndpoints: z
|
||||
.array(
|
||||
z.enum([
|
||||
"chat",
|
||||
"embeddings",
|
||||
"rerank",
|
||||
"images",
|
||||
"audio",
|
||||
"audio-transcriptions",
|
||||
"audio-speech",
|
||||
"images-generations",
|
||||
"videos",
|
||||
])
|
||||
)
|
||||
.array(z.enum(MODEL_SUPPORTED_ENDPOINT_VALUES))
|
||||
.transform(normalizeModelSupportedEndpoints)
|
||||
.default(["chat"]),
|
||||
// #2905: optional per-model wire format override for custom models (e.g. a
|
||||
// custom opencode-go model that must use the Anthropic Messages shape).
|
||||
|
||||
Reference in New Issue
Block a user