OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.43k stars 218 forks source link

Help needed to send text or user prompt inside code #183

Closed madhumeher0037 closed 2 months ago

madhumeher0037 commented 4 months ago

Hello,

I'm using the deep-chat library in our application. I have a scenario where I want to provide user prompts within the code instead of taking text from an input text box.

To explain further, I am saving all messages in the Redux store. I have also created a history page where I display all the messages from the entire session. Now, when a user clicks on any user prompt message in the history page, I want that message to appear in the input box of the deep-chat component. Alternatively, I'd like to send a request to the server.

Is there any way I can send text to the deep-chat component programmatically?

OvidijusParsiunas commented 4 months ago

Hi @madhumeher0037.

Currently you can't replace the input text programmatically (without traversing the DOM tree which we do not recommend), but you can alternatively send a message to the server via the use of the submitUserMessage method. Let me know if this helps.

Thanks!

OvidijusParsiunas commented 2 months ago

Since there has been no further communication, I will be closing this issue.