mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 05:00:44 +00:00
19 lines
558 B
TypeScript
19 lines
558 B
TypeScript
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
|
|
|
export function createCapturedThinkingConfigStream() {
|
|
let capturedPayload: Record<string, unknown> | undefined;
|
|
const streamFn: StreamFn = (model, _context, options) => {
|
|
const payload = { config: { thinkingConfig: { thinkingBudget: -1 } } } as Record<
|
|
string,
|
|
unknown
|
|
>;
|
|
options?.onPayload?.(payload as never, model as never);
|
|
capturedPayload = payload;
|
|
return {} as never;
|
|
};
|
|
return {
|
|
streamFn,
|
|
getCapturedPayload: () => capturedPayload,
|
|
};
|
|
}
|