Switch on debug mode
This commit is contained in:
parent
e303468047
commit
37e4a09022
File diff suppressed because one or more lines are too long
|
|
@ -31,6 +31,7 @@ from .signal_processing import SignalProcessor
|
||||||
# Import data transformation agent
|
# Import data transformation agent
|
||||||
from tradingagents.agents.data_visualizer.data_transformation_agent import DataTransformationAgent, TransformationConfig
|
from tradingagents.agents.data_visualizer.data_transformation_agent import DataTransformationAgent, TransformationConfig
|
||||||
|
|
||||||
|
RESULTS_BASE = os.path.join(os.path.dirname(__file__), "..", "..", "output_data")
|
||||||
|
|
||||||
class TradingAgentsGraph:
|
class TradingAgentsGraph:
|
||||||
"""Main class that orchestrates the trading agents framework."""
|
"""Main class that orchestrates the trading agents framework."""
|
||||||
|
|
@ -191,7 +192,7 @@ class TradingAgentsGraph:
|
||||||
|
|
||||||
# Transform output JSON into widget-friendly format
|
# Transform output JSON into widget-friendly format
|
||||||
data_transformation_agent = DataTransformationAgent(TransformationConfig(
|
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))
|
transformed_output = data_transformation_agent.transform_single_file(self._get_state(trade_date))
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -14,10 +14,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
|
||||||
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
||||||
from tradingagents.default_config import DEFAULT_CONFIG
|
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
|
# 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
|
# Configure CORS
|
||||||
app.add_middleware(
|
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}..."
|
jobs[job_id].progress = f"Analyzing {symbol} for {analysis_date}..."
|
||||||
_, decision = ta.propagate(symbol, analysis_date)
|
_, decision = ta.propagate(symbol, analysis_date)
|
||||||
|
|
||||||
|
print(_)
|
||||||
|
print("Decision: ", decision)
|
||||||
|
|
||||||
jobs[job_id].status = "completed"
|
jobs[job_id].status = "completed"
|
||||||
jobs[job_id].result = {
|
jobs[job_id].result = {
|
||||||
"symbol": symbol,
|
"symbol": symbol,
|
||||||
|
|
@ -141,7 +144,6 @@ async def get_analysis_status(job_id: str):
|
||||||
async def get_companies():
|
async def get_companies():
|
||||||
"""Get list of companies with analysis results"""
|
"""Get list of companies with analysis results"""
|
||||||
results_dir = RESULTS_BASE
|
results_dir = RESULTS_BASE
|
||||||
print(results_dir)
|
|
||||||
if not os.path.exists(results_dir):
|
if not os.path.exists(results_dir):
|
||||||
return {"companies": []}
|
return {"companies": []}
|
||||||
|
|
||||||
|
|
@ -325,4 +327,4 @@ async def get_default_config():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue