# Write your Python code here
# Basic Multi-Agent System
class ResearchAgent:
def work(self, topic):
return f"Research Agent: Collected information about {topic}."
class AnalysisAgent:
def work(self, information):
return f"Analysis Agent: Analyzed the information.\nResult: {information}"
class WritingAgent:
def work(self, analysis):
return f"Writing Agent: Created a final answer.\n{analysis}"
# User gives a topic
topic = input("Enter a topic: ")
# Create agents
researcher = ResearchAgent()
analyst = AnalysisAgent()
writer = WritingAgent()
# Agents work together
research = researcher.work(topic)
print(research)
analysis = analyst.work(research)
print(analysis)
final_answer = writer.work(analysis)
print(final_answer)