from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() # Request schema class DataRequest(BaseModel): message: str # Static value STATIC_VALUE = "Hello from Hugging Face Space!" @app.get("/") def root(): return {"info": "FastAPI app is running on Hugging Face Spaces"} @app.post("/send") def send_data(data: DataRequest): # Just return the static value regardless of input return { "received": data.message, "response": STATIC_VALUE } @app.get("/get") def get_data(): return {"data": STATIC_VALUE}