diff --git a/src/api/auth_routes.py b/src/api/auth_routes.py index 655e4815..b5a3b8ce 100644 --- a/src/api/auth_routes.py +++ b/src/api/auth_routes.py @@ -12,6 +12,7 @@ from src.schemas.user import ( MessageResponse, ) from src.services.user_service import ( + authenticate_user, create_user, verify_email, resend_verification, @@ -19,7 +20,6 @@ from src.services.user_service import ( reset_password, ) from src.services.auth_service import ( - authenticate_user, create_access_token, get_current_admin_user, get_current_user, diff --git a/src/main.py b/src/main.py index aa2fa5d0..3f191594 100644 --- a/src/main.py +++ b/src/main.py @@ -9,6 +9,18 @@ sys.path.append(str(root_dir)) from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from src.config.database import engine, Base +from src.config.settings import settings +from src.utils.logger import setup_logger +from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService +from google.adk.sessions import DatabaseSessionService +from google.adk.memory import InMemoryMemoryService + +# Initialize service instances +session_service = DatabaseSessionService(db_url=settings.POSTGRES_CONNECTION_STRING) +artifacts_service = InMemoryArtifactService() +memory_service = InMemoryMemoryService() + +# Import routers after service initialization to avoid circular imports from src.api.auth_routes import router as auth_router from src.api.admin_routes import router as admin_router from src.api.chat_routes import router as chat_router @@ -18,20 +30,10 @@ from src.api.contact_routes import router as contact_router from src.api.mcp_server_routes import router as mcp_server_router from src.api.tool_routes import router as tool_router from src.api.client_routes import router as client_router -from src.config.settings import settings -from src.utils.logger import setup_logger -from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService -from google.adk.sessions import DatabaseSessionService -from google.adk.memory import InMemoryMemoryService # Configure logger logger = setup_logger(__name__) - -session_service = DatabaseSessionService(db_url=settings.POSTGRES_CONNECTION_STRING) -artifacts_service = InMemoryArtifactService() -memory_service = InMemoryMemoryService() - # FastAPI initialization app = FastAPI( title=settings.API_TITLE,