diff --git a/backend/app/api/dependencies.py b/backend/app/api/dependencies.py index c93b8edf..2efd8dd1 100644 --- a/backend/app/api/dependencies.py +++ b/backend/app/api/dependencies.py @@ -2,7 +2,7 @@ Shared dependencies for API routes """ from fastapi import Depends -from app.services.trading_service import TradingService, trading_service +from backend.app.services.trading_service import TradingService, trading_service def get_trading_service() -> TradingService: diff --git a/backend/app/api/routes.py b/backend/app/api/routes.py index a25b9042..f9270074 100644 --- a/backend/app/api/routes.py +++ b/backend/app/api/routes.py @@ -5,15 +5,16 @@ from fastapi import APIRouter, Depends, HTTPException from datetime import datetime import logging -from app.models.schemas import ( +from backend.app.models.schemas import ( AnalysisRequest, AnalysisResponse, ConfigResponse, HealthResponse, + Ticker, ) -from app.services.trading_service import TradingService -from app.api.dependencies import get_trading_service -from app.core.config import settings +from backend.app.services.trading_service import TradingService +from backend.app.api.dependencies import get_trading_service +from backend.app.core.config import settings logger = logging.getLogger(__name__) @@ -54,7 +55,7 @@ async def run_analysis( logger.info(f"Received analysis request for {request.ticker} on {request.analysis_date}") # Run analysis with all provided parameters including API keys - result = await trading_service.run_analysis( + result = await service.run_analysis( ticker=request.ticker, analysis_date=request.analysis_date, openai_api_key=request.openai_api_key, diff --git a/backend/app/core/cors.py b/backend/app/core/cors.py index 07b3d648..882bcc8f 100644 --- a/backend/app/core/cors.py +++ b/backend/app/core/cors.py @@ -1,8 +1,10 @@ """ -CORS configuration for TradingAgents Backend API +CORS Configuration """ +from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware -from app.core.config import settings + +from backend.app.core.config import settings def setup_cors(app): diff --git a/backend/app/main.py b/backend/app/main.py index 49f3dd5a..e9c95a11 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -7,9 +7,9 @@ import logging import sys from pathlib import Path -from app.core.config import settings -from app.core.cors import setup_cors -from app.api.routes import router +from backend.app.core.config import settings +from backend.app.core.cors import setup_cors +from backend.app.api.routes import router # Configure logging logging.basicConfig( diff --git a/backend/app/services/trading_service.py b/backend/app/services/trading_service.py index bfc63e9d..40368297 100644 --- a/backend/app/services/trading_service.py +++ b/backend/app/services/trading_service.py @@ -12,7 +12,7 @@ sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent)) from tradingagents.graph.trading_graph import TradingAgentsGraph from tradingagents.default_config import DEFAULT_CONFIG -from app.core.config import settings +from backend.app.core.config import settings logger = logging.getLogger(__name__)