mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:28:37 +00:00
fix: satisfy ollama stream lint follow-up (openclaw#11853) thanks @BrokenFinger98
This commit is contained in:
@@ -274,8 +274,11 @@ describe("createOllamaStreamFn", () => {
|
|||||||
const [url, requestInit] = fetchMock.mock.calls[0] as [string, RequestInit];
|
const [url, requestInit] = fetchMock.mock.calls[0] as [string, RequestInit];
|
||||||
expect(url).toBe("http://ollama-host:11434/api/chat");
|
expect(url).toBe("http://ollama-host:11434/api/chat");
|
||||||
expect(requestInit.signal).toBe(signal);
|
expect(requestInit.signal).toBe(signal);
|
||||||
|
if (typeof requestInit.body !== "string") {
|
||||||
|
throw new Error("Expected string request body");
|
||||||
|
}
|
||||||
|
|
||||||
const requestBody = JSON.parse(String(requestInit.body)) as {
|
const requestBody = JSON.parse(requestInit.body) as {
|
||||||
options: { num_ctx?: number; num_predict?: number };
|
options: { num_ctx?: number; num_predict?: number };
|
||||||
};
|
};
|
||||||
expect(requestBody.options.num_ctx).toBe(131072);
|
expect(requestBody.options.num_ctx).toBe(131072);
|
||||||
|
|||||||
Reference in New Issue
Block a user