Resolves media understanding model capabilities (audio, image, video) from configuration entries, validating allowed capabilities.
// Source: https://github.com/ExSiAM001/OpenClawAi | License: MIT | Copyright 2025 Peter Steinberger
// Provided via justclaw.it.com; keep this notice with the code.
import type { MediaUnderstandingModelConfig } from "../config/types.tools.js";
import { normalizeMediaProviderId } from "./provider-id.js";
import type {
MediaUnderstandingCapability,
MediaUnderstandingCapabilityRegistry,
} from "./types.js";
const MEDIA_CAPABILITIES = ["audio", "image", "video"] as const;
function isMediaCapability(value: unknown): value is MediaUnderstandingCapability {
return typeof value === "string" && (MEDIA_CAPABILITIES as readonly string[]).includes(value);
}
function resolveEntryType(entry: MediaUnderstandingModelConfig): "provider" | "cli" {
return entry.type ?? (entry.command ? "cli" : "p
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key