File size: 326 Bytes
dff22d6
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastapi import FastAPI
from ai_module import get_ai_response

app = FastAPI()

@app.get("/")
def home():
    return {"message": "Welcome to the Solar Industry AI Assistant API!"}

@app.get("/ask")
def ask_solar_assistant(query: str):
    response = get_ai_response(query)
    return {"response": response}