mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
refactor(providers): add family replay and tool hooks
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
||||
import {
|
||||
buildPassthroughGeminiSanitizingReplayPolicy,
|
||||
buildProviderReplayFamilyHooks,
|
||||
matchesExactOrPrefix,
|
||||
} from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import { applyOpencodeZenConfig, OPENCODE_ZEN_DEFAULT_MODEL } from "./api.js";
|
||||
|
||||
const PROVIDER_ID = "opencode";
|
||||
const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m2.7"] as const;
|
||||
const PASSTHROUGH_GEMINI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({
|
||||
family: "passthrough-gemini",
|
||||
});
|
||||
|
||||
function isModernOpencodeModel(modelId: string): boolean {
|
||||
const lower = modelId.trim().toLowerCase();
|
||||
@@ -57,7 +60,7 @@ export default definePluginEntry({
|
||||
},
|
||||
}),
|
||||
],
|
||||
buildReplayPolicy: ({ modelId }) => buildPassthroughGeminiSanitizingReplayPolicy(modelId),
|
||||
...PASSTHROUGH_GEMINI_REPLAY_HOOKS,
|
||||
isModernModelRef: ({ modelId }) => isModernOpencodeModel(modelId),
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user