From e93ae594825d71471438adc11c99eeb306b4e392 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 21 Nov 2024 08:38:00 -0800 Subject: [PATCH] adjust prompting --- core/llm/constructMessages.ts | 5 ++++- core/tools/searchWeb.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/llm/constructMessages.ts b/core/llm/constructMessages.ts index 8b381f5fb..836d6c442 100644 --- a/core/llm/constructMessages.ts +++ b/core/llm/constructMessages.ts @@ -56,7 +56,10 @@ function helloWorld() { } \`\`\` -Always follow these guidelines when generating code responses.`; +Always follow these guidelines when generating code responses. + +Other rules: +- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.`; function hasCodeBlockWithFilename(content: ChatMessage["content"]): boolean { const contentStr = typeof content === "string" ? content : content[0].text; diff --git a/core/tools/searchWeb.ts b/core/tools/searchWeb.ts index 8f438ce2f..4a7c32788 100644 --- a/core/tools/searchWeb.ts +++ b/core/tools/searchWeb.ts @@ -9,7 +9,8 @@ export const searchWebTool: Tool = { }, function: { name: "search_web", - description: "Perform a web search and get back top results", + description: + "Performs a web search, returning top results. This tool should only be called for questions that require external knowledge. Common programming questions do not require web search.", parameters: { type: "object", required: ["query"],