This PR includes several bugfixes and better GPT-4 support:
Fix issue where if all the bot posted messages in a thread are deleted (e.g., by an admin), the bot would no longer post in that thread on the next prompt.
Fix syntax tags for Matlab, JS and TS.
Fix bug with unexpected markdown translation within multiline code blocks and add unit tests.
Fix bug where if the previous message is too large (e.g., 4096 - 1024 = 3072 tokens for gpt-3.5-turbo), the bot would try to reply to an empty prompt since no recent messages fit within the context window. A warning message is now printed to the user indicating that the previous message was too large, along with the number of tokens.
Update token calculation method and context window length to handle current versions of gpt-3.5-turbo, gpt-4 and gpt-4-32k. This also follows up #11.
This PR includes several bugfixes and better GPT-4 support:
gpt-3.5-turbo
), the bot would try to reply to an empty prompt since no recent messages fit within the context window. A warning message is now printed to the user indicating that the previous message was too large, along with the number of tokens.gpt-3.5-turbo
,gpt-4
andgpt-4-32k
. This also follows up #11.