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

Respect selected persona in chat input placeholder #916

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

dlqqq
Copy link
Member

@dlqqq dlqqq commented Jul 29, 2024

Ensures that the persona (set by the selected chat model) is respected in the chat input placeholder. For example, if a custom provider defines itself a "Baguette AI" persona name and a model from that provider is selected, the chat input placeholder will read as "Ask Baguette AI" instead of "Ask Jupyternaut".

@dlqqq dlqqq added the enhancement New feature or request label Jul 29, 2024
@3coins
Copy link
Collaborator

3coins commented Jul 29, 2024

@dlqqq
This looks like a temporary solution only, as the initial input and help message both still show the default Jupyternaut, when Jupyter AI launches.

Copy link
Collaborator

@andrii-i andrii-i left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, LGTM. Please find a small suggestion below on how to simplify control flow and improve readability of getPersonaName. Please feel free to merge after implementing the suggestion or refuting it.

packages/jupyter-ai/src/components/chat.tsx Show resolved Hide resolved
packages/jupyter-ai/src/components/chat.tsx Outdated Show resolved Hide resolved
@JasonWeill
Copy link
Collaborator

Is there an intention long-term to let a human user address their message to one persona or another? If so, is there an issue for it?

@dlqqq
Copy link
Member Author

dlqqq commented Jul 29, 2024

@3coins The persona is set based on the most recent message, including the help message. If the user already configured Jupyter AI to use a custom persona before the server extension starts, the chat input will correctly display the new persona name. However, if a user switches from persona A to persona B, they will see A in the chat input placeholder until they receive a reply from B.

@JasonWeill No, that work is not related to this PR, and we have not completed a proposal for how it may be implemented. Users are free to open an issue for that feature if they'd like to encourage development.

@dlqqq dlqqq merged commit fb88723 into jupyterlab:main Jul 29, 2024
8 checks passed
@dlqqq dlqqq deleted the fix-chat-input-persona branch July 29, 2024 22:44
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
* respect selected persona in chat input placeholder

* simplify for loop in getPersonaName()

Co-authored-by: Andrii Ieroshenko <[email protected]>

---------

Co-authored-by: Andrii Ieroshenko <[email protected]>
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.

4 participants