This change improves the ui.chatbot component by allowing user to stop the generation of bot's response with a Stop generating button. This button is visible only if a new generating prop is set to True and the stop event is triggered only if it is registered within events prop first, please see the updated API:
/** 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 cyclic buffer. */
data: Rec[]
/** Chat input box placeholder. Use for prompt examples. */
placeholder?: S
/** The events to capture on this chatbot. One of 'stop'. */
events?: S[]
/** True to show a button to stop the text generation. Defaults to False. */
generating?: B
}
@mturoci good point! It's added. Also I've updated our tour examples with a new chatbot_events_stop.py example. It uses a map buffer for now, but we can update it once the new list buffer is merged.
This change improves the
ui.chatbot
component by allowing user to stop the generation of bot's response with a Stop generating button. This button is visible only if a newgenerating
prop is set toTrue
and thestop
event is triggered only if it is registered withinevents
prop first, please see the updated API:Closes #2011