Skip to content
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

Catch error on non plaintext files in @file and reply gracefully in chat #1106

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

srdas
Copy link
Collaborator

@srdas srdas commented Nov 13, 2024

Fixes #1044

If the file format (e.g. PDF) cannot be read in plaintext by file.read() the error messages appear in chat. This PR emands toe code to make sure the error is trapped and a message is sent to the user in chat explaining that @file cannot handle context files that are not plaintext.
image

Additional work is needed to handle files that can be converted to plaintext and then used in context. Next step: convert PDF files into plaintext to expand the set of file formats in @file.

@srdas srdas added the bug Something isn't working label Nov 13, 2024
@srdas srdas marked this pull request as ready for review November 13, 2024 20:30
@srdas srdas requested a review from dlqqq November 13, 2024 20:31
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srdas Awesome work, thank you!

@dlqqq dlqqq merged commit adaa3b2 into jupyterlab:main Nov 15, 2024
10 checks passed
@dlqqq
Copy link
Member

dlqqq commented Nov 15, 2024

@meeseeksdev please backport to v3-dev

meeseeksmachine pushed a commit to meeseeksmachine/jupyter-ai that referenced this pull request Nov 15, 2024
dlqqq pushed a commit that referenced this pull request Nov 15, 2024
…reply gracefully in chat (#1110)

Co-authored-by: Sanjiv Das <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@file throws error for PDF files
2 participants