Skip to main content

shinychat

shinychat for Python website

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())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shinychat-0.6.1.tar.gz (426.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shinychat-0.6.1-py3-none-any.whl (439.1 kB view details)

Uploaded Python 3

File details

Details for the file shinychat-0.6.1.tar.gz.

File metadata

  • Download URL: shinychat-0.6.1.tar.gz
  • Upload date:
  • Size: 426.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for shinychat-0.6.1.tar.gz
Algorithm Hash digest
SHA256 f57f39a1dd60332205c9ced44807b70d7874c0f369475b1395f3f9322002456c
MD5 5a05fdbbf846e88d4f63919c090692b4
BLAKE2b-256 d319c37d9047de9f3367b01d1d4fbdc8507c30e4af854796684ec024b242be30

See more details on using hashes here.

Provenance

The following attestation bundles were made for shinychat-0.6.1.tar.gz:

Publisher: py-release.yaml on posit-dev/shinychat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shinychat-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: shinychat-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 439.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for shinychat-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc4c742bfec391e933ceaa470c12c7c5f204ba6bb53f97cc5ba3567720b0e525
MD5 8125e61ecc61e39ced14eff1bfbe50e3
BLAKE2b-256 1ba603d47e4257a9dce48f07a4c5934de02e300749c9a58f873294fc92652f8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for shinychat-0.6.1-py3-none-any.whl:

Publisher: py-release.yaml on posit-dev/shinychat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page