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

feat: Add support for feedback events on chatbot responses #2165 #2178

Merged
merged 12 commits into from
Nov 8, 2023

Conversation

marek-mihok
Copy link
Contributor

@marek-mihok marek-mihok commented Oct 27, 2023

The PR fulfills these requirements: (check all the apply)

  • It's submitted to the main branch.
  • When resolving a specific issue, it's referenced in the PR's title (e.g. feat: Add a button #xxx, where "xxx" is the issue number).
  • When resolving a specific issue, the PR description includes Closes #xxx, where "xxx" is the issue number.
  • If changes were made to ui folder, unit tests (make test) still pass.
  • New/updated tests are included

Usage example:

Screen.Recording.2023-11-08.at.15.15.04.mov

This PR also features an API change - added a feedback event:

/** Create a chatbot card to allow getting prompts from users and providing them with LLM generated answers. */
export interface Chatbot {
  /** An identifying name for this component. */
  name: Id
  /** Chat messages data. Requires list or cyclic buffer. */
  data: Rec
  /** Chat input box placeholder. Use for prompt examples. */
  placeholder?: S
  /** The events to capture on this chatbot. One of 'stop' | 'scroll_up' | 'feedback'. */
  events?: S[]
  /** True to show a button to stop the text generation. Defaults to False. */
  generating?: B
  /** The previous messages to show as the user scrolls up. */
  prev_items?: ChatbotMessage[]
}

Closes #2165

@marek-mihok marek-mihok marked this pull request as ready for review October 27, 2023 22:05
Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

Thanks @marek-mihok!

ui/src/chatbot.tsx Outdated Show resolved Hide resolved
website/widgets/ai/chatbot.md Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Show resolved Hide resolved
ui/src/chatbot.test.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.test.tsx Outdated Show resolved Hide resolved
ui/src/chatbot.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @marek-mihok!

@mturoci mturoci merged commit 4a7237b into main Nov 8, 2023
2 checks passed
@mturoci mturoci deleted the feat/issue-2165 branch November 8, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Like/Dislike and Events for ChatBot
2 participants