fix: gate sticker vision on image input
This commit is contained in:
@@ -122,7 +122,7 @@ async function resolveStickerVisionSupport(params: {
|
||||
});
|
||||
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
|
||||
if (!entry) return false;
|
||||
return entry.input ? modelSupportsVision(entry) : true;
|
||||
return modelSupportsVision(entry);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ async function resolveStickerVisionSupport(cfg, agentId) {
|
||||
const defaultModel = resolveDefaultModelForAgent({ cfg, agentId });
|
||||
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
|
||||
if (!entry) return false;
|
||||
return entry.input ? modelSupportsVision(entry) : true;
|
||||
return modelSupportsVision(entry);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export async function describeStickerImage(params: DescribeStickerParams): Promi
|
||||
try {
|
||||
catalog = await loadModelCatalog({ config: cfg });
|
||||
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
|
||||
const supportsVision = entry?.input ? modelSupportsVision(entry) : Boolean(entry);
|
||||
const supportsVision = modelSupportsVision(entry);
|
||||
if (supportsVision) {
|
||||
activeModel = { provider: defaultModel.provider, model: defaultModel.model };
|
||||
}
|
||||
@@ -185,8 +185,7 @@ export async function describeStickerImage(params: DescribeStickerParams): Promi
|
||||
const selectCatalogModel = (provider: string) => {
|
||||
const entries = catalog.filter(
|
||||
(entry) =>
|
||||
entry.provider.toLowerCase() === provider.toLowerCase() &&
|
||||
(entry.input ? modelSupportsVision(entry) : true),
|
||||
entry.provider.toLowerCase() === provider.toLowerCase() && modelSupportsVision(entry),
|
||||
);
|
||||
if (entries.length === 0) return undefined;
|
||||
const defaultId =
|
||||
|
||||
Reference in New Issue
Block a user