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

Add icon and name for the AI assistant #40

Merged
merged 7 commits into from
Feb 13, 2025
Merged

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Feb 13, 2025

  • Add an avatar for the AI assistant, based on the one from Jupyter AI, but using the JupyterLite colors:
  • Add personaName to the chat settings, defaulting to Jupyternaut for now

image

@jtpio jtpio added the enhancement New feature or request label Feb 13, 2025
@@ -87,7 +104,9 @@ export class ChatHandler extends ChatModel {
})
);

this.updateWriters([{ username: 'AI' }]);
const avatar = `data:image/svg+xml;base64,${AI_AVATAR_BASE64}`;
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe jupyter-chat could allow taking a LabIcon as avatar_url, or expose an avatar field which could be a LabIcon.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This interface is a copy of User.IIdentity, that is compatible with the server version of it.

In jupyterlab-chat extension, the user data are saved in the collaborative document (chat file) in plain text. I don't know if there would be a way to keep the LabIcon in this case (some kind of serialization ?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, not sure either for now (haven't investigated more), but sticking to this approach is likely fine for now.

@jtpio jtpio marked this pull request as ready for review February 13, 2025 09:06
Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Really nice, thanks @jtpio.

Comment on lines +4 to +5
"jupyter.lab.setting-icon": "@jupyterlite/ai:jupyternaut-lite",
"jupyter.lab.setting-icon-label": "JupyterLite AI Chat",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, I didn't know that 👍.

@jtpio
Copy link
Member Author

jtpio commented Feb 13, 2025

Updating the name in the settings now also updates the chat panel, thanks @brichet!

jupyterlite-ai-persona-name-update.mp4

@jtpio
Copy link
Member Author

jtpio commented Feb 13, 2025

Pushed one more change to use the jupyter chat icon in the settings:

image

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Thanks @jtpio

@brichet brichet merged commit 5443076 into jupyterlite:main Feb 13, 2025
7 checks passed
@jtpio jtpio deleted the name-icon branch February 13, 2025 21:05
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