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

Enable conversation starters #68

Closed
salmenus opened this issue May 31, 2024 · 9 comments
Closed

Enable conversation starters #68

salmenus opened this issue May 31, 2024 · 9 comments
Assignees
Labels
new feature New feature to add to core product

Comments

@salmenus
Copy link
Member

Add an option to allow developers to add conversation starters.

  • Option: conversationOptions.conversationStarters: ConversationStarter[]
  • Types:
type ConversationStarter {
    prompt: string;
    label?: string;
    icon?: string | JSX.Element;
}
  • Behaviour:
  • When the conversation is empty (no history, no prompt submitted yet), if the conversationStarters is provided, display a list possible conversation starters matching the options provided.
  • When the user clicks on one of the conversation starters, submit the value in the prompt attribute to the chat.
  • If the submission fails, re-display conversation starters.
  • If too many conversation starters are provided and cannot fit in the UI, activate horizontal scrolling.
  • Equivalent feature in ChatGPT UI:
    Image
@salmenus salmenus self-assigned this May 31, 2024
@salmenus salmenus converted this from a draft issue May 31, 2024
@salmenus salmenus added the new feature New feature to add to core product label May 31, 2024
@salmenus salmenus pinned this issue Jun 7, 2024
@salmenus
Copy link
Member Author

Feature now available here: https://docs.nlkit.com/nlux/examples/conversation-starters

@salmenus salmenus moved this from In progress to Done in NLUX Feature Roadmap Jun 11, 2024
@salmenus salmenus unpinned this issue Jun 11, 2024
@MichaelHefetz
Copy link

Hi, any chance to implement the label and icon as in the proposal? Currently only prompt is used inside the starter card
Thank you

@salmenus salmenus moved this from Done to In progress in NLUX Feature Roadmap Jun 17, 2024
@salmenus salmenus reopened this Jun 17, 2024
@salmenus
Copy link
Member Author

Hi @MichaelHefetz — Sure, we can get that for you.
Re-opening. I'll post an update here once it's ready (ETA 48h)

@salmenus salmenus pinned this issue Jun 17, 2024
@somebodyawesome-dev
Copy link
Contributor

I will work on this ticket. and finish up the missing details

@salmenus
Copy link
Member Author

Thanks @somebodyawesome-dev — Much appreciated 🙌
Ping me on Discord if you need any help

@somebodyawesome-dev
Copy link
Contributor

linked to #91

@salmenus
Copy link
Member Author

PR merged and change published. Ready for you @MichaelHefetz

Config example:

conversationOptions={{
    conversationStarters: [
        {
            icon: <span>📝</span>, // When string is provided, it will be considered an image URL
            label: 'Write a poem',
            prompt: 'Write a poem about the stars and magic, using the words "twinkle" and "sparkle".'
       },
       {prompt: 'What is your name?'},
       {prompt: 'What is your favorite color?'}
    ]
}}

Prompt is the only required attribute.
Give it a try and let us know how it works for you @MichaelHefetz

Thanks @somebodyawesome-dev for delivering this 🙌 😎

@MichaelHefetz
Copy link

Thank you! It works now :)
The only issue is with the long labels/prompts. The ellipsis is gone now and also the bottom padding

image

@salmenus
Copy link
Member Author

@MichaelHefetz feature updated in 2.8.2 — Ellipsis should work now.
https://docs.nlkit.com/nlux/examples/conversation-starters

Also you can easily configure dimensions of the boxes using CSS:
https://github.com/nlkitai/nlux/blob/latest/packages/css/themes/src/dev/layout.css#L22

I hope this solves all your problems.
Closing if no further comments.

@github-project-automation github-project-automation bot moved this from In progress to Done in NLUX Feature Roadmap Jun 25, 2024
@salmenus salmenus unpinned this issue Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature to add to core product
Projects
Status: Done
Development

No branches or pull requests

3 participants