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
|
# Phase 1: Market scan
|
||||||
yield self._system_log("Phase 1/3: Running market scan…")
|
yield self._system_log("Phase 1/3: Running market scan…")
|
||||||
async for evt in self.run_scan(f"{run_id}_scan", {"date": date}):
|
store = ReportStore()
|
||||||
yield evt
|
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
|
# Phase 2: Pipeline analysis — get tickers from saved scan report
|
||||||
yield self._system_log("Phase 2/3: Loading stocks from 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)
|
tickers = self._extract_tickers_from_scan_data(scan_data)
|
||||||
|
|
||||||
if not tickers:
|
if not tickers:
|
||||||
|
|
@ -378,6 +382,10 @@ class LangGraphEngine:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
for ticker in tickers:
|
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}…")
|
yield self._system_log(f"Phase 2/3: Running analysis pipeline for {ticker}…")
|
||||||
async for evt in self.run_pipeline(
|
async for evt in self.run_pipeline(
|
||||||
f"{run_id}_pipeline_{ticker}", {"ticker": ticker, "date": date}
|
f"{run_id}_pipeline_{ticker}", {"ticker": ticker, "date": date}
|
||||||
|
|
@ -387,10 +395,14 @@ class LangGraphEngine:
|
||||||
# Phase 3: Portfolio management
|
# Phase 3: Portfolio management
|
||||||
yield self._system_log("Phase 3/3: Running portfolio manager…")
|
yield self._system_log("Phase 3/3: Running portfolio manager…")
|
||||||
portfolio_params = {k: v for k, v in params.items() if k != "ticker"}
|
portfolio_params = {k: v for k, v in params.items() if k != "ticker"}
|
||||||
async for evt in self.run_portfolio(
|
# Check if portfolio decision already exists
|
||||||
f"{run_id}_portfolio", {"date": date, **portfolio_params}
|
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.")
|
||||||
yield evt
|
else:
|
||||||
|
async for evt in self.run_portfolio(
|
||||||
|
f"{run_id}_portfolio", {"date": date, **portfolio_params}
|
||||||
|
):
|
||||||
|
yield evt
|
||||||
|
|
||||||
logger.info("Completed AUTO run=%s", run_id)
|
logger.info("Completed AUTO run=%s", run_id)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,15 +221,15 @@ class PortfolioGraphSetup:
|
||||||
|
|
||||||
# Register LLM nodes
|
# Register LLM nodes
|
||||||
workflow.add_node("review_holdings", self.agents["review_holdings"])
|
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
|
# Sequential edges
|
||||||
workflow.add_edge(START, "load_portfolio")
|
workflow.add_edge(START, "load_portfolio")
|
||||||
workflow.add_edge("load_portfolio", "compute_risk")
|
workflow.add_edge("load_portfolio", "compute_risk")
|
||||||
workflow.add_edge("compute_risk", "review_holdings")
|
workflow.add_edge("compute_risk", "review_holdings")
|
||||||
workflow.add_edge("review_holdings", "prioritize_candidates")
|
workflow.add_edge("review_holdings", "prioritize_candidates")
|
||||||
workflow.add_edge("prioritize_candidates", "pm_decision")
|
workflow.add_edge("prioritize_candidates", "make_pm_decision")
|
||||||
workflow.add_edge("pm_decision", "execute_trades")
|
workflow.add_edge("make_pm_decision", "execute_trades")
|
||||||
workflow.add_edge("execute_trades", END)
|
workflow.add_edge("execute_trades", END)
|
||||||
|
|
||||||
return workflow.compile()
|
return workflow.compile()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue