Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

refactor(FunctionsAgent.js): remove unnecessary text from PREFIX constant

Daniel Avila5b1efc48d195
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')
]);
}