InAnYan / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
0 stars 0 forks source link

Make a user friendly error message from `langchain4j` #23

Open InAnYan opened 5 months ago

InAnYan commented 5 months ago

Is your suggestion for improvement related to a problem? Please describe. In case of any errors while chatting with AI, langchain4j will throw a kind of RuntimeError.

Currently, the JabRef presents user a raw error message, that is too scary for user.

Describe the solution you'd like Check the kind of error and provide user with a clear, simple, and internationalized message.

Additional context An example, if user has entered a wrong OpenAI API token: изображение

InAnYan commented 5 months ago

That's so awful. All errors are RuntimeErrors and I can't understand what errors can be.

I guess for now let's focus on two cases: 1) No internet 2) Wrong token 3) No money 4) Message is too large

InAnYan commented 5 months ago

Umm, I can't find those errors)

InAnYan commented 5 months ago

изображение

☠️

ThiloteE commented 4 months ago

Low prio for now.

InAnYan commented 3 months ago

Problems with errors: 1) There are no unified error types or classes from langchain4j. Every library, every AI provider has its own exceptions, that are extended from or wrapped into the RuntimeException

2) Some AI libraries don't even differentiate errors, and they just put JSON payload from server response into a general error type