Spaces:
Paused
Paused
from fastapi import FastAPI | |
from pydantic import BaseModel | |
class User_input(BaseModel): | |
operation:str | |
x:float | |
y:float | |
def calculate(operation, x, y): | |
return x/y | |
app = FastAPI() | |
def greet_json(): | |
return {"Hello": "World!"} | |
def operate(input:User_input): | |
res= calculate(input.operation, input.x, input.y) | |
return res | |