Skip to content

Commit 8abbe87

Browse files
committed
fix: give more buffer to reasoning
1 parent 016b7c6 commit 8abbe87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/server/textGeneration/reasoning.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { smallModel } from "../models";
33
import { getReturnFromGenerator } from "$lib/utils/getReturnFromGenerator";
44
import { getToolOutput } from "../tools/getToolOutput";
55
import type { Tool } from "$lib/types/Tool";
6+
import { logger } from "../logger";
67

78
export async function generateSummaryOfReasoning(buffer: string): Promise<string> {
89
let summary: string | undefined;
@@ -38,6 +39,9 @@ The text might be incomplete, try your best to summarize it in one very short se
3839
preprompt,
3940
tool: summaryTool,
4041
endpoint,
42+
}).catch(() => {
43+
logger.warn("Error getting tool output");
44+
return undefined;
4145
});
4246
}
4347

@@ -47,7 +51,7 @@ The text might be incomplete, try your best to summarize it in one very short se
4751
messages: [
4852
{
4953
from: "user",
50-
content: buffer.slice(-200),
54+
content: buffer.slice(-400),
5155
},
5256
],
5357
preprompt: `You are tasked with summarizing the latest reasoning steps. Never describe results of the reasoning, only the process. Remain vague in your summary.

0 commit comments

Comments
 (0)