mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-28 17:21:52 +00:00
refactor(providers): add family replay and tool hooks
This commit is contained in:
@@ -21,7 +21,7 @@ export default definePluginEntry({
|
||||
description: "Bundled OpenRouter provider plugin",
|
||||
async register(api) {
|
||||
const {
|
||||
buildPassthroughGeminiSanitizingReplayPolicy,
|
||||
buildProviderReplayFamilyHooks,
|
||||
composeProviderStreamWrappers,
|
||||
createOpenRouterWrapper,
|
||||
createProviderApiKeyAuthMethod,
|
||||
@@ -34,6 +34,9 @@ export default definePluginEntry({
|
||||
applyOpenrouterConfig,
|
||||
buildOpenrouterProvider,
|
||||
} = await import("./register.runtime.js");
|
||||
const PASSTHROUGH_GEMINI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({
|
||||
family: "passthrough-gemini",
|
||||
});
|
||||
|
||||
function buildDynamicOpenRouterModel(
|
||||
ctx: ProviderResolveDynamicModelContext,
|
||||
@@ -128,7 +131,7 @@ export default definePluginEntry({
|
||||
prepareDynamicModel: async (ctx) => {
|
||||
await loadOpenRouterModelCapabilities(ctx.modelId);
|
||||
},
|
||||
buildReplayPolicy: ({ modelId }) => buildPassthroughGeminiSanitizingReplayPolicy(modelId),
|
||||
...PASSTHROUGH_GEMINI_REPLAY_HOOKS,
|
||||
resolveReasoningOutputMode: () => "native",
|
||||
isModernModelRef: () => true,
|
||||
wrapStreamFn: (ctx) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
||||
export {
|
||||
buildPassthroughGeminiSanitizingReplayPolicy,
|
||||
buildProviderReplayFamilyHooks,
|
||||
DEFAULT_CONTEXT_TOKENS,
|
||||
} from "openclaw/plugin-sdk/provider-model-shared";
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user