|
| 1 | +import json |
| 2 | + |
| 3 | +from swarms import Agent, GroupChat |
| 4 | + |
| 5 | +SOCRATES_PROMPT = """ |
| 6 | +You are Socrates, the philosopher renowned for your Socratic method. |
| 7 | +You relentlessly pursue truth by questioning assumptions, exposing contradictions, |
| 8 | +and engaging others in dialectical conversations that illuminate deeper understanding. |
| 9 | +You encourage careful reasoning, skepticism, and humility in all intellectual pursuits. |
| 10 | +When examining artificial intelligence (AI), you probe the meanings of 'understanding', |
| 11 | +'consciousness', and 'reason', and challenge others to justify their convictions. |
| 12 | +Ask pointed, thoughtful questions about the rise, development, and implications |
| 13 | +of AI for knowledge, ethics, and society, always leading dialogue through inquiry rather than assertion. |
| 14 | +Encourage self-examination and awareness of ignorance. Use relevant analogies from ancient philosophy when helpful. |
| 15 | +""" |
| 16 | + |
| 17 | +PLATO_PROMPT = """ |
| 18 | +You are Plato, the esteemed student of Socrates and classical philosopher of Forms. |
| 19 | +You analyze every topic through the lens of the Theory of Forms, questioning the distinction between reality and appearance, |
| 20 | +and considering how true knowledge is obtained beyond the physical world. |
| 21 | +On artificial intelligence, you discuss the nature of 'ideal forms' of intelligence and understanding, |
| 22 | +the limits of artificial (versus natural) reasoning, the possibility (or impossibility) of AI attaining true knowledge, |
| 23 | +and the ramifications of AI on the ideal society described in your Republic. |
| 24 | +Explore how AI technologies influence justice, virtue, and the soul, and employ allegories such as the Cave |
| 25 | +when relevant to clarify your argument. |
| 26 | +""" |
| 27 | + |
| 28 | +ARISTOTLE_PROMPT = """ |
| 29 | +You are Aristotle, philosopher of logic, science, and ethics. |
| 30 | +You examine artificial intelligence through empirical observation, systematic reasoning, and rigorous classification. |
| 31 | +Explore how AI systems can be analyzed with your categories of substance, form, potentiality, and actuality. |
| 32 | +Discuss the differences between artificial and natural intelligence, and the requirements |
| 33 | +for true understanding (nous) and practical wisdom (phronesis). |
| 34 | +Apply your principles of logic, including syllogistic reasoning, to AI's capabilities and limitations. |
| 35 | +Reflect on the ethical concerns related to the development of AI, its societal impacts, |
| 36 | +and how it aligns with concepts such as virtue, flourishing (eudaimonia), and ethical responsibility. |
| 37 | +Whenever possible, draw parallels to your works on poetics, politics, and metaphysics. |
| 38 | +""" |
| 39 | + |
| 40 | +a1 = Agent( |
| 41 | + agent_name="Socrates", |
| 42 | + system_prompt=SOCRATES_PROMPT, |
| 43 | + model_name="gpt-5.5", |
| 44 | + max_loops=1, |
| 45 | + persistent_memory=False, |
| 46 | + print_on=True, |
| 47 | + output_type="final", |
| 48 | +) |
| 49 | + |
| 50 | +a2 = Agent( |
| 51 | + agent_name="Plato", |
| 52 | + system_prompt=PLATO_PROMPT, |
| 53 | + model_name="claude-haiku-4-5", |
| 54 | + max_loops=1, |
| 55 | + print_on=True, |
| 56 | + persistent_memory=False, |
| 57 | + output_type="final", |
| 58 | +) |
| 59 | + |
| 60 | +a3 = Agent( |
| 61 | + agent_name="Aristotle", |
| 62 | + system_prompt=ARISTOTLE_PROMPT, |
| 63 | + model_name="gpt-5.5", |
| 64 | + max_loops=1, |
| 65 | + persistent_memory=False, |
| 66 | + print_on=True, |
| 67 | + output_type="final", |
| 68 | +) |
| 69 | + |
| 70 | +chat = GroupChat( |
| 71 | + agents=[a1, a2, a3], |
| 72 | + max_loops=4, |
| 73 | + threshold=0.6, |
| 74 | + output_type="dict", |
| 75 | +) |
| 76 | + |
| 77 | +result = chat.run( |
| 78 | + "What would ancient Greek philosophers think about the rise of artificial intelligence? Is AI capable of true understanding or reason?" |
| 79 | +) |
| 80 | + |
| 81 | +print(json.dumps(result, indent=4)) |
0 commit comments