Set up an OpenAI API key (we suggest asking ChatGPT for help with this), make sure you have a nonzero credit balance with OpenAI, then run "python debate.py" in terminal to start generating debates! You'll be prompted to describe what you want from the debate. The debate will be printed in the terminal and saved to debates.txt.
Philosophical and political thought is often taught by putting famous thinkers from different points in history in conversation with each other. We've enjoyed learning in this style and wanted to make it easier for people to use LLMs to generate debates about all kinds of topics as an educational resource.
Our code allows users to briefly specify a topic and descriptions of two debaters, and then it uses LLMs to generate a debate about that topic with the debaters following the specified descriptions. For instance, a user could request a debate between Karl Marx and Adam Smith about communism.
We used Python for the backend and the OpenAI API to query LLMs to generate the debates.
Getting the infrastructure set up to use the OpenAI API was a challenge, but we got it to work.
Overcoming the infrastructure hurdles and building a working project that does something cool!
We learned how to use LLM APIs and how to write Python code that augments and modifies the abilities of LLMs to perform specific tasks of interest (in this case, generating debates).
We'd like to make it possible to generate debates with more than two interlocutors and add features that give the user more fine-grained control over the topic and arguments covered in the debate.