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

Refactoring AIProvider and handling errors #15

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

brichet
Copy link
Collaborator

@brichet brichet commented Nov 5, 2024

This PR is to prepare adding new providers, see #13 (comment) for context.

Changes

  • The chat and completer providers are created every time a setting change, since some of them are not updating the config after init.
  • The AIProvider is embedded in the chat handler
  • If there is an error in the settings of the chat provider or while sending a message, the error message is displayed as a chat message.
    We may want a better way to display errors (notification, header in the chat...).

Peek 2024-11-05 17-03

@brichet brichet added the enhancement New feature or request label Nov 5, 2024
@brichet
Copy link
Collaborator Author

brichet commented Nov 6, 2024

  • We may want a better way to display errors (notification, header in the chat...).

AFAIK, the current implementation of the settings panel does not allow custom validator.
The only way I can see to display a warning / error message in the settings panel is to add it in the DOM directly.

@brichet brichet requested a review from jtpio November 6, 2024 08:54
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks, looks like a good improvement already!

@jtpio jtpio merged commit 8043bf9 into jupyterlite:main Nov 6, 2024
8 checks passed
@brichet brichet deleted the error_handling branch November 6, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants