Workout-Master / backend.py
leobora's picture
Add FastAPI backend and integrate with Gradio frontend for workout plan generation
e9d0729 verified
raw
history blame contribute delete
475 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class UserData(BaseModel):
weight: float
height: float
age: int
body_type: str
goals: str
preferences: str
@app.post("/generate_plan")
def generate_plan(data: UserData):
# Lógica para gerar o plano de treino personalizado
plan = f"Generated plan for {data.body_type} body type with goals: {data.goals} and preferences: {data.preferences}"
return {"plan": plan}