GlobalBusinessAdvisors's picture
Rename app/app.py to app/main.py
0712e51 verified
raw
history blame
534 Bytes
from fastapi import FastAPI
import os
from dotenv import load_dotenv
from ui.gradio_ui import create_ui
# Load environment variables from .env file
load_dotenv()
# Fetch the OpenAI API key from environment variables
openai_api_key = os.getenv('OPENAI_API_KEY')
app = FastAPI()
@app.on_event("startup")
def startup_event():
create_ui()
@app.get("/")
def read_root():
return {"message": "EcoPropertyRetrofitGPT API is running"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)