Spaces:
Runtime error
Runtime error
| from fastapi import FastAPI | |
| api_app = FastAPI() | |
| async def agent1_endpoint(message: dict): | |
| return {"agent": "agent1", "response": f"Processed: {message['text']}"} | |
| async def agent2_endpoint(message: dict): | |
| return {"agent": "agent2", "response": f"Processed: {message['text']}"} | |
| async def agent3_endpoint(message: dict): | |
| return {"agent": "agent3", "response": f"Processed: {message['text']}"} | |
| async def agent4_endpoint(message: dict): | |
| return {"agent": "agent4", "response": f"Processed: {message['text']}"} | |
| async def run_all_endpoint(message: dict): | |
| responses = [ | |
| {"agent": f"agent{i}", "response": f"Processed: {message['text']}"} | |
| for i in range(1, 5) | |
| ] | |
| return {"responses": responses} | |