fix(providers): stabilize runtime normalization hooks

This commit is contained in:
Peter Steinberger
2026-04-04 19:33:30 +01:00
parent e06e36d41a
commit ca200eb480
19 changed files with 196 additions and 126 deletions

View File

@@ -5,6 +5,18 @@ import {
type ProviderRuntimeModel,
type ProviderWrapStreamFnContext,
} from "openclaw/plugin-sdk/plugin-entry";
import {
applyOpenrouterConfig,
buildOpenrouterProvider,
buildProviderReplayFamilyHooks,
buildProviderStreamFamilyHooks,
createProviderApiKeyAuthMethod,
DEFAULT_CONTEXT_TOKENS,
getOpenRouterModelCapabilities,
loadOpenRouterModelCapabilities,
OPENROUTER_DEFAULT_MODEL_REF,
openrouterMediaUnderstandingProvider,
} from "./register.runtime.js";
const PROVIDER_ID = "openrouter";
const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
@@ -20,19 +32,7 @@ export default definePluginEntry({
id: "openrouter",
name: "OpenRouter Provider",
description: "Bundled OpenRouter provider plugin",
async register(api) {
const {
buildProviderReplayFamilyHooks,
buildProviderStreamFamilyHooks,
createProviderApiKeyAuthMethod,
DEFAULT_CONTEXT_TOKENS,
getOpenRouterModelCapabilities,
loadOpenRouterModelCapabilities,
OPENROUTER_DEFAULT_MODEL_REF,
openrouterMediaUnderstandingProvider,
applyOpenrouterConfig,
buildOpenrouterProvider,
} = await import("./register.runtime.js");
register(api) {
const PASSTHROUGH_GEMINI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({
family: "passthrough-gemini",
});

View File

@@ -1,9 +1,9 @@
export { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
export {
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
import {
buildProviderReplayFamilyHooks,
DEFAULT_CONTEXT_TOKENS,
} from "openclaw/plugin-sdk/provider-model-shared";
export {
import {
buildProviderStreamFamilyHooks,
createOpenRouterSystemCacheWrapper,
createOpenRouterWrapper,
@@ -11,6 +11,22 @@ export {
isProxyReasoningUnsupported,
loadOpenRouterModelCapabilities,
} from "openclaw/plugin-sdk/provider-stream";
export { openrouterMediaUnderstandingProvider } from "./media-understanding-provider.js";
export { applyOpenrouterConfig, OPENROUTER_DEFAULT_MODEL_REF } from "./onboard.js";
export { buildOpenrouterProvider } from "./provider-catalog.js";
import { openrouterMediaUnderstandingProvider } from "./media-understanding-provider.js";
import { applyOpenrouterConfig, OPENROUTER_DEFAULT_MODEL_REF } from "./onboard.js";
import { buildOpenrouterProvider } from "./provider-catalog.js";
export {
applyOpenrouterConfig,
buildOpenrouterProvider,
buildProviderReplayFamilyHooks,
buildProviderStreamFamilyHooks,
createOpenRouterSystemCacheWrapper,
createOpenRouterWrapper,
createProviderApiKeyAuthMethod,
DEFAULT_CONTEXT_TOKENS,
getOpenRouterModelCapabilities,
isProxyReasoningUnsupported,
loadOpenRouterModelCapabilities,
OPENROUTER_DEFAULT_MODEL_REF,
openrouterMediaUnderstandingProvider,
};