refactor: Remove Chainlit and several other unused dependencies, updating the lock file and related agent configurations.
This commit is contained in:
parent
e568cec68c
commit
c2b14dda35
|
|
@ -362,12 +362,16 @@ class LangGraphEngine:
|
|||
|
||||
# Phase 1: Market scan
|
||||
yield self._system_log("Phase 1/3: Running market scan…")
|
||||
store = ReportStore()
|
||||
if store.load_scan(date):
|
||||
yield self._system_log(f"Phase 1: Macro scan for {date} already exists, skipping.")
|
||||
else:
|
||||
async for evt in self.run_scan(f"{run_id}_scan", {"date": date}):
|
||||
yield evt
|
||||
|
||||
# Phase 2: Pipeline analysis — get tickers from saved scan report
|
||||
yield self._system_log("Phase 2/3: Loading stocks from scan report…")
|
||||
scan_data = ReportStore().load_scan(date)
|
||||
scan_data = store.load_scan(date)
|
||||
tickers = self._extract_tickers_from_scan_data(scan_data)
|
||||
|
||||
if not tickers:
|
||||
|
|
@ -378,6 +382,10 @@ class LangGraphEngine:
|
|||
)
|
||||
else:
|
||||
for ticker in tickers:
|
||||
if store.load_analysis(date, ticker):
|
||||
yield self._system_log(f"Phase 2: Analysis for {ticker} on {date} already exists, skipping.")
|
||||
continue
|
||||
|
||||
yield self._system_log(f"Phase 2/3: Running analysis pipeline for {ticker}…")
|
||||
async for evt in self.run_pipeline(
|
||||
f"{run_id}_pipeline_{ticker}", {"ticker": ticker, "date": date}
|
||||
|
|
@ -387,6 +395,10 @@ class LangGraphEngine:
|
|||
# Phase 3: Portfolio management
|
||||
yield self._system_log("Phase 3/3: Running portfolio manager…")
|
||||
portfolio_params = {k: v for k, v in params.items() if k != "ticker"}
|
||||
# Check if portfolio decision already exists
|
||||
if store.load_pm_decision(date, portfolio_id):
|
||||
yield self._system_log(f"Phase 3: Portfolio decision for {portfolio_id} on {date} already exists, skipping.")
|
||||
else:
|
||||
async for evt in self.run_portfolio(
|
||||
f"{run_id}_portfolio", {"date": date, **portfolio_params}
|
||||
):
|
||||
|
|
|
|||
|
|
@ -221,15 +221,15 @@ class PortfolioGraphSetup:
|
|||
|
||||
# Register LLM nodes
|
||||
workflow.add_node("review_holdings", self.agents["review_holdings"])
|
||||
workflow.add_node("pm_decision", self.agents["pm_decision"])
|
||||
workflow.add_node("make_pm_decision", self.agents["pm_decision"])
|
||||
|
||||
# Sequential edges
|
||||
workflow.add_edge(START, "load_portfolio")
|
||||
workflow.add_edge("load_portfolio", "compute_risk")
|
||||
workflow.add_edge("compute_risk", "review_holdings")
|
||||
workflow.add_edge("review_holdings", "prioritize_candidates")
|
||||
workflow.add_edge("prioritize_candidates", "pm_decision")
|
||||
workflow.add_edge("pm_decision", "execute_trades")
|
||||
workflow.add_edge("prioritize_candidates", "make_pm_decision")
|
||||
workflow.add_edge("make_pm_decision", "execute_trades")
|
||||
workflow.add_edge("execute_trades", END)
|
||||
|
||||
return workflow.compile()
|
||||
|
|
|
|||
Loading…
Reference in New Issue