CoolFace
Apppublic

anishasingh-dev/openenv-ai-support-simulation-projects

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
app.py34 linesDownload Raw Back to root
1from fastapi import FastAPI2from pydantic import BaseModel3import gradio as gr4from baseline_agent import predict5 6app = FastAPI(title="OpenEnv Customer Support API")7 8# Request schema9class Request(BaseModel):10    message: str11 12# Reset endpoint for OpenEnv13@app.post("/reset")14def reset(req: Request):15    return predict(req.message)16 17# Optional health check18@app.get("/")19def home():20    return {"message": "API is running"}21 22# Gradio UI23def respond(message):24    return str(predict(message))25 26demo = gr.Interface(27    fn=respond,28    inputs="text",29    outputs="text",30    title="AI Support Agent"31)32 33# Mount Gradio at /app without overwriting FastAPI app34gr.mount_gradio_app(app, demo, path="/app")