File size: 446 Bytes
59f39fb
 
7ab9345
 
59f39fb
7ab9345
 
59f39fb
 
 
7ab9345
59f39fb
 
 
 
7ab9345
59f39fb
 
 
 
7ab9345
59f39fb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from fastapi import FastAPI
from pydantic import BaseModel
from env import EmailEnv

app = FastAPI()
env = EmailEnv()

class Action(BaseModel):
    label: str
    reply: str

@app.post("/reset")
def reset():
    obs = env.reset()
    return obs

@app.post("/step")
def step(action: Action):
    reward = env.step(action.dict())
    return {"reward": reward}

@app.get("/")
def home():
    return {"message": "Email Triage AI Environment Running"}