mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-05 22:32:12 +00:00
style: normalize provider formatting
This commit is contained in:
@@ -23,9 +23,7 @@ import {
|
||||
normalizeAnthropicProviderConfig,
|
||||
} from "./config-defaults.js";
|
||||
import { buildAnthropicReplayPolicy } from "./replay-policy.js";
|
||||
import {
|
||||
wrapAnthropicProviderStream,
|
||||
} from "./stream-wrappers.js";
|
||||
import { wrapAnthropicProviderStream } from "./stream-wrappers.js";
|
||||
|
||||
const PROVIDER_ID = "anthropic";
|
||||
const DEFAULT_ANTHROPIC_MODEL = "anthropic/claude-sonnet-4-6";
|
||||
|
||||
@@ -210,7 +210,9 @@ export function resolveAnthropicServiceTier(
|
||||
return normalized;
|
||||
}
|
||||
|
||||
export function wrapAnthropicProviderStream(ctx: ProviderWrapStreamFnContext): StreamFn | undefined {
|
||||
export function wrapAnthropicProviderStream(
|
||||
ctx: ProviderWrapStreamFnContext,
|
||||
): StreamFn | undefined {
|
||||
const anthropicBetas = resolveAnthropicBetas(ctx.extraParams, ctx.modelId);
|
||||
const serviceTier = resolveAnthropicServiceTier(ctx.extraParams);
|
||||
const fastMode = resolveAnthropicFastMode(ctx.extraParams);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
||||
import { streamSimple } from "@mariozechner/pi-ai";
|
||||
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import {
|
||||
applyAnthropicEphemeralCacheControlMarkers,
|
||||
buildCopilotDynamicHeaders,
|
||||
hasCopilotVisionInput,
|
||||
streamWithPayloadPatch,
|
||||
} from "openclaw/plugin-sdk/provider-stream";
|
||||
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
|
||||
|
||||
type StreamContext = Parameters<StreamFn>[1];
|
||||
|
||||
|
||||
@@ -15,9 +15,7 @@ import { buildXaiProvider } from "./provider-catalog.js";
|
||||
import { isModernXaiModel, resolveXaiForwardCompatModel } from "./provider-models.js";
|
||||
import { resolveFallbackXaiAuth } from "./src/tool-auth-shared.js";
|
||||
import { resolveEffectiveXSearchConfig } from "./src/x-search-config.js";
|
||||
import {
|
||||
wrapXaiProviderStream,
|
||||
} from "./stream.js";
|
||||
import { wrapXaiProviderStream } from "./stream.js";
|
||||
import { createXaiWebSearchProvider } from "./web-search.js";
|
||||
|
||||
const PROVIDER_ID = "xai";
|
||||
|
||||
@@ -97,7 +97,9 @@ describe("buildProviderReplayFamilyHooks", () => {
|
||||
|
||||
expect(hooks.buildReplayPolicy?.(testCase.ctx as never)).toMatchObject(testCase.match);
|
||||
expect(Boolean(hooks.sanitizeReplayHistory)).toBe(testCase.hasSanitizeReplayHistory);
|
||||
expect(hooks.resolveReasoningOutputMode?.(testCase.ctx as never)).toBe(testCase.reasoningMode);
|
||||
expect(hooks.resolveReasoningOutputMode?.(testCase.ctx as never)).toBe(
|
||||
testCase.reasoningMode,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user