refactor: tune media understanding

This commit is contained in:
Peter Steinberger
2026-01-17 06:44:12 +00:00
parent 3dc4a96330
commit 5a1ff5b9e7
6 changed files with 285 additions and 36 deletions

View File

@@ -77,13 +77,10 @@ export function resolveScopeDecision(params: {
});
}
function inferCapabilities(
entry: MediaUnderstandingModelConfig,
export function inferProviderCapabilities(
providerId?: string,
): MediaUnderstandingCapability[] | undefined {
if ((entry.type ?? (entry.command ? "cli" : "provider")) === "cli") {
return ["image", "audio", "video"];
}
const provider = normalizeMediaProviderId(entry.provider ?? "");
const provider = normalizeMediaProviderId(providerId ?? "");
if (!provider) return undefined;
if (provider === "openai" || provider === "anthropic" || provider === "minimax") {
return ["image"];
@@ -97,6 +94,15 @@ function inferCapabilities(
return undefined;
}
function inferCapabilities(
entry: MediaUnderstandingModelConfig,
): MediaUnderstandingCapability[] | undefined {
if ((entry.type ?? (entry.command ? "cli" : "provider")) === "cli") {
return undefined;
}
return inferProviderCapabilities(entry.provider);
}
export function resolveModelEntries(params: {
cfg: ClawdbotConfig;
capability: MediaUnderstandingCapability;