Closed rihp closed 1 year ago
We could try to implement it at this level
checkIfFunctionWasProposed(
response: ChatCompletionResponseMessage
): ChatCompletionRequestMessageFunctionCall | undefined {
if (response.function_call) {
return response.function_call;
} else {
this._chatInteractions.push({ role: "assistant", content: response.content! });
return undefined;
}
}
Todo: add function calling to history for better memory management
We can create something like a mapping of previous commands called so that algorithmically we handle when the bot is about to call the same command twice, this is very annoying specially when calling functions that are long and token expensive, like double browsing the same website