mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 13:11:40 +00:00
refactor(providers): share anthropic tool payload helper
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
||||
import { streamSimple } from "@mariozechner/pi-ai";
|
||||
import { createAnthropicToolPayloadCompatibilityWrapper } from "openclaw/plugin-sdk/provider-stream";
|
||||
import { createOpenAIAnthropicToolPayloadCompatibilityWrapper } from "openclaw/plugin-sdk/provider-stream";
|
||||
|
||||
const TOOL_CALLS_SECTION_BEGIN = "<|tool_calls_section_begin|>";
|
||||
const TOOL_CALLS_SECTION_END = "<|tool_calls_section_end|>";
|
||||
@@ -183,9 +183,6 @@ export function createKimiToolCallMarkupWrapper(baseStreamFn: StreamFn | undefin
|
||||
|
||||
export function wrapKimiProviderStream(baseStreamFn: StreamFn | undefined): StreamFn {
|
||||
return createKimiToolCallMarkupWrapper(
|
||||
createAnthropicToolPayloadCompatibilityWrapper(baseStreamFn, {
|
||||
toolSchemaMode: "openai-functions",
|
||||
toolChoiceMode: "openai-string-modes",
|
||||
}),
|
||||
createOpenAIAnthropicToolPayloadCompatibilityWrapper(baseStreamFn),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user