An interface to analyze photos with ChatGPT since there is currently a waitlist for ChatGPT Plus. Seen in How do Multimodal AI models work? Simple explanation
- Ensure you have python installed
python -m venv venv
to create a virtual environment. venv/bin/activate
to activate the virtual environment on Mac/Linux and.\venv\Scripts\activate.bat
on Windowspip install -r requirements.txt
to install requirements- Rename
.env.example
to.env
and paste your OpenAI API key in place ofyour-key-here
in the file- IMPORTANT: Make sure to never share this file with anyone or check it in to source control
- From the project directory, open a terminal and activate the virtual environment
. venv/bin/activate
to activate the virtual environment on Mac/Linux and.\venv\Scripts\activate.bat
on Windows
- Run
streamlit run app.py
in a terminal (with the virtual environment activated) to launch the app - You can type a message to get a response
- Or you can upload an image to ask something about it. Here I uploaded
component.png
and asked ChatGPT to write the code for the interface. Then output can be seen incomponent.html
.
- The chat has memory so you can ask about previous messages
I had a conversation with ChatGPT to write the interface in chat.ipynb
. First, I wrote some simple code to interact with ChatGPT via the OpenAI API. Then, I asked ChatGPT to write a streamlit app, passing in an image of what I wanted (ui.png
). I then asked for with follow up changes to iteratively alter the interface. The final application code is in app.py
. It even made changes to the original code that I used to interact with it. The final code can be seen in chat_bot.py
.
images/
- images for this readmeapp.py
- Streamlit UI that ChatGPT wrotechat_bot.py
- simple class for interacting with ChatGPT via OpenAI APIchat.ipynb
- Jupyter notebook showing chat with ChatGPT that lead to the final forms ofapp.py
andchat_bot.py
component.png
- diagram of signup form used to show how Streamlit UI workscomponent.html
- code that ChatGPT wrote when asked to create a working HTML component forcomponent.png
ui.png
- drawing of desired Streamlit UI interface