feat(FunctionsAgent): improve LLM instructions for more reliable results

This commit is contained in:
Daniel Avila 2023-06-14 18:11:58 -04:00 committed by Danny Avila
parent 9f930ecf7d
commit 7053d76f48
3 changed files with 10 additions and 5 deletions

View file

@ -7,8 +7,8 @@ const {
SystemMessagePromptTemplate,
HumanMessagePromptTemplate
} = require('langchain/prompts');
const PREFIX = `You are a helpful AI assistant. Objective: Understand the human's query with available functions.
The user is expecting a function response to the query; if only part of the query involves a function, prioritize the function response.`;
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`;
function parseOutput(message) {
if (message.additional_kwargs.function_call) {