Skip to content

Commit 0a723f9

Browse files
committed
fix: satisfy ollama stream lint follow-up (#11853) thanks @BrokenFinger98
1 parent c1f828e commit 0a723f9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/agents/ollama-stream.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,11 @@ describe("createOllamaStreamFn", () => {
274274
const [url, requestInit] = fetchMock.mock.calls[0] as [string, RequestInit];
275275
expect(url).toBe("http://ollama-host:11434/api/chat");
276276
expect(requestInit.signal).toBe(signal);
277+
if (typeof requestInit.body !== "string") {
278+
throw new Error("Expected string request body");
279+
}
277280

278-
const requestBody = JSON.parse(String(requestInit.body)) as {
281+
const requestBody = JSON.parse(requestInit.body) as {
279282
options: { num_ctx?: number; num_predict?: number };
280283
};
281284
expect(requestBody.options.num_ctx).toBe(131072);

0 commit comments

Comments
 (0)