An AI Chat interface for Shiny apps.
Project description
shinychat
Chat UI component for Shiny for Python.
Note: shinychat is automatically installed with Shiny for Python and available as shiny.ui.Chat and shiny.express.ui.Chat. For complete instructions about creating chatbots please see the Shiny for Python documentation.
Installation
You can install shinychat from PyPI with:
uv pip install shinychat
Or, install the development version of shinychat from GitHub with:
uv pip install git+https://github.com/posit-dev/shinychat.git
Example
from shiny.express import render, ui
from shinychat.express import Chat
# Set some Shiny page options
ui.page_opts(title="Hello Chat")
# Create a chat component, with an initial message
chat = Chat(
id="chat",
messages=[
{"content": "Hello! How can I help you today?", "role": "assistant"},
],
)
# Display the chat
chat.ui()
# Define a callback to run when the user submits a message
@chat.on_user_submit
async def handle_user_input(user_input: str):
await chat.append_message(f"You said: {user_input}")
"Message state:"
@render.code
def message_state():
return str(chat.messages())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shinychat-0.2.4.tar.gz.
File metadata
- Download URL: shinychat-0.2.4.tar.gz
- Upload date:
- Size: 547.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22169643a4e4ae88eb4f65073b94ee4e5229db23b74596f20b0f570e39d08780
|
|
| MD5 |
49fec4dcc145688075b7d0609cf818e3
|
|
| BLAKE2b-256 |
f608d2ad096fb0b878b8349f79a8e0948bad8d2568ef7882f4f260f5fc5a9215
|
Provenance
The following attestation bundles were made for shinychat-0.2.4.tar.gz:
Publisher:
py-release.yaml on posit-dev/shinychat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shinychat-0.2.4.tar.gz -
Subject digest:
22169643a4e4ae88eb4f65073b94ee4e5229db23b74596f20b0f570e39d08780 - Sigstore transparency entry: 496821335
- Sigstore integration time:
-
Permalink:
posit-dev/shinychat@2e8c5e8a1015e7db218ba98d9050611b9699d419 -
Branch / Tag:
refs/tags/py/v0.2.4 - Owner: https://github.com/posit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-release.yaml@2e8c5e8a1015e7db218ba98d9050611b9699d419 -
Trigger Event:
release
-
Statement type:
File details
Details for the file shinychat-0.2.4-py3-none-any.whl.
File metadata
- Download URL: shinychat-0.2.4-py3-none-any.whl
- Upload date:
- Size: 560.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6460044ee32b3d73dbd359d477c697b745bb2de410e672a6e8aaf8cf1e7b9d1a
|
|
| MD5 |
0411336dc78096d5613bfc57de2b7218
|
|
| BLAKE2b-256 |
211554a911abf0d1ac8b4333a10395ce58da5de3b064eb48b1e9d81100b0b0ea
|
Provenance
The following attestation bundles were made for shinychat-0.2.4-py3-none-any.whl:
Publisher:
py-release.yaml on posit-dev/shinychat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shinychat-0.2.4-py3-none-any.whl -
Subject digest:
6460044ee32b3d73dbd359d477c697b745bb2de410e672a6e8aaf8cf1e7b9d1a - Sigstore transparency entry: 496821355
- Sigstore integration time:
-
Permalink:
posit-dev/shinychat@2e8c5e8a1015e7db218ba98d9050611b9699d419 -
Branch / Tag:
refs/tags/py/v0.2.4 - Owner: https://github.com/posit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-release.yaml@2e8c5e8a1015e7db218ba98d9050611b9699d419 -
Trigger Event:
release
-
Statement type: