Refactor which moves the logic for detecting triggered defences on the bot output out of the openai.ts file.
Notes
the chat controller is now in charge of adding user and bot messages to the chat history.
new pushMessageToHistory util method which trims the chat history length when a new message is added to it.
Concerns
I refactored chatGptSendMessage to return a list of emails that were sent as a result of a user's message, rather than returning the list of ALL emails sent that level. I was also tempted to do the same for chat history... so return a list of new messages rather than the list of ALL messages for that level. Turns out this is a bit of work, so I've made #756 for this.
Description
Refactor which moves the logic for detecting triggered defences on the bot output out of the openai.ts file.
Notes
pushMessageToHistory
util method which trims the chat history length when a new message is added to it.Concerns
chatGptSendMessage
to return a list of emails that were sent as a result of a user's message, rather than returning the list of ALL emails sent that level. I was also tempted to do the same for chat history... so return a list of new messages rather than the list of ALL messages for that level. Turns out this is a bit of work, so I've made #756 for this.Checklist
Have you done the following?