Spaces:
Sleeping
Sleeping
Download main.py from Notionhive/chatbot: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/spaces/Notionhive/chatbot/resolve/main/main.py
- Command line
-
hf download hf://spaces/Notionhive/chatbot/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Notionhive/chatbot/resolve/main/main.py
686 Bytes
| #FastAPI Packages | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware | |
| #Route Calling From faq_routes.py | |
| from faq_routes import router as faq_router | |
| import auth | |
| # from telegram import router as telegram_router | |
| app = FastAPI(title="Notionhive Chatbot") | |
| app.add_middleware(ProxyHeadersMiddleware, trusted_hosts="*") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Include FAQ API routes | |
| app.include_router(faq_router) | |
| app.include_router(auth.router) | |
| # app.include_router(telegram_router) | |