Skip to content

Commit

Permalink
very simple example where ChatGPT talks to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgross committed Dec 8, 2022
1 parent ddb42a7 commit 91988d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions multichat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Get ChatGPT to talk to itself."""

import os
import sys
import subprocess
import requests

metaprompt = "Now make that funnier."
chat1 = requests.get("http://localhost:5001/chat?q=%s" % "Teach me about quantum mechanics in a 140 characters or less.")
while True:
chat2 = requests.get("http://localhost:5002/chat?q=%s" % (chat1.text.replace(metaprompt, "") + " " + metaprompt))
chat1 = requests.get("http://localhost:5001/chat?q=%s" % (chat2.text.replace(metaprompt, "") + " " + metaprompt))


0 comments on commit 91988d7

Please sign in to comment.