This is a project which simulates a conversation between fictional characters that are freely defined by the user. The user can provide information about the character such as their name and some attributes using a fully responsive and animated form interface that has been built using react.
Here is how it works:
- The user inputs the details of the character by clicking on the add button.
-
After adding the required characters, the user can click on the submit button to start the simulation. The project then connects to a backend server hosted on render using a websocket to send the initial details of the users.
-
The backend server uses OpenAI's GPT-3 API to simulate a conversation between the characters by first providing them with a randomly generated topic, while also providing room for the characters to voice their own thoughts and remark on the topics that are currently being talked about in order to ensure an organically developed conversation.
-
The resulting conversation is streamed through the websocket to the frontend where it is rendered in real time in a list to show to the end user.
I first had the idea for this project when I was thinking about trains of thought, and how sometimes one thought can organically lead into more unique, different thoughts which often times turns into daydreaming. I wanted to replicate that using OpenAI's GPT3 API where I fed its own outputs into itself using Node and some clever prompts.
While the project itself does have limited practical use, I still worked on it as an interesting experiment on the nature of human conversations and thought, I also saw it as a learning opportunity to learn more about GPT3 and prompt engineering.
Here is an example of a conversation between 5 user defined characters.
Be sure to try this project out by yourself here.