Handle unregistered function calls

This commit is contained in:
Wroclaw 2023-07-30 01:51:40 +02:00
parent 000641bcfc
commit 0e3962e110
2 changed files with 23 additions and 9 deletions

View file

@ -260,12 +260,10 @@ async function executeFromQueue(channel: string) {
// handle function calls
if (generatedMessage.function_call) {
OpenAImessages.push(generatedMessage);
OpenAImessages.push({
role: "function",
name: generatedMessage.function_call.name,
// FIXME: don't use new instance of FunctionManager
content: new FunctionManager().handleFunction(generatedMessage.function_call),
});
// FIXME: don't use new instance of FunctionManager
OpenAImessages.push(
new FunctionManager().handleFunction(generatedMessage.function_call)
);
}
} while (generatedMessage.function_call);