Update main.py
Browse files
main.py
CHANGED
|
@@ -12,10 +12,10 @@ from fastapi import FastAPI, HTTPException
|
|
| 12 |
from fastapi.middleware.cors import CORSMiddleware
|
| 13 |
from pydantic import BaseModel
|
| 14 |
|
| 15 |
-
from
|
| 16 |
-
from
|
| 17 |
-
from
|
| 18 |
-
from
|
| 19 |
|
| 20 |
|
| 21 |
# Create FastAPI application
|
|
@@ -65,8 +65,8 @@ async def startup_event():
|
|
| 65 |
|
| 66 |
Per @specs/001-chatbot-mcp/plan.md, MCP server lifecycle is tied to FastAPI app.
|
| 67 |
"""
|
| 68 |
-
from
|
| 69 |
-
from
|
| 70 |
import logging
|
| 71 |
|
| 72 |
logger = logging.getLogger(__name__)
|
|
@@ -95,7 +95,7 @@ async def shutdown_event():
|
|
| 95 |
|
| 96 |
Per @specs/001-chatbot-mcp/plan.md, MCP server lifecycle is tied to FastAPI app.
|
| 97 |
"""
|
| 98 |
-
from
|
| 99 |
await mcp_service.shutdown()
|
| 100 |
|
| 101 |
|
|
@@ -139,8 +139,8 @@ async def generate_token(request: TokenRequest):
|
|
| 139 |
|
| 140 |
# Ensure user exists in database (create if not)
|
| 141 |
from sqlmodel import Session
|
| 142 |
-
from
|
| 143 |
-
from
|
| 144 |
|
| 145 |
with Session(engine) as session:
|
| 146 |
existing_user = session.get(UserTable, user_id)
|
|
|
|
| 12 |
from fastapi.middleware.cors import CORSMiddleware
|
| 13 |
from pydantic import BaseModel
|
| 14 |
|
| 15 |
+
from config import settings
|
| 16 |
+
from api.routes import tasks_router, health_router, chat_router
|
| 17 |
+
from services.auth import create_token, create_password_reset_token, verify_password_reset_token, consume_password_reset_token
|
| 18 |
+
from services.email import send_password_reset_email
|
| 19 |
|
| 20 |
|
| 21 |
# Create FastAPI application
|
|
|
|
| 65 |
|
| 66 |
Per @specs/001-chatbot-mcp/plan.md, MCP server lifecycle is tied to FastAPI app.
|
| 67 |
"""
|
| 68 |
+
from config import init_db
|
| 69 |
+
from services.mcp import mcp_service
|
| 70 |
import logging
|
| 71 |
|
| 72 |
logger = logging.getLogger(__name__)
|
|
|
|
| 95 |
|
| 96 |
Per @specs/001-chatbot-mcp/plan.md, MCP server lifecycle is tied to FastAPI app.
|
| 97 |
"""
|
| 98 |
+
from services.mcp import mcp_service
|
| 99 |
await mcp_service.shutdown()
|
| 100 |
|
| 101 |
|
|
|
|
| 139 |
|
| 140 |
# Ensure user exists in database (create if not)
|
| 141 |
from sqlmodel import Session
|
| 142 |
+
from models.user import UserTable
|
| 143 |
+
from config import engine
|
| 144 |
|
| 145 |
with Session(engine) as session:
|
| 146 |
existing_user = session.get(UserTable, user_id)
|