From f43ea8c51da48679290e596159d9c69c44a4d12f Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 18 Dec 2024 17:00:57 -0800 Subject: [PATCH] avoid truncation of ChatDescriber titles --- core/util/chatDescriber.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/util/chatDescriber.ts b/core/util/chatDescriber.ts index e4fce3ecd..5b5ac5f4d 100644 --- a/core/util/chatDescriber.ts +++ b/core/util/chatDescriber.ts @@ -1,13 +1,13 @@ import { ILLM, LLMFullCompletionOptions } from ".."; -import { removeQuotesAndEscapes, removeCodeBlocksAndTrim } from "."; +import { removeCodeBlocksAndTrim, removeQuotesAndEscapes } from "."; -import type { IMessenger } from "../protocol/messenger"; import type { FromCoreProtocol, ToCoreProtocol } from "../protocol"; +import type { IMessenger } from "../protocol/messenger"; export class ChatDescriber { static prompt: string | undefined = - "Given the following... please reply with a short summary that is 4-12 words in length, you should summarize what the user is asking for OR what the user is trying to accomplish. You should only respond with the summary, no additional text or explanation, you don't need ending punctuation.\n\n"; + "Given the following... please reply with a short summary that is 4-8 words in length, you should summarize what the user is asking for OR what the user is trying to accomplish. You should only respond with the summary, no additional text or explanation, you don't need ending punctuation.\n\n"; static messenger: IMessenger; static async describe( @@ -26,7 +26,7 @@ export class ChatDescriber { return; } - completionOptions.maxTokens = 6; + completionOptions.maxTokens = 12; // Prompt the user's current LLM for the title const titleResponse = await model.chat(