-
-
Save FredrikOseberg/7fad0e5c1458559c544de6f0dd41e602 to your computer and use it in GitHub Desktop.
| // in config | |
| ... | |
| import Overview from "../components/widgets/Overview/Overview"; | |
| import MessageParser from "../components/widgets/MessageParser/MessageParser"; | |
| import ActionProviderDocs from "../components/widgets/ActionProvider/ActionProviderDocs"; | |
| const config = { | |
| ..., | |
| state: { | |
| gist: "", | |
| }, | |
| widgets: [ | |
| { | |
| widgetName: "overview", | |
| widgetFunc: (props) => <Overview {...props} />, | |
| mapStateToProps: ["gist"], | |
| props: {} | |
| }, | |
| { | |
| widgetName: "messageParser", | |
| widgetFunc: (props) => <MessageParser {...props} />, | |
| mapStateToProps: ["gist"], | |
| props: {} | |
| }, | |
| { | |
| widgetName: "actionProviderDocs", | |
| widgetFunc: (props) => <ActionProviderDocs {...props} />, | |
| mapStateToProps: ["gist"], | |
| props: {} | |
| }, | |
| ], | |
| }; | |
| export default config; | |
| // Use the widget in actionProvider | |
| this.createChatBotMessage("Hi", { widget: "overview" }) |
Has anybody tried to implement an image uploading widget? How does that work with this package?
Should be pretty straight forward as you just implement a regular react component as widgets. Or did you have another use case in mind?
Thank you for your quick response, Sir! Yep, I have a functional flask python backend, with NLP and CV models in it, so now, I'm sending each user input to the flask backend using a "POST" request, and the chatbot front end receives each response from the backend. For texts (strings), it's straightforward (currently I'm accessing user input in the state), but for image files, I imagine maybe they should be handled differently in MessagePraser or somewhere along the process? And lastly, I probably should create another function in the ActionProvider for Posting multipart and form-data.
How to show date before every message and add props to widget?
Has anybody tried to implement an image uploading widget? How does that work with this package?