Frederic-CellNum commited on
Commit
0b84e95
·
verified ·
1 Parent(s): ab416f0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel
2
+ from fastapi import FastAPI
3
+
4
+
5
+ # Initialize FastAPI app
6
+ app = FastAPI(title="PDF Data Extraction")
7
+
8
+ class Item(BaseModel):
9
+ name: str
10
+ description: str = None
11
+
12
+ @app.post("/predict/")
13
+ async def predict(item: Item):
14
+ return {"result": f"Vous avez envoyé : {item.name}"}
15
+
16
+ @app.get("/")
17
+ async def root():
18
+ return {"message": "Bienvenue sur mon API !"}