Spaces:
Runtime error
Runtime error
Download api.py from Benny-Tang/glm45v3: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/spaces/Benny-Tang/glm45v3/resolve/main/api.py
- Command line
-
hf download hf://spaces/Benny-Tang/glm45v3/api.py
-
curl -L -o api.py https://huggingface.co/spaces/Benny-Tang/glm45v3/resolve/main/api.py
861 Bytes
| 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} | |