ryo-ma/gpt-assistants-api-ui
关于
💬 OpenAI Assistants API chat UI 🛠️ It works easily by setting the ASSISTANT ID 📁 Supports file upload and file download 🏃 Supports Streaming API 🪟 Support to Azure OpenAI
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文gpt-assistants-api-ui
- 💬 OpenAI Assistants API chat UI
- 🛠️ It works quickly by setting the ASSISTANT IDs
- 📁 Supports file upload and file download
- 🏃 Supports Streaming API
- 👥 Supports multiple Assistant profiles in one place
- 🪟 Support to Azure OpenAI
- ※ Cannot be used until Azure OpenAI Service supports Streaming API
🌟 Quick Start
👤 Create an assistant on the OpenAI site & Get assistant ID (https://platform.openai.com/assistants)
🔑 Get the API key from OpenAI (https://platform.openai.com/api-keys)
⬇️ Clone the repository
$ git clone https://github.com/ryo-ma/gpt-assistants-api-ui.git📦 Install dependencies
$ poetry install⚙️ Set environment variables file
.env# OpenAI settings OPENAI_API_KEY="sk-xxx" # When using only one assistant, set the following, unset the OPENAI_ASSISTANTS variable. ASSISTANT_ID="asst_xxx" ASSISTANT_TITLE="Assistants API UI" # This is for the single agent title # When using multiple assistants, set the following. OPENAI_ASSISTANTS='[{"id": "asst_xxx", "title": "Assistants XXX UI"}, {"id": "asst_yyy", "title": "Assistants YYY UI"}]' # App settings ENABLED_FILE_UPLOAD_MESSAGE="Upload a file" # Leave empty to disable AUTHENTICATION_REQUIRED="False" # Must change to True if you require authenticationIf you use azure instead, set
AZURE_OPENAI_ENDPOINTandAZURE_OPENAI_KEY🔑 Set Authentication configuration (optional)
To set up authentication, create a secrets file
.streamlit/secrets.tomlas below:[credentials] usernames = { jsmith = {failed_login_attempts = 0, logged_in = false, name = "John Smith", password = "abc"}, rbriggs = {failed_login_attempts = 0, logged_in = false, name = "R Briggs", password = "abc"}} [cookie] expiry_days = 30 key = "some_signature_key" # Must be string name = "some_cookie_name"Reference: Deploying Streamlit-Authenticator via Streamlit Community Cloud
🏃️ Run the app using Streamlit
$ poetry shell
$ streamlit run app.py
🐳 Run the app using Docker
💽 Build image
$ docker compose build🏃️ Run the app
$ docker compose up
Access to http://localhost:8501.
🌐 Deploy to Streamlit Cloud
You can fork this repository and deploy the app to https://share.streamlit.io/. No need to run the app on your local machine.
Don't forget to choose 3.10 as the Python version and set environment variables in the "Advanced settings" during deployment.
To use authentication with Streamlit Cloud, please use this TOML format:
# Environment variables
# OpenAI settings
OPENAI_API_KEY="sk-xxx"
# When using only one assistant, set the following, unset the OPENAI_ASSISTANTS variable.
ASSISTANT_ID="asst_xxx"
ASSISTANT_TITLE="Assistants API UI" # This is for the single agent title
# When using multiple assistants, set the following.
OPENAI_ASSISTANTS='[{"id": "asst_xxx", "title": "Assistants XXX UI"}, {"id": "asst_yyy", "title": "Assistants YYY UI"}]'
# App settings
ENABLED_FILE_UPLOAD_MESSAGE="Upload a file" # Leave empty to disable
AUTHENTICATION_REQUIRED="False" # Must change to True if you require authentication
# Authentication secrets
[credentials]
usernames = { jsmith = {failed_login_attempts = 0, logged_in = false, name = "John Smith", password = "abc"}, rbriggs = {failed_login_attempts = 0, logged_in = false, name = "R Briggs", password = "abc"}}
[cookie]
expiry_days = 30
key = "some_signature_key" # Must be string
name = "some_cookie_name"
探索相关项目
加载中…