fix providers issue

This commit is contained in:
Prasang Prajapati 2025-08-26 12:38:04 -04:00
parent 94017b452e
commit 411cf01e7f
4 changed files with 6 additions and 0 deletions

View file

@ -466,6 +466,7 @@ export const MODEL_ID_KEYS: Partial<keyof ProviderSettings>[] = [
"ioIntelligenceModelId",
"vercelAiGatewayModelId",
"deepInfraModelId",
"watsonxModelId",
]
export const getModelId = (settings: ProviderSettings): string | undefined => {
@ -605,6 +606,7 @@ export const dynamicProviders = [
"unbound",
"deepinfra",
"vercel-ai-gateway",
"watsonx",
] as const satisfies readonly ProviderName[]
export type DynamicProvider = (typeof dynamicProviders)[number]

View file

@ -29,6 +29,7 @@ const routerNames = [
"io-intelligence",
"deepinfra",
"vercel-ai-gateway",
"watsonx",
] as const
export type RouterName = (typeof routerNames)[number]
@ -155,3 +156,4 @@ export type GetModelsOptions =
| { provider: "deepinfra"; apiKey?: string; baseUrl?: string }
| { provider: "io-intelligence"; apiKey: string }
| { provider: "vercel-ai-gateway" }
| { provider: "watsonx"; apiKey: string }

View file

@ -160,6 +160,7 @@ describe("ApiOptions Provider Filtering", () => {
expect(providerValues).toContain("unbound")
expect(providerValues).toContain("requesty")
expect(providerValues).toContain("io-intelligence")
expect(providerValues).toContain("watsonx")
})
it("should filter static providers based on organization allow list", () => {

View file

@ -42,6 +42,7 @@ describe("Model Validation Functions", () => {
deepinfra: {},
"io-intelligence": {},
"vercel-ai-gateway": {},
watsonx: {},
}
const allowAllOrganization: OrganizationAllowList = {