Spaces:
Sleeping
Sleeping
File size: 382 Bytes
ecf3ab5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class InputData(BaseModel):
text: str
@app.get("/")
def root():
return {"status": "Python API is running"}
@app.post("/process")
def process(data: InputData):
# Example Python logic
result = data.text.upper()
return {
"original": data.text,
"processed": result
}
|