mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-02 19:17:23 +00:00
refactor: add provider onboarding preset appliers
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
import { KILOCODE_BASE_URL, KILOCODE_DEFAULT_MODEL_REF } from "openclaw/plugin-sdk/provider-models";
|
||||
import {
|
||||
applyProviderConfigWithModelCatalogPreset,
|
||||
createModelCatalogPresetAppliers,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/provider-onboard";
|
||||
import { buildKilocodeProvider } from "./provider-catalog.js";
|
||||
|
||||
export { KILOCODE_BASE_URL, KILOCODE_DEFAULT_MODEL_REF };
|
||||
|
||||
export function applyKilocodeProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return applyProviderConfigWithModelCatalogPreset(cfg, {
|
||||
const kilocodePresetAppliers = createModelCatalogPresetAppliers({
|
||||
primaryModelRef: KILOCODE_DEFAULT_MODEL_REF,
|
||||
resolveParams: (_cfg: OpenClawConfig) => ({
|
||||
providerId: "kilocode",
|
||||
api: "openai-completions",
|
||||
baseUrl: KILOCODE_BASE_URL,
|
||||
catalogModels: buildKilocodeProvider().models ?? [],
|
||||
aliases: [{ modelRef: KILOCODE_DEFAULT_MODEL_REF, alias: "Kilo Gateway" }],
|
||||
});
|
||||
}),
|
||||
});
|
||||
|
||||
export function applyKilocodeProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return kilocodePresetAppliers.applyProviderConfig(cfg);
|
||||
}
|
||||
|
||||
export function applyKilocodeConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return applyProviderConfigWithModelCatalogPreset(cfg, {
|
||||
providerId: "kilocode",
|
||||
api: "openai-completions",
|
||||
baseUrl: KILOCODE_BASE_URL,
|
||||
catalogModels: buildKilocodeProvider().models ?? [],
|
||||
aliases: [{ modelRef: KILOCODE_DEFAULT_MODEL_REF, alias: "Kilo Gateway" }],
|
||||
primaryModelRef: KILOCODE_DEFAULT_MODEL_REF,
|
||||
});
|
||||
return kilocodePresetAppliers.applyConfig(cfg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user