glm45v3 / api.py
Benny-Tang's picture
Update api.py
c65d50c verified
raw
history blame contribute delete
861 Bytes
from fastapi import FastAPI
api_app = FastAPI()
@api_app.post("/agent1")
async def agent1_endpoint(message: dict):
return {"agent": "agent1", "response": f"Processed: {message['text']}"}
@api_app.post("/agent2")
async def agent2_endpoint(message: dict):
return {"agent": "agent2", "response": f"Processed: {message['text']}"}
@api_app.post("/agent3")
async def agent3_endpoint(message: dict):
return {"agent": "agent3", "response": f"Processed: {message['text']}"}
@api_app.post("/agent4")
async def agent4_endpoint(message: dict):
return {"agent": "agent4", "response": f"Processed: {message['text']}"}
@api_app.post("/run_all")
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}