|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
"source": [ |
|
|
|
|
"# Week 2 Day 1 - Conversation between three AI's\n", |
|
|
|
|
"\n", |
|
|
|
|
"This notebook defines three classes (`ThreePartyChat`, `Participant` and `Model`) that implement a 3-party chat between different AI's. \n", |
|
|
|
|
"This notebook defines three classes (`ThreeWayChat`, `Participant` and `Model`) that implement a 3-way conversation between different AI's. \n", |
|
|
|
|
"\n", |
|
|
|
|
"At the bottom there is an example conversation between a Claude model and two GPT models.\n", |
|
|
|
|
"\n", |
|
|
|
@ -174,7 +174,7 @@
|
|
|
|
|
"metadata": {}, |
|
|
|
|
"outputs": [], |
|
|
|
|
"source": [ |
|
|
|
|
"class ThreePartyChat:\n", |
|
|
|
|
"class ThreeWayChat:\n", |
|
|
|
|
" \"\"\"Make three Participants communicate.\"\"\"\n", |
|
|
|
|
" def __init__(self, participants, n_turns=4):\n", |
|
|
|
|
" \"\"\"\n", |
|
|
|
@ -311,12 +311,12 @@
|
|
|
|
|
"p3 = Participant(name=name3, model=gpt_model, system_prompt=system3, initial_message=\"Hey guys\")\n", |
|
|
|
|
"\n", |
|
|
|
|
"# To make a mock run without API calls:\n", |
|
|
|
|
"p1 = Participant(name=name1, system_prompt=system1, initial_message=\"Hello there\")\n", |
|
|
|
|
"p2 = Participant(name=name2, system_prompt=system2, initial_message=\"Good evening.\")\n", |
|
|
|
|
"p3 = Participant(name=name3, system_prompt=system3, initial_message=\"Hey guys\")\n", |
|
|
|
|
"# p1 = Participant(name=name1, system_prompt=system1, initial_message=\"Hello there\")\n", |
|
|
|
|
"# p2 = Participant(name=name2, system_prompt=system2, initial_message=\"Good evening.\")\n", |
|
|
|
|
"# p3 = Participant(name=name3, system_prompt=system3, initial_message=\"Hey guys\")\n", |
|
|
|
|
"\n", |
|
|
|
|
"# Create Chat\n", |
|
|
|
|
"chat = ThreePartyChat((p1, p2, p3))" |
|
|
|
|
"chat = ThreeWayChat((p1, p2, p3))" |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|