Skip to content

My Chat GPT


Go to the application

Overview

A Streamlit web application that provides an interactive chat interface with OpenAI GPT models, supporting memory management, cost tracking, and persistent conversation storage.

Main functionalities

  • Interactive chat interface using Streamlit.
  • Selection of conversation memory size to control context length.
  • Choice of GPT model from a predefined set with pricing.
  • Role selection for the chatbot (assistant, developer, system).
  • Persistent storage of conversations as JSON files on local disk.
  • Customizable chatbot personality via text area.
  • Real‑time cost calculation in USD and PLN based on token usage.
  • Display of current USD/PLN exchange rate fetched from an API.
  • Ability to create new conversations or switch between existing ones.
  • Help section with step‑by‑step tips for using ChatGPT to build Python programs.

Technologies & skills

  • Python
  • Streamlit
  • OpenAI API (openai library)
  • dotenv
  • requests
  • pathlib / json

Project Report

  • Completed functional chat application with persistent storage and cost tracking.

Sample photos

<figcaption>Two ways of entering API_KEY</figcaption>
Two ways of entering API_KEY
<figcaption>Model_chose</figcaption>
Model_chose
<figcaption>Chat_role</figcaption>
Chat_role
<figcaption>Chat memory & Tips</figcaption>
Chat memory & Tips

Application usage

  • Open the Streamlit app in a browser.
  • Configure conversation memory, model, and role in the sidebar.
  • Enter prompts into the chat input to interact with GPT.
  • Monitor cost metrics (USD/PLN) on the sidebar.
  • Manage conversations: rename, create new, load existing.

Where to get API key and addresses?

  1. OpenAI API Key (openai_api_key):
  2. Visit the OpenAI API Keys page.
  3. Log in to your account or create a new one.
  4. Click "Create API key" and copy the key.

Example configuration file:

OPENAI_API_KEY=your-openai-api-key

Go to the application