fix(agent): honor configured auto image model for image intents
This commit is contained in:
parent
35a65f26f6
commit
c91486e1bb
@ -143,17 +143,28 @@ export async function routeToModel(params: {
|
||||
);
|
||||
|
||||
if (configuredModel) {
|
||||
const isImageIntent = intent === "image_edit" || intent === "image_gen";
|
||||
const matchesVision = !config.requireVision || configuredModel.model.supportsVision;
|
||||
const matchesImageGen = !config.requireImageGen || configuredModel.model.supportsImageGen;
|
||||
const allowImageIntentWithImageGenOnly =
|
||||
isImageIntent && configuredModel.model.supportsImageGen;
|
||||
|
||||
if (matchesVision && matchesImageGen) {
|
||||
if ((matchesVision && matchesImageGen) || allowImageIntentWithImageGenOnly) {
|
||||
const reason = allowImageIntentWithImageGenOnly && !matchesVision
|
||||
? `管理员配置的默认模型(按生图能力优先)→ ${configuredModel.model.displayName}`
|
||||
: `管理员配置的默认模型 → ${configuredModel.model.displayName}`;
|
||||
console.log("[Model Router] ✅ Using configured default model:", configuredModel.model.displayName);
|
||||
if (allowImageIntentWithImageGenOnly && !matchesVision) {
|
||||
console.log(
|
||||
"[Model Router] ℹ️ Configured default model does not support vision, but image intent can reuse Agent analysis and keep admin default image model."
|
||||
);
|
||||
}
|
||||
return {
|
||||
id: configuredModel.model.id,
|
||||
displayName: configuredModel.model.displayName,
|
||||
providerType: configuredModel.provider.type,
|
||||
modelId: configuredModel.model.modelId,
|
||||
reason: `管理员配置的默认模型 → ${configuredModel.model.displayName}`,
|
||||
reason,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user