support custom api url per model
This commit is contained in:
parent
5bdf1c4b96
commit
ad2087094d
2 changed files with 3 additions and 3 deletions
|
|
@ -64,7 +64,7 @@ export namespace ModelsDev {
|
||||||
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
||||||
options: z.record(z.string(), z.any()),
|
options: z.record(z.string(), z.any()),
|
||||||
headers: z.record(z.string(), z.string()).optional(),
|
headers: z.record(z.string(), z.string()).optional(),
|
||||||
provider: z.object({ npm: z.string() }).optional(),
|
provider: z.object({ npm: z.string(), api: z.string() }).optional(),
|
||||||
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
||||||
})
|
})
|
||||||
export type Model = z.infer<typeof Model>
|
export type Model = z.infer<typeof Model>
|
||||||
|
|
|
||||||
|
|
@ -629,7 +629,7 @@ export namespace Provider {
|
||||||
family: model.family,
|
family: model.family,
|
||||||
api: {
|
api: {
|
||||||
id: model.id,
|
id: model.id,
|
||||||
url: provider.api!,
|
url: model.provider?.api ?? provider.api!,
|
||||||
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
|
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
|
||||||
},
|
},
|
||||||
status: model.status ?? "active",
|
status: model.status ?? "active",
|
||||||
|
|
@ -781,7 +781,7 @@ export namespace Provider {
|
||||||
existingModel?.api.npm ??
|
existingModel?.api.npm ??
|
||||||
modelsDev[providerID]?.npm ??
|
modelsDev[providerID]?.npm ??
|
||||||
"@ai-sdk/openai-compatible",
|
"@ai-sdk/openai-compatible",
|
||||||
url: provider?.api ?? existingModel?.api.url ?? modelsDev[providerID]?.api,
|
url: model.provider?.api ?? provider?.api ?? existingModel?.api.url ?? modelsDev[providerID]?.api,
|
||||||
},
|
},
|
||||||
status: model.status ?? existingModel?.status ?? "active",
|
status: model.status ?? existingModel?.status ?? "active",
|
||||||
name,
|
name,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue