Open schnaker85 opened 3 weeks ago
It seems like a good approach. However, when actually implemented, a problem occurs where the token part becomes NaN when encoding the file.
I think there is a part that processes images as tokens, but there is none for files, so I suggest adding exception handling for this.
// OpenAIClient.js
async buildMessage() {
...
// after 530 line
// There is a token calculation logic for images, but there is no calculation logic for non-images, so exclude it.
if (!file.type.startsWith('image')) {
continue;
}
...
}
Thanks :)
Summary
Related Issue: This is the PR for https://github.com/danny-avila/LibreChat/issues/4502 I made it WIP because the discussion in a feature might lead to changes
Changes in the code:
Change Type
Please delete any irrelevant options.
Checklist
Please delete any irrelevant options.