A runnable Streamlit chat application using the modern OpenAI Responses API, while preserving the project's original Colab/Kaggle/Gradio notebooks as historical learning material.
ChatGPT_Web_Application.py is now the supported application entrypoint.
The app uses:
- the official OpenAI Python SDK
client.responses.create(...)response.output_textOPENAI_API_KEYfrom the environmentprevious_response_idfor multi-turn conversation state- Streamlit chat components
gpt-5.5as the default model, overridable withOPENAI_MODELor the sidebar
git clone https://github.com/AmirMotefaker/ChatGPT-Web-Application.git
cd ChatGPT-Web-Application
python -m venv .venvActivate it:
# Windows PowerShell
.venv\Scripts\Activate.ps1# macOS / Linux
source .venv/bin/activateInstall dependencies:
python -m pip install -r requirements.txtSet the API key locally:
$env:OPENAI_API_KEY = "your-key-here"or:
export OPENAI_API_KEY="your-key-here"Run the app:
streamlit run ChatGPT_Web_Application.pyThe sidebar lets you change the model and clear the current conversation. Changing the model resets the stored response chain to avoid mixing conversation state across models.
Streamlit UI
|
v
ChatGPT_Web_Application.py
|
v
openai_service.py
|
v
OpenAI Responses API
openai_service.py isolates the API call from the UI and makes the Responses API contract testable without making paid network requests.
These files are preserved as an archive of the original project:
| File | Status |
|---|---|
ChatGPT_Web_Application_colab.ipynb |
Legacy educational notebook |
ChatGPT_Web_Application_using_Streamlit_colab.ipynb |
Legacy Streamlit/Colab notebook |
ChatGPT_Web_Application_using_Gradio_colab.ipynb |
Legacy Gradio/Colab notebook |
chatgpt-web-application-kaggle.ipynb |
Legacy Kaggle notebook |
chatgpt-web-application-using-gradio.ipynb |
Legacy Gradio notebook |
Important
The historical notebooks can contain old model names or deprecated OpenAI API patterns. The root Streamlit application is the modern supported path.
python -m unittest discover -s tests -v
python -m compileall -q .GitHub Actions validates the modernization on Python 3.10 and 3.12 and performs offline unit tests, syntax compilation, secret-pattern scanning, and a guard against legacy API usage in modern entrypoints.
- Never hard-code an API key.
- Use
OPENAI_API_KEYin your environment or secret manager. .envand Streamlit secret files are ignored.- CI does not make live OpenAI API requests.
If the modern Streamlit example or legacy learning material helps you, consider giving the repository a ⭐.