-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@file
throws error for PDF files
#1044
Comments
More generally, we need a way to not allow |
I was a bit lazy with this and thought i was being conservative by only supporting what was in jupyter-ai/packages/jupyter-ai/jupyter_ai/context_providers/file.py Lines 83 to 87 in 9630742
I kind of assumed it was only some subset of text-based files and didn't notice .pdf was part of the list. So binary blobs in general should already be blocked. If were to have a more comprehensive list, should it cover all text-based files or only code related ones? Like .log or .csv files may be very long and may accidentally blowup a token budget. Should it be up to the user to manage this risk themselves? or should we do a size check? These were some questions I left to be solved in a future PR. |
@michaelchia - Thanks for responding so quickly!
|
Personally, I don't have any strong opinions whichever way on this. I'll leave it up to you guys to decide what should be supported. |
Relying on file extensions is not a very reliable method of determining a file's type; see #1030. I can help offer guidance on a plan for improving file compatibility in
|
The new feature
@file
throws an error when a PDF file is passed as context.The error arises as the
@file
command does not handle PDF files (as the encoding needs special handling).Suggested fixes:
The text was updated successfully, but these errors were encountered: