faerazo's picture
Commit to HFS
3bb6958 verified
# app.py - Main application entry point
from fastapi import FastAPI
import gradio as gr
import uvicorn
from agent import ARCollectionAgent
from ui import create_interface
from config import APP_TITLE, APP_HOST, APP_PORT
# Initialize FastAPI app
app = FastAPI(
title=APP_TITLE,
description="AI Agent for Accounts Receivable Collections (Demo)",
version="1.0.0"
)
# Initialize the AR Collection Agent
agent = ARCollectionAgent()
# Create Gradio interface
demo = create_interface(agent)
# Mount Gradio app on FastAPI
app = gr.mount_gradio_app(app, demo, path="/")
# Health check endpoint
@app.get("/health")
async def health_check():
return {"status": "healthy", "service": APP_TITLE}
if __name__ == "__main__":
print(f"πŸš€ Starting {APP_TITLE}...")
print(f"πŸ“ Access the app at: http://{APP_HOST}:{APP_PORT}")
print("⚠️ Remember: This is a DEMO - no emails are actually sent!")
# Run the application
uvicorn.run(
app,
host=APP_HOST,
port=APP_PORT,
reload=False # Set to True for development
)