Skip to main content

A built in data analyst for your Streamlit app

Project description

streamlit-ai-assist

streamlit-ai-assist uses the power of Snowflake Arctic, an open_source LLM, to personalize dashboards and allow all audiences to easily explore new and pre-built data visualizations. It's a built-in data analyst for your Streamlit dashboard.

If you add this component to your dashboard, dashboard viewers will be able to chat with an LLM assistant to get answers to their questions. If there are relevant graphs already in the dashboard, then the assistant will display those. If the question requires a new graph, the LLM is able to write the code to create that. These new graphs are highlighted in yellow, and if GitHub connection is configured in the app, then the user will be allowed to easily create a PR that integrates the code into the dashboard once reviewed and approved by a team member.

If a user has a particular question, the AI assistant can execute SQL SELECT statements that let it access the raw numbers. It can summarize graphs for you and return answers to a quick question you have.

The bottom view of the streamlit component is a preview of the most relevant graphs availabe in the dashboard. If you haven't formulated a question yet, a simple keyword search or "show me graphs about X" could be helpful!

Installation instructions

pip install streamlit-custom-component

Usage instructions

import streamlit as st

from streamlit_ai_assist import streamlit_ai_assit

streamlit_ai_assist(
            graphing_file_path="graphing.py",
            graphing_import_path="graphing",
            database_name="snowflake",
            general_description="This is a database for a company that does X",
            mode="chat",
            key="foo1"
)

Requirements

The following credentials are needed:

Environment Variables (can be specified in secrets.toml or with os)

REPLICATE_API_TOKEN

Database Connection Variables (must be specified in secrets.toml in a section named connections.<database_name>)

e.g.

[connections.snowflake]
type = "snowflake"
user = 
password =
account = 
role = 
warehouse = 
database = 
schema = 
client_session_keep_alive = true

Currently, only Snowflake database connections are tested and fully supported.

Optional Environment Variables

GITHUB_PERSONAL_ACCESS_TOKEN
REPO_NAME
REPO_OWNER

If these are specified, GitHub PR automation will be enabled.

Project details


Download files

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

Source Distribution

streamlit_ai_assist-0.1.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

streamlit_ai_assist-0.1.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file streamlit_ai_assist-0.1.1.tar.gz.

File metadata

  • Download URL: streamlit_ai_assist-0.1.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.1

File hashes

Hashes for streamlit_ai_assist-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df1890ebd6c9818c1c7bdb5da81cdbe11be1a2dd215fd37f5c1e1a8d091874cb
MD5 7beafe82d8dbbcd8102d7b48f929875e
BLAKE2b-256 3f431146bee5aefef99cf3c9f022a4c20d488fdb552136b8833b4939a3a3ebad

See more details on using hashes here.

File details

Details for the file streamlit_ai_assist-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_ai_assist-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d966a22cbaa6ed0559e5cb2c092bda5baa40e892be344f99253b92e092dfd49c
MD5 1a025953ac8eac8a2521b2be317c3a6b
BLAKE2b-256 9bc3915f52c34e51c589df493f4a2599af030de9211f290e9cde0d4ffd477f25

See more details on using hashes here.

Supported by

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