From 5ac72567be903b056dfa531fe9b975d1e8ce4cfc Mon Sep 17 00:00:00 2001 From: Robin Lindbladh Date: Tue, 24 Mar 2026 21:08:14 +0100 Subject: [PATCH] fix: add config parameter to PortfolioAnalyzer constructor Required by the configurable log directory and config passthrough from TradingAgentsGraph that were applied via GitHub suggestions. Co-Authored-By: Claude Opus 4.6 (1M context) --- tradingagents/graph/portfolio_analysis.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tradingagents/graph/portfolio_analysis.py b/tradingagents/graph/portfolio_analysis.py index e03e8f5b..2af2a2bf 100644 --- a/tradingagents/graph/portfolio_analysis.py +++ b/tradingagents/graph/portfolio_analysis.py @@ -16,13 +16,15 @@ class PortfolioAnalyzer: owns the portfolio-level prompt, comparison logic, and logging. """ - def __init__(self, deep_thinking_llm: BaseChatModel): + def __init__(self, deep_thinking_llm: BaseChatModel, config: Dict[str, Any]): """Initialize with the deep thinking LLM for comparative analysis. Args: deep_thinking_llm: The LLM instance used for the portfolio summary. + config: The configuration dictionary for the application. """ self.deep_thinking_llm = deep_thinking_llm + self.config = config def analyze( self,