fix(models): attach provider to inline model definitions
When resolving models from custom provider configurations, ensure the provider name is attached to each inline model entry. This fixes model resolution for custom providers where the model definition exists in the config but lacks an explicit provider field. Without this fix, inline models from custom providers (like amazon-bedrock) would fail to resolve because the provider context was lost during the flatMap operation.
This commit is contained in:
@@ -39,7 +39,7 @@ export function resolveModel(
|
||||
if (!model) {
|
||||
const providers = cfg?.models?.providers ?? {};
|
||||
const inlineModels =
|
||||
providers[provider]?.models ??
|
||||
providers[provider]?.models?.map((entry) => ({ ...entry, provider })) ??
|
||||
Object.values(providers)
|
||||
.flatMap((entry) => entry?.models ?? [])
|
||||
.map((entry) => ({ ...entry, provider }));
|
||||
|
||||
Reference in New Issue
Block a user