refactor: align display label and docs with sentiment_analyst rename

The agent ingests news, StockTwits, and Reddit, but CLI labels, the
README description, and the legacy shim docstring still framed it as
social-media-only. Updates all user-visible surfaces so the name and
the implementation match.
This commit is contained in:
Yijia-Xiao
2026-05-11 06:25:22 +00:00
parent 9f7abfcbd5
commit 879e2bb5da
6 changed files with 16 additions and 14 deletions

View File

@@ -68,7 +68,7 @@ Our framework decomposes complex trading tasks into specialized roles. This ensu
### Analyst Team
- Fundamentals Analyst: Evaluates company financials and performance metrics, identifying intrinsic values and potential red flags.
- Sentiment Analyst: Analyzes social media and public sentiment using sentiment scoring algorithms to gauge short-term market mood.
- Sentiment Analyst: Aggregates news headlines, StockTwits, and Reddit chatter into a single sentiment read to gauge short-term market mood.
- News Analyst: Monitors global news and macroeconomic indicators, interpreting the impact of events on market conditions.
- Technical Analyst: Utilizes technical indicators (like MACD and RSI) to detect trading patterns and forecast price movements.

View File

@@ -49,7 +49,7 @@ class MessageBuffer:
# Analyst name mapping
ANALYST_MAPPING = {
"market": "Market Analyst",
"social": "Social Analyst",
"social": "Sentiment Analyst",
"news": "News Analyst",
"fundamentals": "Fundamentals Analyst",
}
@@ -59,7 +59,7 @@ class MessageBuffer:
# finalizing_agent: which agent must be "completed" for this report to count as done
REPORT_SECTIONS = {
"market_report": ("market", "Market Analyst"),
"sentiment_report": ("social", "Social Analyst"),
"sentiment_report": ("social", "Sentiment Analyst"),
"news_report": ("news", "News Analyst"),
"fundamentals_report": ("fundamentals", "Fundamentals Analyst"),
"investment_plan": (None, "Research Manager"),
@@ -280,7 +280,7 @@ def update_display(layout, spinner_text=None, stats_handler=None, start_time=Non
all_teams = {
"Analyst Team": [
"Market Analyst",
"Social Analyst",
"Sentiment Analyst",
"News Analyst",
"Fundamentals Analyst",
],
@@ -680,7 +680,7 @@ def save_report_to_disk(final_state, ticker: str, save_path: Path):
if final_state.get("sentiment_report"):
analysts_dir.mkdir(exist_ok=True)
(analysts_dir / "sentiment.md").write_text(final_state["sentiment_report"], encoding="utf-8")
analyst_parts.append(("Social Analyst", final_state["sentiment_report"]))
analyst_parts.append(("Sentiment Analyst", final_state["sentiment_report"]))
if final_state.get("news_report"):
analysts_dir.mkdir(exist_ok=True)
(analysts_dir / "news.md").write_text(final_state["news_report"], encoding="utf-8")
@@ -765,7 +765,7 @@ def display_complete_report(final_state):
if final_state.get("market_report"):
analysts.append(("Market Analyst", final_state["market_report"]))
if final_state.get("sentiment_report"):
analysts.append(("Social Analyst", final_state["sentiment_report"]))
analysts.append(("Sentiment Analyst", final_state["sentiment_report"]))
if final_state.get("news_report"):
analysts.append(("News Analyst", final_state["news_report"]))
if final_state.get("fundamentals_report"):
@@ -827,7 +827,7 @@ def update_research_team_status(status):
ANALYST_ORDER = ["market", "social", "news", "fundamentals"]
ANALYST_AGENT_NAMES = {
"market": "Market Analyst",
"social": "Social Analyst",
"social": "Sentiment Analyst",
"news": "News Analyst",
"fundamentals": "Fundamentals Analyst",
}

View File

@@ -5,6 +5,8 @@ from pydantic import BaseModel
class AnalystType(str, Enum):
MARKET = "market"
# Wire value stays "social" for saved-config and string-keyed-caller
# back-compat; the user-facing label is "Sentiment Analyst".
SOCIAL = "social"
NEWS = "news"
FUNDAMENTALS = "fundamentals"

View File

@@ -16,7 +16,7 @@ TICKER_INPUT_EXAMPLES = "Examples: SPY, CNC.TO, 7203.T, 0700.HK"
ANALYST_ORDER = [
("Market Analyst", AnalystType.MARKET),
("Social Media Analyst", AnalystType.SOCIAL),
("Sentiment Analyst", AnalystType.SOCIAL),
("News Analyst", AnalystType.NEWS),
("Fundamentals Analyst", AnalystType.FUNDAMENTALS),
]

View File

@@ -1,9 +1,9 @@
"""Backwards-compatibility shim for the renamed social_media_analyst module.
"""Backwards-compatibility shim for the renamed module.
The social media analyst has been renamed to ``sentiment_analyst`` because its
only data tool is ``get_news`` (Yahoo Finance), not a social media feed.
Import from ``tradingagents.agents.analysts.sentiment_analyst`` going forward.
The agent is now ``sentiment_analyst`` and aggregates Yahoo Finance news,
StockTwits cashtag streams, and Reddit posts into a single sentiment
report. Import from ``tradingagents.agents.analysts.sentiment_analyst``
going forward; this module will be removed in a future release.
See: https://github.com/TauricResearch/TradingAgents/issues/557
"""

View File

@@ -51,7 +51,7 @@ class AgentState(MessagesState):
# research step
market_report: Annotated[str, "Report from the Market Analyst"]
sentiment_report: Annotated[str, "Report from the Social Media Analyst"]
sentiment_report: Annotated[str, "Report from the Sentiment Analyst"]
news_report: Annotated[
str, "Report from the News Researcher of current world affairs"
]