mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 19:00:23 +00:00
refactor(openai): move native transport policy into extension
This commit is contained in:
@@ -39,9 +39,13 @@ import type {
|
||||
ProviderResolveUsageAuthContext,
|
||||
ProviderPlugin,
|
||||
ProviderResolveDynamicModelContext,
|
||||
ProviderResolveTransportTurnStateContext,
|
||||
ProviderResolveWebSocketSessionPolicyContext,
|
||||
ProviderRuntimeModel,
|
||||
ProviderThinkingPolicyContext,
|
||||
ProviderTransportTurnState,
|
||||
ProviderValidateReplayTurnsContext,
|
||||
ProviderWebSocketSessionPolicy,
|
||||
ProviderWrapStreamFnContext,
|
||||
} from "./types.js";
|
||||
|
||||
@@ -525,6 +529,30 @@ export function wrapProviderStreamFn(params: {
|
||||
return resolveProviderHookPlugin(params)?.wrapStreamFn?.(params.context) ?? undefined;
|
||||
}
|
||||
|
||||
export function resolveProviderTransportTurnStateWithPlugin(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
context: ProviderResolveTransportTurnStateContext;
|
||||
}): ProviderTransportTurnState | undefined {
|
||||
return (
|
||||
resolveProviderHookPlugin(params)?.resolveTransportTurnState?.(params.context) ?? undefined
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveProviderWebSocketSessionPolicyWithPlugin(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
context: ProviderResolveWebSocketSessionPolicyContext;
|
||||
}): ProviderWebSocketSessionPolicy | undefined {
|
||||
return (
|
||||
resolveProviderHookPlugin(params)?.resolveWebSocketSessionPolicy?.(params.context) ?? undefined
|
||||
);
|
||||
}
|
||||
|
||||
export async function createProviderEmbeddingProvider(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
|
||||
Reference in New Issue
Block a user