File size: 534 Bytes
a441854 b7087b8 93e4ac4 b7087b8 a441854 7581580 4211187 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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)
|