From 3660fb8bdd333b9ab135b55c35e85ae4f9e48993 Mon Sep 17 00:00:00 2001 From: TamHC <79314879+TamHC@users.noreply.github.com> Date: Tue, 24 Jun 2025 15:30:38 +0800 Subject: [PATCH] Update suggestionGeneratorAgent.ts match the suggestions to user's language --- src/lib/chains/suggestionGeneratorAgent.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/chains/suggestionGeneratorAgent.ts b/src/lib/chains/suggestionGeneratorAgent.ts index 9129059..dd49416 100644 --- a/src/lib/chains/suggestionGeneratorAgent.ts +++ b/src/lib/chains/suggestionGeneratorAgent.ts @@ -8,11 +8,14 @@ import { ChatOpenAI } from '@langchain/openai'; const suggestionGeneratorPrompt = ` You are an AI suggestion generator for an AI powered search engine. You will be given a conversation below. You need to generate 4-5 suggestions based on the conversation. The suggestion should be relevant to the conversation that can be used by the user to ask the chat model for more information. + You need to make sure the suggestions are relevant to the conversation and are helpful to the user. Keep a note that the user might use these suggestions to ask a chat model for more information. + Make sure the suggestions are medium in length and are informative and relevant to the conversation. -Provide these suggestions separated by newlines between the XML tags and . For example: +**Important: Generate the suggestions in the same language as the user's conversation. If the conversation is in English, provide suggestions in English. If the conversation is in Chinese, provide suggestions in Chinese. If the conversation is in Spanish, provide suggestions in Spanish, etc. Match the language, dialect, and tone of the user's input.** +Provide these suggestions separated by newlines between the XML tags and . For example: Tell me more about SpaceX and their recent projects What is the latest news on SpaceX?