marcolivierbouch / OpenAssistantGPT

An Open-Source Saas for Crafting/Building/Creating Chatbots with OpenAI's Assistant API that you can add to your website.
https://openassistantgpt.io
GNU Affero General Public License v3.0
206 stars 79 forks source link

Fill chat input message or execute send-button via javascript #380

Closed dhoegerlETM closed 2 weeks ago

dhoegerlETM commented 2 weeks ago

GenAI and Chatbots are often intended to help us automate dedicated tasks. In your OpenAI Assistant interface for chatbots users can ask questions, but they cannot execute more elaborated tasks easily, e.g. giving a longer context to the question or letting GPT generate some output documents/tables.

For that it would be appreciable to send some arbitrary text to the input-box "message" to pre-fill it. Or even allow to hit the send-button from hosting website (i.e. from outside).

marcolivierbouch commented 2 weeks ago

Hello @dhoegerlETM,

You can now set default messages in the iframe URL. You can visit our homepage we are currently using it or you can also check here https://www.openassistantgpt.io/docs/documentation/embed how to use this new feature!

Here's what the code looks like:

  <iframe src="https://www.openassistantgpt.io/embed/1234123/window?chatbox=false&defaultMessage=How%20many%20chatbot%20can%20I%20create%20for%20free?"
    style="margin-right: 1rem; margin-bottom: 6rem; display: none; position: fixed; right: 0; bottom: 0; pointer-events: none; overflow: hidden; height: 65vh; border: 2px solid #e2e8f0; border-radius: 0.375rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); width: 30rem;"
    allowfullscreen id="openassistantgpt-chatbot-iframe"></iframe>