mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 08:11:34 +00:00
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
// Venice plugin module implements stream behavior.
|
|
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
|
|
import {
|
|
createPayloadPatchStreamWrapper,
|
|
normalizeOpenAICompatibleReasoningReplay,
|
|
} from "openclaw/plugin-sdk/provider-stream-shared";
|
|
|
|
function isVeniceDeepSeekV4ModelId(modelId: unknown): boolean {
|
|
return modelId === "deepseek-v4-flash" || modelId === "deepseek-v4-pro";
|
|
}
|
|
|
|
export function createVeniceDeepSeekV4Wrapper(
|
|
baseStreamFn: ProviderWrapStreamFnContext["streamFn"],
|
|
thinkingLevel: ProviderWrapStreamFnContext["thinkingLevel"],
|
|
): ProviderWrapStreamFnContext["streamFn"] {
|
|
void thinkingLevel;
|
|
return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload, model }) => {
|
|
if (model.provider === "venice" && isVeniceDeepSeekV4ModelId(model.id)) {
|
|
delete payload.thinking;
|
|
delete payload.reasoning;
|
|
delete payload.reasoning_effort;
|
|
normalizeOpenAICompatibleReasoningReplay(payload, {
|
|
thinkingEnabled: true,
|
|
replaceNullReasoningContent: true,
|
|
});
|
|
}
|
|
});
|
|
}
|