Spaces:
Sleeping
Sleeping
Commit ·
ac030bc
1
Parent(s): e3dccb9
Added basic structure for the fast api endpoints as per the task
Browse files
app.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dotenv import load_dotenv
|
| 2 |
+
|
| 3 |
+
load_dotenv()
|
| 4 |
+
|
| 5 |
+
from fastapi import FastAPI
|
| 6 |
+
from models import Action, Observation, StepResult
|
| 7 |
+
|
| 8 |
+
app = FastAPI(title="Sieve")
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@app.get("/")
|
| 12 |
+
def root():
|
| 13 |
+
pass
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
@app.post("/reset", response_model=Observation)
|
| 17 |
+
def reset(task_id: str = "email_classificaiton"):
|
| 18 |
+
pass
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
@app.post("/step", response_model=StepResult)
|
| 22 |
+
def step(action: Action):
|
| 23 |
+
pass
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@app.get("/state")
|
| 27 |
+
def state():
|
| 28 |
+
pass
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@app.get("/tasks")
|
| 32 |
+
def list_tasks():
|
| 33 |
+
pass
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@app.get("/grader")
|
| 37 |
+
def grader():
|
| 38 |
+
pass
|