documate
documate copied to clipboard
BadRequestError
What operating system are you using?
Mac
Describe the bug
BadRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 4137 tokens. Please reduce the length of the messages.
Steps to reproduce
normal usage
Reproduction Link
No response
Approximately how large is your documentation website? And how long was the question?
Maybe the embeddings query returned a full 4097 tokens and then the question was put on top.
Maybe reducing the MAX_TOKEN_PER_CHUNK from 8191 to something smaller will help in upload.js https://github.com/AirCodeLabs/documate/blob/b3a0c5210426f06cffef20380952f5c739b9c77b/backend/upload.js#L7C7-L7C26
Edit: On second thought, the ask.js function is supposed to limit the data from the embeddings at 1500 tokens 🤔 So maybe there is an issue somewhere else. Ensure you have the latest version with the token limit
Thanks, I will take a trial.