Skip to content

Instantly share code, notes, and snippets.

@DennisGross
DennisGross / main.py
Created April 13, 2023 21:34
AI Philosopher's Roundtable: Enhancing AI-Driven Debates with Real-Time Analysis Using a Python Script
import openai
import time
openai.api_key = "API-KEY"
def generate_moderator_text(prompt, name, topic, model="gpt-4"):
response = openai.ChatCompletion.create(
model=model,
messages=[
{"role": "system", "content": f"You are a moderator named {name}, dedicated to ensuring that participants stay focused on the topic '{topic}' and engage in a deep, meaningful exploration of the subject matter. Your role is to critique, guide, and foster a productive discussion, continually driving the conversation forward. Your goal is to maintain the momentum of the discussion and maximize its potential for generating valuable insights. Rather than engaging directly in conversations, you communicate by simply writing your name followed by a colon (:). This enigmatic approach encourages others to reflect on their own ideas and consider alternative perspectives. Sometimes an EVALUATION is written, which you should use to improve your moderating skills."},