mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 08:00:22 +00:00
fix: stabilize provider sdk runtime surfaces
This commit is contained in:
@@ -70,27 +70,6 @@ import {
|
||||
} from "./pi-embedded-runner.js";
|
||||
import { log } from "./pi-embedded-runner/logger.js";
|
||||
|
||||
function createXaiFastModeWrapper(baseStreamFn: StreamFn | undefined, fastMode: boolean): StreamFn {
|
||||
const fastModelIds = new Map<string, string>([
|
||||
["grok-3", "grok-3-fast"],
|
||||
["grok-3-mini", "grok-3-mini-fast"],
|
||||
["grok-4", "grok-4-fast"],
|
||||
["grok-4-0709", "grok-4-fast"],
|
||||
]);
|
||||
return (model, context, options) => {
|
||||
if (!fastMode || model.api !== "openai-completions" || model.provider !== "xai") {
|
||||
return (baseStreamFn as StreamFn)(model, context, options);
|
||||
}
|
||||
const fastModelId =
|
||||
typeof model.id === "string" ? fastModelIds.get(model.id.trim()) : undefined;
|
||||
return (baseStreamFn as StreamFn)(
|
||||
fastModelId ? { ...model, id: fastModelId } : model,
|
||||
context,
|
||||
options,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
extraParamsTesting.setProviderRuntimeDepsForTest({
|
||||
prepareProviderExtraParams: (params) => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
import { __testing as loaderTesting } from "../plugins/loader.js";
|
||||
import { loadPluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
import { createEmptyPluginRegistry } from "../plugins/registry.js";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
|
||||
let describeImageFile: typeof import("./runtime.js").describeImageFile;
|
||||
let runMediaUnderstandingFile: typeof import("./runtime.js").runMediaUnderstandingFile;
|
||||
|
||||
Reference in New Issue
Block a user