<p>An interesting long interaction (human-bot) can be obtained from asking the bot to &quot;act as a teacher&quot;, and prompting for, say, five questions for each of five different subjects (nested loop in natural language programming). This allows for rethinking GPT as <strong>General Programmable Tutor</strong>.</p>
<p>A natural extension of this between two bots could be prompting one to act as a <strong>teacher</strong> and the other one as a <strong>student</strong>, to break the initial symmetry and allow you to simply contemplate the evolution of dialogue.</p>
<p>As for reflection, I wonder whether some <strong>artificial consciousness</strong> can be made to emerge by letting an agent ask questions about itself to a variety of other agents and make kind of a majority vote, a synthesis from the answers obtained. A natural first question to investigate one's nature in the absence of direct self-observation could be <strong>who am I?</strong>. With two agents only it seems to be more difficult to gain much knowledge about oneself, because the self-image could be manipulated more easily.</p>

CC BY-SA 4.0
2023-04-20T04:02:54.633Z
2023-04-20T04:10:45.803Z
2023-04-20T04:10:45.803Z
Jaume Oliver Lafont
<p>I wrote a code for a conversation between 2 ChatGPTs (which I call them agent 1 and agent 2) using poe.com and its <a href="https://pypi.org/project/poe-api/" rel="nofollow noreferrer">reversed engineered API</a>:</p>
<pre><code>import poe

agent_1 = {&quot;token&quot;:&quot;&quot;}
print(&quot;Agent 1: ON&quot;)
agent_2 = {&quot;token&quot;:&quot;&quot;}
print(&quot;Agent 2: ON&quot;)

client_1 = poe.Client(agent_1[&quot;token&quot;])
client_2 = poe.Client(agent_2[&quot;token&quot;])

model = &quot;chinchilla&quot;

client_1.purge_conversation(model)
print(&quot;Agent 1: Ready&quot;)
client_2.purge_conversation(model)
print(&quot;Agent 2: Ready&quot;)

print(&quot;Initial Prompt:&quot;)
message = input()

def remove_ai_phrase(sentence):
    &quot;&quot;&quot;
    Removes the phrase &quot;As an AI language model&quot; from a sentence.
    &quot;&quot;&quot;
    ai_phrase = &quot;As an AI language model&quot;
    if ai_phrase in sentence:
        # Find the end of the sentence (i.e., the position of the last period)
        sentence_end = sentence.rfind(&quot;.&quot;)
        # Remove the ai_phrase from the sentence
        sentence = sentence[:sentence_end].replace(ai_phrase, &quot;&quot;) + sentence[sentence_end:]
    return sentence

c = 0
while True:
    if c == 0:
        message = message
    c += 1
    print(&quot;\n&quot;,50*&quot;=&quot;)
    print(&quot;\nAgent 1:&quot;)
    answer_1 = &quot;&quot;
    for chunk in client_1.send_message(model, message):
        print(chunk[&quot;text_new&quot;], end=&quot;&quot;, flush=True)
        answer_1 += &quot;&quot;+chunk[&quot;text_new&quot;]
    print(&quot;\n&quot;)
    print(&quot;\n&quot;,50*&quot;=&quot;)
    print(&quot;\nAgent 2:&quot;)
    # answer_1 += &quot;\nIn addition...&quot;
    answer_1 = remove_ai_phrase(answer_1)
    answer_2 = &quot;&quot;
    for chunk in client_2.send_message(model, answer_1):
        print(chunk[&quot;text_new&quot;], end=&quot;&quot;, flush=True)
        answer_2 += &quot;&quot;+chunk[&quot;text_new&quot;]
    print(&quot;\n&quot;)
    message = answer_2 
    message = remove_ai_phrase(message)

</code></pre>
<p>Based on my few experiments, when I set the initial prompt on something like &quot;discuss the meaning of life&quot;, they stuck at complementing each other. But if I set the initial prompt to something short and meaningless like &quot;1&quot;, they actually start having conversation on various topics.</p>
<p><strong>How do you think we can make them talk about a specific topic and reflect on each other?</strong></p>

CC BY-SA 4.0
2023-04-20T06:05:02.253Z
I voted to reopen. While a specific code example is given, the double question is general and interesting.
Jaume Oliver Lafont
CC BY-SA 4.0
2023-04-20T11:12:52.290Z
@JaumeOliverLafont If you think this is not a programming/technical question, maybe you can then remove the code from the post and reformulate the title as the specific question that is being asked ;)
nbro
CC BY-SA 4.0
2023-04-20T13:33:00.863Z
I dared to rewrite the title generalizing from ChatGPT to conversational agents. I am not so sure to delete the code or rather write pseudocode instead. Should that be decided by the OP?
Jaume Oliver Lafont
CC BY-SA 4.0
2023-04-20T14:50:27.203Z
I put this question in SO and they (with a toxic language) down voted and closed the question because apparently this question belongs to AI Stack. I don't know where I can get my answer. @JaumeOliverLafont
Amirhossein Rezaei
<machine-learning><chatgpt><prompt><prompt-design>
How to guide the interaction between two ChatGPT conversational agents?
Amirhossein Rezaei
# How to guide the interaction between two ChatGPT conversational agents?

(Asked by: username_0 on 2023-04-19)

I wrote a code for a conversation between 2 ChatGPTs (which I call them agent 1 and agent 2) using poe.com and its reversed engineered API:
import poe

agent_1 = {"token":""}
print("Agent 1: ON")
agent_2 = {"token":""}
print("Agent 2: ON")

client_1 = poe.Client(agent_1["token"])
client_2 = poe.Client(agent_2["token"])

model = "chinchilla"

client_1.purge_conversation(model)
print("Agent 1: Ready")
client_2.purge_conversation(model)
print("Agent 2: Ready")

print("Initial Prompt:")
message = input()

def remove_ai_phrase(sentence):
    """
    Removes the phrase "As an AI language model" from a sentence.
    """
    ai_phrase = "As an AI language model"
    if ai_phrase in sentence:
        # Find the end of the sentence (i.e., the position of the last period)
        sentence_end = sentence.rfind(".")
        # Remove the ai_phrase from the sentence
        sentence = sentence[:sentence_end].replace(ai_phrase, "") + sentence[sentence_end:]
    return sentence

c = 0
while True:
    if c == 0:
        message = message
    c += 1
    print("\n",50*"=")
    print("\nAgent 1:")
    answer_1 = ""
    for chunk in client_1.send_message(model, message):
        print(chunk["text_new"], end="", flush=True)
        answer_1 += ""+chunk["text_new"]
    print("\n")
    print("\n",50*"=")
    print("\nAgent 2:")
    # answer_1 += "\nIn addition..."
    answer_1 = remove_ai_phrase(answer_1)
    answer_2 = ""
    for chunk in client_2.send_message(model, answer_1):
        print(chunk["text_new"], end="", flush=True)
        answer_2 += ""+chunk["text_new"]
    print("\n")
    message = answer_2 
    message = remove_ai_phrase(message)


Based on my few experiments, when I set the initial prompt on something like "discuss the meaning of life", they stuck at complementing each other. But if I set the initial prompt to something short and meaningless like "1", they actually start having conversation on various topics.
How do you think we can make them talk about a specific topic and reflect on each other?

**Tags:** machine-learning, chatgpt, prompt, prompt-design

> **Comments:**
> **username_1**: I voted to reopen. While a specific code example is given, the double question is general and interesting.  
> **username_2**: @JaumeOliverLafont If you think this is not a programming/technical question, maybe you can then remove the code from the post and reformulate the title as the specific question that is being asked ;)  
> **username_1**: I dared to rewrite the title generalizing from ChatGPT to conversational agents. I am not so sure to delete the code or rather write pseudocode instead. Should that be decided by the OP?  
> **username_0**: I put this question in SO and they (with a toxic language) down voted and closed the question because apparently this question belongs to AI Stack. I don't know where I can get my answer. @JaumeOliverLafont  

---

## 1 answers

### Answer by username_1 on 2023-04-20. Score: 1

An interesting long interaction (human-bot) can be obtained from asking the bot to "act as a teacher", and prompting for, say, five questions for each of five different subjects (nested loop in natural language programming). This allows for rethinking GPT as **General Programmable Tutor**.

A natural extension of this between two bots could be prompting one to act as a **teacher** and the other one as a **student**, to break the initial symmetry and allow you to simply contemplate the evolution of dialogue.

As for reflection, I wonder whether some **artificial consciousness** can be made to emerge by letting an agent ask questions about itself to a variety of other agents and make kind of a majority vote, a synthesis from the answers obtained. A natural first question to investigate one's nature in the absence of direct self-observation could be **who am I?**. With two agents only it seems to be more difficult to gain much knowledge about oneself, because the self-image could be manipulated more easily.


---

