mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:00:44 +00:00
test: share provider stream capture helper
This commit is contained in:
18
test/helpers/plugins/stream-hooks.ts
Normal file
18
test/helpers/plugins/stream-hooks.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user