mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 01:00:21 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "./defaults.js";
|
||||
import {
|
||||
coerceToFailoverError,
|
||||
@@ -48,7 +48,7 @@ function shouldRethrowAbort(err: unknown): boolean {
|
||||
}
|
||||
|
||||
function buildAllowedModelKeys(
|
||||
cfg: MoltbotConfig | undefined,
|
||||
cfg: OpenClawConfig | undefined,
|
||||
defaultProvider: string,
|
||||
): Set<string> | null {
|
||||
const rawAllowlist = (() => {
|
||||
@@ -66,7 +66,7 @@ function buildAllowedModelKeys(
|
||||
}
|
||||
|
||||
function resolveImageFallbackCandidates(params: {
|
||||
cfg: MoltbotConfig | undefined;
|
||||
cfg: OpenClawConfig | undefined;
|
||||
defaultProvider: string;
|
||||
modelOverride?: string;
|
||||
}): ModelCandidate[] {
|
||||
@@ -127,7 +127,7 @@ function resolveImageFallbackCandidates(params: {
|
||||
}
|
||||
|
||||
function resolveFallbackCandidates(params: {
|
||||
cfg: MoltbotConfig | undefined;
|
||||
cfg: OpenClawConfig | undefined;
|
||||
provider: string;
|
||||
model: string;
|
||||
/** Optional explicit fallbacks list; when provided (even empty), replaces agents.defaults.model.fallbacks. */
|
||||
@@ -191,7 +191,7 @@ function resolveFallbackCandidates(params: {
|
||||
}
|
||||
|
||||
export async function runWithModelFallback<T>(params: {
|
||||
cfg: MoltbotConfig | undefined;
|
||||
cfg: OpenClawConfig | undefined;
|
||||
provider: string;
|
||||
model: string;
|
||||
agentDir?: string;
|
||||
@@ -299,7 +299,7 @@ export async function runWithModelFallback<T>(params: {
|
||||
}
|
||||
|
||||
export async function runWithImageModelFallback<T>(params: {
|
||||
cfg: MoltbotConfig | undefined;
|
||||
cfg: OpenClawConfig | undefined;
|
||||
modelOverride?: string;
|
||||
run: (provider: string, model: string) => Promise<T>;
|
||||
onError?: (attempt: {
|
||||
|
||||
Reference in New Issue
Block a user