File size: 1,200 Bytes
ae5eb99 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
class Orchestrator:
def __init__(self):
# Initialize agents here
self.text_classification_agent = TextClassificationAgent()
self.sentiment_analysis_agent = SentimentAnalysisAgent()
self.summarization_agent = SummarizationAgent()
self.code_generation_agent = CodeGenerationAgent()
self.web_search_agent = WebSearchAgent()
def handle_request(self, request_type, input_data):
if request_type == "classification":
return self.text_classification_agent.classify(input_data)
elif request_type == "sentiment":
return self.sentiment_analysis_agent.analyze(input_data)
elif request_type == "summarization":
return self.summarization_agent.summarize(input_data)
elif request_type == "code_generation":
return self.code_generation_agent.generate_code(input_data)
elif request_type == "web_search":
return self.web_search_agent.search(input_data)
else:
raise ValueError("Invalid request type")
# Example usage:
orchestrator = Orchestrator()
result = orchestrator.handle_request("classification", "This is a test input")
print(result)
|