dash-ai-chatbot: add an AI chat assistant to your Dash app with one line

Hi everyone,

We made dash-ai-chatbot, a small open-source package that adds the Asyntai AI chat assistant to any Dash app. The assistant answers your users from your own content (your pages, documents and Q&A pairs), in more than 80 languages.

Install

pip install dash-ai-chatbot

Use

from dash import Dash, html
import dash_ai_chatbot

app = Dash(__name__)
app.layout = html.Div("Hello")

dash_ai_chatbot.init_app(app, widget_id="asyntai_1a2b3c4d5e6f")

if __name__ == "__main__":
    app.run()

The chat bubble then shows on every page, also in multi-page apps.

No code change on Dash 3+

The package registers a Dash hook. Install it and set one environment variable, and every Dash app that runs with it shows the chat:

ASYNTAI_WIDGET_ID=asyntai_1a2b3c4d5e6f

Details

  • Works on Dash 2, 3 and 4 (Python 3.10+)
  • Works with a custom index_string, url_base_pathname, and apps that override interpolate_index
  • The loader waits for the page load event, so your app always renders first
  • Never adds the widget twice
  • MIT licensed

Links

Feedback and ideas are welcome!

2 Likes