Spaces:
Sleeping
Sleeping
File size: 215 Bytes
d7ff1c2 |
1 2 3 4 5 6 7 8 9 10 11 12 |
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class InputData(BaseModel):
x: float
@app.post("/square")
def double_number(data: InputData):
return {"result": data.x * data.x}
|