fix: add augmentModelCatalog hooks to bundled providers for proper filtering

This commit is contained in:
Mingxuan
2026-04-01 14:16:05 +08:00
committed by Peter Steinberger
parent 792558de01
commit fd3b7b5ae7
3 changed files with 47 additions and 0 deletions

View File

@@ -2,6 +2,10 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
import { ensureModelAllowlistEntry } from "openclaw/plugin-sdk/provider-onboard";
import { buildDoubaoCodingProvider, buildDoubaoProvider } from "./provider-catalog.js";
import {
DOUBAO_CODING_MODEL_CATALOG,
DOUBAO_MODEL_CATALOG,
} from "./models.js";
const PROVIDER_ID = "volcengine";
const VOLCENGINE_DEFAULT_MODEL_REF = "volcengine-plan/ark-code-latest";
@@ -57,6 +61,25 @@ export default definePluginEntry({
};
},
},
augmentModelCatalog: () => {
const volcengineModels = DOUBAO_MODEL_CATALOG.map((entry) => ({
provider: "volcengine",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
const volcenginePlanModels = DOUBAO_CODING_MODEL_CATALOG.map((entry) => ({
provider: "volcengine-plan",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
return [...volcengineModels, ...volcenginePlanModels];
},
});
},
});