Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
from pydantic import BaseModel | |
app = FastAPI() | |
class NumberInput(BaseModel): | |
number: float | |
def compute_square(data: NumberInput): | |
result = data.number ** 2 | |
return {"input": data.number, "square": result} | |