import type { AuthProfileStore } from "../../agents/auth-profiles/types.js"; import { modelKey } from "../../agents/model-ref-shared.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { isLocalBaseUrl } from "./list.local-url.js"; import type { ModelRow } from "./list.types.js";
export type ListRowModel = {
id: string;
name: string;
provider: string;
input: Array<"text" | "image">;
baseUrl?: string;
contextWindow?: number | null;
contextTokens?: number | null;
};
const input = model.input.join("+") || "text"; const local = isLocalBaseUrl(model.baseUrl ?? ""); const modelIsAvailable = availableKeys?.has(modelKey(model.provider, model.id)) ?? false; // Prefer model-level registry availability when present. // Fall back to provider-level auth heuristics only if registry availability isn't available, // or if the caller marks this as a synthetic/forward-compat model that won't appear in getAvailable(). const available =
availableKeys !== undefined && !allowProviderAvailabilityFallback
? modelIsAvailable
: modelIsAvailable ||
(cfg && authStore
? (
params.hasAuthForProvider ??
((input) => authStoreHasProviderProfile(input.authStore, input.provider))
)({
provider: model.provider,
cfg,
authStore,
})
: false); const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : []; const mergedTags = new Set(tags); if (aliasTags.length > 0) { for (const tag of mergedTags) { if (tag === "alias" || tag.startsWith("alias:")) {
mergedTags.delete(tag);
}
} for (const tag of aliasTags) {
mergedTags.add(tag);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.