mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
38 lines
999 B
TypeScript
38 lines
999 B
TypeScript
// Deepinfra setup module handles plugin onboarding behavior.
|
|
import {
|
|
applyAgentDefaultModelPrimary,
|
|
type OpenClawConfig,
|
|
} from "openclaw/plugin-sdk/provider-onboard";
|
|
import { DEEPINFRA_BASE_URL, DEEPINFRA_DEFAULT_MODEL_REF } from "./provider-models.js";
|
|
|
|
export { DEEPINFRA_BASE_URL, DEEPINFRA_DEFAULT_MODEL_REF };
|
|
|
|
export function applyDeepInfraProviderConfig(
|
|
cfg: OpenClawConfig,
|
|
modelRef: string = DEEPINFRA_DEFAULT_MODEL_REF,
|
|
): OpenClawConfig {
|
|
const models = { ...cfg.agents?.defaults?.models };
|
|
models[modelRef] = {
|
|
...models[modelRef],
|
|
alias: models[modelRef]?.alias ?? "DeepInfra",
|
|
};
|
|
|
|
return {
|
|
...cfg,
|
|
agents: {
|
|
...cfg.agents,
|
|
defaults: {
|
|
...cfg.agents?.defaults,
|
|
models,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
export function applyDeepInfraConfig(
|
|
cfg: OpenClawConfig,
|
|
modelRef: string = DEEPINFRA_DEFAULT_MODEL_REF,
|
|
): OpenClawConfig {
|
|
return applyAgentDefaultModelPrimary(applyDeepInfraProviderConfig(cfg, modelRef), modelRef);
|
|
}
|