Metadata-Version: 2.4
Name: streamlit-ai-chatbot
Version: 1.0.0
Summary: Adds the Asyntai AI chat assistant to a Streamlit app. It answers visitor questions from your own content, in more than 80 languages.
Author-email: Asyntai <hello@asyntai.com>
License-Expression: MIT
Project-URL: Homepage, https://asyntai.com
Project-URL: Documentation, https://asyntai.com/documentation/integrations/streamlit/
Project-URL: Source, https://github.com/asyntai/streamlit-ai-chatbot
Project-URL: Issues, https://github.com/asyntai/streamlit-ai-chatbot/issues
Keywords: streamlit,streamlit-component,chatbot,ai,ai-chatbot,live-chat,customer-support,assistant,widget
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit>=1.28
Dynamic: license-file

# streamlit-ai-chatbot

Adds the [Asyntai](https://asyntai.com) AI chat assistant to a Streamlit app.
The assistant answers visitor questions from your own content, day and night,
in more than 80 languages.

Free and open source. Works on every Asyntai plan, including the free plan.

- Requires Streamlit 1.28 or newer and Python 3.10 or newer
- Documentation: https://asyntai.com/documentation/integrations/streamlit/

## Install

```
pip install streamlit-ai-chatbot
```

## Use

Call `chatbot()` once near the top of your app:

```python
import streamlit as st
from streamlit_ai_chatbot import chatbot

chatbot("asyntai_ab12cd34")

st.title("My app")
```

You get the ID from the Install page of your
[Asyntai dashboard](https://asyntai.com/dashboard). You can paste the whole
snippet; the package keeps only the ID.

The chat button appears in the corner of the page. It stays open when the
app reruns, and it loads only once per browser tab.

## Keep the ID out of your code

Leave out the ID, and the package reads `ASYNTAI_WIDGET_ID` from
`st.secrets` or from the environment:

```toml
# .streamlit/secrets.toml
ASYNTAI_WIDGET_ID = "asyntai_ab12cd34"
```

```python
chatbot()
```

This also works on Streamlit Community Cloud: add the line in the app's
Secrets settings.

## Multipage apps

With `st.navigation`, call `chatbot()` in the main file, before
`pg.run()`. With a `pages/` folder, call it at the top of each page.

## Options

```python
chatbot(
    "asyntai_ab12cd34",
    script_url="https://widget.asyntai.com/static/js/chat-widget.js",  # optional
)
```

`chatbot()` returns `True` when the chat is on the page. With an ID that is
not valid it shows nothing, returns `False` and logs a warning.

## How it works

On Streamlit 1.52 and newer, the package uses `st.html` to add the widget
script to the page. On older versions it uses a hidden component. Either way,
the empty block is hidden, so your layout does not change.

## What the assistant does

- Answers visitor questions from your website, documents and FAQ
- Collects leads and hands the chat to a person when needed
- Works in more than 80 languages

Set it up and train it in your [Asyntai dashboard](https://asyntai.com).

## License

MIT
