Switch on debug mode

This commit is contained in:
Jenit Jain 2025-08-10 18:39:44 -07:00
parent e303468047
commit 37e4a09022
4 changed files with 8 additions and 59 deletions

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,7 @@ from .signal_processing import SignalProcessor
# Import data transformation agent
from tradingagents.agents.data_visualizer.data_transformation_agent import DataTransformationAgent, TransformationConfig
RESULTS_BASE = os.path.join(os.path.dirname(__file__), "..", "..", "output_data")
class TradingAgentsGraph:
"""Main class that orchestrates the trading agents framework."""
@ -191,7 +192,7 @@ class TradingAgentsGraph:
# Transform output JSON into widget-friendly format
data_transformation_agent = DataTransformationAgent(TransformationConfig(
eval_results_path=f"../output_data/{company_name}/TradingAgentsStrategy_transformed_logs/full_states_log_{trade_date}.json"))
eval_results_path=f"{RESULTS_BASE}/{company_name}/TradingAgentsStrategy_transformed_logs/full_states_log_{trade_date}.json"))
transformed_output = data_transformation_agent.transform_single_file(self._get_state(trade_date))

View File

@ -14,10 +14,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG
app = FastAPI(title="TradingAgents API", version="1.0.0")
app = FastAPI(title="TradingAgents API", version="1.0.0", debug=True)
# Centralized results directory to avoid repetition
RESULTS_BASE = os.path.join(os.path.dirname(__file__), "output_data")
RESULTS_BASE = os.path.join(os.path.dirname(__file__), "..", "..", "output_data")
# Configure CORS
app.add_middleware(
@ -78,6 +78,9 @@ async def run_analysis_task(job_id: str, symbol: str, analysis_date: str, config
jobs[job_id].progress = f"Analyzing {symbol} for {analysis_date}..."
_, decision = ta.propagate(symbol, analysis_date)
print(_)
print("Decision: ", decision)
jobs[job_id].status = "completed"
jobs[job_id].result = {
"symbol": symbol,
@ -141,7 +144,6 @@ async def get_analysis_status(job_id: str):
async def get_companies():
"""Get list of companies with analysis results"""
results_dir = RESULTS_BASE
print(results_dir)
if not os.path.exists(results_dir):
return {"companies": []}
@ -325,4 +327,4 @@ async def get_default_config():
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)