mirror of https://github.com/openclaw/openclaw.git
fix: add augmentModelCatalog hooks to bundled providers for proper filtering
This commit is contained in:
parent
792558de01
commit
fd3b7b5ae7
|
|
@ -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 { buildBytePlusCodingProvider, buildBytePlusProvider } from "./provider-catalog.js";
|
||||
import {
|
||||
BYTEPLUS_CODING_MODEL_CATALOG,
|
||||
BYTEPLUS_MODEL_CATALOG,
|
||||
} from "./models.js";
|
||||
|
||||
const PROVIDER_ID = "byteplus";
|
||||
const BYTEPLUS_DEFAULT_MODEL_REF = "byteplus-plan/ark-code-latest";
|
||||
|
|
@ -57,6 +61,25 @@ export default definePluginEntry({
|
|||
};
|
||||
},
|
||||
},
|
||||
augmentModelCatalog: () => {
|
||||
const byteplusModels = BYTEPLUS_MODEL_CATALOG.map((entry) => ({
|
||||
provider: "byteplus",
|
||||
id: entry.id,
|
||||
name: entry.name,
|
||||
reasoning: entry.reasoning,
|
||||
input: [...entry.input],
|
||||
contextWindow: entry.contextWindow,
|
||||
}));
|
||||
const byteplusPlanModels = BYTEPLUS_CODING_MODEL_CATALOG.map((entry) => ({
|
||||
provider: "byteplus-plan",
|
||||
id: entry.id,
|
||||
name: entry.name,
|
||||
reasoning: entry.reasoning,
|
||||
input: [...entry.input],
|
||||
contextWindow: entry.contextWindow,
|
||||
}));
|
||||
return [...byteplusModels, ...byteplusPlanModels];
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -295,6 +295,7 @@ export function resolveCatalogHookProviderPluginIds(params: {
|
|||
origin: plugin.origin,
|
||||
config: normalizedConfig,
|
||||
rootConfig: params.config,
|
||||
enabledByDefault: plugin.enabledByDefault,
|
||||
}).activated,
|
||||
)
|
||||
.map((plugin) => plugin.id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue