One day when I was bored, I wondered what a conversation between GPT-4o (2024), the world-famous AI, and ELIZA (1964), one of the first (the first?) conversational AI in the history of computing, would look like. If you're a somewhat older geek, you probably know ELIZA! It's the "doctor" integrated into Emacs, but also the basis used by spam bots on ICQ (You know, ladies who generously offered us to discover them a little more on websites).
ELIZA, only available in English, only plays the role of a psychiatrist. It operates by rephrasing the patient's statements to give the illusion of understanding.
GPT, which you undoubtedly know, is much more versatile and is capable of discussing anything.
There are several files available in both French and English.
To try this notebook yourself, follow these steps:
-
Download the necessary files: Download the zip file from the provided gist link and extract it. The zip file should contain
eliza-gpt.ipynb
,eliza.py
, anddoctor.txt
. -
Set up your environment: Create a virtual environment and install the required dependencies by running:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Create a .env file: In the root directory of your project, create a
.env
file and define theOPENAI_API_KEY
variable. The file should look like this:OPENAI_API_KEY=your_openai_api_key
-
Run the notebook: Start Jupyter Notebook or JupyterLab and open the notebook file (
eliza-gpt.ipynb
). You can do this by running:jupyter notebook
or
jupyter lab
-
Execute the cells: In the notebook, execute the cells one by one to see the results. Make sure you follow any specific instructions provided in the notebook to properly configure and run the code.
-
Explore and modify: Feel free to explore the code and modify it to suit your needs. You can experiment with different configurations and inputs to see how the ELIZA and GPT-4 models respond in various scenarios.
If you encounter any issues or have questions, refer to the documentation provided within the notebook.
- ELIZA by Joseph Weizenbaum
- eliza.py: A Python implementation of ELIZA by wadetb
- GPT-4o from OpenAI