mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:00:42 +00:00
build(plugins): add bundled provider plugin packages
This commit is contained in:
40
extensions/volcengine/index.ts
Normal file
40
extensions/volcengine/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
buildDoubaoCodingProvider,
|
||||
buildDoubaoProvider,
|
||||
} from "../../src/agents/models-config.providers.static.js";
|
||||
|
||||
const PROVIDER_ID = "volcengine";
|
||||
|
||||
const volcenginePlugin = {
|
||||
id: PROVIDER_ID,
|
||||
name: "Volcengine Provider",
|
||||
description: "Bundled Volcengine provider plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerProvider({
|
||||
id: PROVIDER_ID,
|
||||
label: "Volcengine",
|
||||
docsPath: "/concepts/model-providers#volcano-engine-doubao",
|
||||
envVars: ["VOLCANO_ENGINE_API_KEY"],
|
||||
auth: [],
|
||||
catalog: {
|
||||
order: "paired",
|
||||
run: async (ctx) => {
|
||||
const apiKey = ctx.resolveProviderApiKey(PROVIDER_ID).apiKey;
|
||||
if (!apiKey) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
providers: {
|
||||
volcengine: { ...buildDoubaoProvider(), apiKey },
|
||||
"volcengine-plan": { ...buildDoubaoCodingProvider(), apiKey },
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default volcenginePlugin;
|
||||
Reference in New Issue
Block a user