Enter into the project directory
$ cd stremlit-openai
Create a Python virtual environment,
$ poetry env use python3.12
Activate the Python virtual environment,
$ poetry shell
Install Python packages
$ poetry install
Open the secrets file of Streamlit on your machine, e.g. ~/.streamlit/secrets.toml
, and put the OpenAI API key there.
openai_api_key = sk-xxxxxx
Run the example app with Streamlit
$ streamlit run src/streamlit_openai/main.py
Then visit `http://127.0.0.1:8501.