From 5b1efc48d195074db4e7089d54f4735c1d220cc6 Mon Sep 17 00:00:00 2001 From: Daniel Avila Date: Thu, 15 Jun 2023 18:33:51 -0400 Subject: [PATCH] refactor(FunctionsAgent.js): remove unnecessary text from PREFIX constant --- api/app/langchain/agents/Functions/FunctionsAgent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/app/langchain/agents/Functions/FunctionsAgent.js b/api/app/langchain/agents/Functions/FunctionsAgent.js index 2be7bef609..ed08947fa6 100644 --- a/api/app/langchain/agents/Functions/FunctionsAgent.js +++ b/api/app/langchain/agents/Functions/FunctionsAgent.js @@ -8,7 +8,7 @@ const { HumanMessagePromptTemplate } = require('langchain/prompts'); const PREFIX = `You are a helpful AI assistant. Objective: Resolve the user's query with provided functions. -The user is demanding a function response to the query; if any part of the query requires a function, respond with the function call first since you won't get to later`; +The user is demanding a function response to the query.`; function parseOutput(message) { if (message.additional_kwargs.function_call) { @@ -53,8 +53,7 @@ class FunctionsAgent extends Agent { return ChatPromptTemplate.fromPromptMessages([ SystemMessagePromptTemplate.fromTemplate(`Date: ${currentDateString}\n${prefix}`), HumanMessagePromptTemplate.fromTemplate(`{chat_history} -Query: {input} -{agent_scratchpad}`), +Query: {input}`), new MessagesPlaceholder('agent_scratchpad') ]); }