Skip to content

πŸ’¬ 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

License

ryo-ma/gpt-assistants-api-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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
    • β€» Cannot be used until Azure OpenAI Service supports Streaming API
γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2023-11-20 2 23 51

🌟 Quick Start

  1. πŸ‘€ Create an assistant on the OpenAI site & Get assistant ID (https://platform.openai.com/assistants)

  2. πŸ”‘ Get the API key from OpenAI (https://platform.openai.com/api-keys)

  3. ⬇️ Clone the repository

    $ git clone https://github.com/ryo-ma/gpt-assistants-api-ui.git
  4. πŸ“¦ Install dependencies

    $ poetry install
  5. πŸ”‘ Set environment variables

    OPENAI_API_KEY="sk-xxx"
    ASSISTANT_ID="asst_xxx"
    
    ASSISTANT_TITLE="Assistants API UI"
    ENABLED_FILE_UPLOAD_MESSAGE="Upload a file" # Leave empty to disable

    If you use azure instead, set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_KEY

  6. πŸƒβ€οΈ Run the app

    $ poetry shell
    $ streamlit run app.py

🐳 Run the app using Docker

  1. πŸ‘€ Create an assistant on the OpenAI site & Get assistant ID (https://platform.openai.com/assistants)

  2. πŸ”‘ Get the API key from OpenAI (https://platform.openai.com/api-keys)

  3. ⬇️ Clone the repository

    $ git clone https://github.com/ryo-ma/gpt-assistants-api-ui.git
  4. πŸ”‘ Set environment variables

    Create a .env file.

    OPENAI_API_KEY="sk-xxx"
    ASSISTANT_ID="asst_xxx"
    
    ASSISTANT_TITLE="Assistants API UI"
    ENABLED_FILE_UPLOAD_MESSAGE="Upload a file" # Leave empty to disable

    If you use Azure instead, set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_KEY

  5. πŸ’½ Build image

    $ docker compose build
  6. πŸƒβ€οΈ 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.

About

πŸ’¬ 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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published