nsarrazin HF Staff commited on
Commit
8ce2fb0
·
1 Parent(s): 150ff48

fix: give more buffer to reasoning

Browse files
src/lib/server/textGeneration/reasoning.ts CHANGED
@@ -3,6 +3,7 @@ import { smallModel } from "../models";
3
  import { getReturnFromGenerator } from "$lib/utils/getReturnFromGenerator";
4
  import { getToolOutput } from "../tools/getToolOutput";
5
  import type { Tool } from "$lib/types/Tool";
 
6
 
7
  export async function generateSummaryOfReasoning(buffer: string): Promise<string> {
8
  let summary: string | undefined;
@@ -38,6 +39,9 @@ The text might be incomplete, try your best to summarize it in one very short se
38
  preprompt,
39
  tool: summaryTool,
40
  endpoint,
 
 
 
41
  });
42
  }
43
 
@@ -47,7 +51,7 @@ The text might be incomplete, try your best to summarize it in one very short se
47
  messages: [
48
  {
49
  from: "user",
50
- content: buffer.slice(-200),
51
  },
52
  ],
53
  preprompt: `You are tasked with summarizing the latest reasoning steps. Never describe results of the reasoning, only the process. Remain vague in your summary.
 
3
  import { getReturnFromGenerator } from "$lib/utils/getReturnFromGenerator";
4
  import { getToolOutput } from "../tools/getToolOutput";
5
  import type { Tool } from "$lib/types/Tool";
6
+ import { logger } from "../logger";
7
 
8
  export async function generateSummaryOfReasoning(buffer: string): Promise<string> {
9
  let summary: string | undefined;
 
39
  preprompt,
40
  tool: summaryTool,
41
  endpoint,
42
+ }).catch(() => {
43
+ logger.warn("Error getting tool output");
44
+ return undefined;
45
  });
46
  }
47
 
 
51
  messages: [
52
  {
53
  from: "user",
54
+ content: buffer.slice(-400),
55
  },
56
  ],
57
  preprompt: `You are tasked with summarizing the latest reasoning steps. Never describe results of the reasoning, only the process. Remain vague in your summary.