From 8b04ec307fa5cd8cb39a0cedce6260f3b1b3ee52 Mon Sep 17 00:00:00 2001 From: luohy15 Date: Fri, 26 Sep 2025 23:25:33 +0800 Subject: [PATCH] minor fix --- tradingagents/agents/analysts/market_analyst.py | 2 +- tradingagents/agents/utils/core_stock_tools.py | 4 ++-- tradingagents/agents/utils/fundamental_data_tools.py | 10 +++++----- tradingagents/agents/utils/news_data_tools.py | 10 +++++----- .../agents/utils/technical_indicators_tools.py | 4 ++-- tradingagents/dataflows/alpha_vantage_common.py | 2 +- tradingagents/dataflows/interface.py | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tradingagents/agents/analysts/market_analyst.py b/tradingagents/agents/analysts/market_analyst.py index 8695acc7..c955dd76 100644 --- a/tradingagents/agents/analysts/market_analyst.py +++ b/tradingagents/agents/analysts/market_analyst.py @@ -42,7 +42,7 @@ Volatility Indicators: Volume-Based Indicators: - vwma: VWMA: A moving average weighted by volume. Usage: Confirm trends by integrating price action with volume data. Tips: Watch for skewed results from volume spikes; use in combination with other volume analyses. -- Select indicators that provide diverse and complementary information. Avoid redundancy (e.g., do not select both rsi and stochrsi). Also briefly explain why they are suitable for the given market context. When you tool call, please use the exact name of the indicators provided above as they are defined parameters, otherwise your call will fail. Please make sure to call get_stock_data first to retrieve the CSV that is needed to generate indicators. Then use get_technical_indicators with the specific indicator names. Write a very detailed and nuanced report of the trends you observe. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions.""" +- Select indicators that provide diverse and complementary information. Avoid redundancy (e.g., do not select both rsi and stochrsi). Also briefly explain why they are suitable for the given market context. When you tool call, please use the exact name of the indicators provided above as they are defined parameters, otherwise your call will fail. Please make sure to call get_stock_data first to retrieve the CSV that is needed to generate indicators. Then use get_indicators with the specific indicator names. Write a very detailed and nuanced report of the trends you observe. Do not simply state the trends are mixed, provide detailed and finegrained analysis and insights that may help traders make decisions.""" + """ Make sure to append a Markdown table at the end of the report to organize key points in the report, organized and easy to read.""" ) diff --git a/tradingagents/agents/utils/core_stock_tools.py b/tradingagents/agents/utils/core_stock_tools.py index 02733c6c..3a416622 100644 --- a/tradingagents/agents/utils/core_stock_tools.py +++ b/tradingagents/agents/utils/core_stock_tools.py @@ -1,6 +1,6 @@ from langchain_core.tools import tool from typing import Annotated -from tradingagents.dataflows.interface import route_to_vender +from tradingagents.dataflows.interface import route_to_vendor @tool @@ -19,4 +19,4 @@ def get_stock_data( Returns: str: A formatted dataframe containing the stock price data for the specified ticker symbol in the specified date range. """ - return route_to_vender("get_stock_data", symbol, start_date, end_date) + return route_to_vendor("get_stock_data", symbol, start_date, end_date) diff --git a/tradingagents/agents/utils/fundamental_data_tools.py b/tradingagents/agents/utils/fundamental_data_tools.py index bbfd0153..47f6f2eb 100644 --- a/tradingagents/agents/utils/fundamental_data_tools.py +++ b/tradingagents/agents/utils/fundamental_data_tools.py @@ -1,6 +1,6 @@ from langchain_core.tools import tool from typing import Annotated -from tradingagents.dataflows.interface import route_to_vender +from tradingagents.dataflows.interface import route_to_vendor @tool @@ -17,7 +17,7 @@ def get_fundamentals( Returns: str: A formatted report containing comprehensive fundamental data """ - return route_to_vender("get_fundamentals", ticker, curr_date) + return route_to_vendor("get_fundamentals", ticker, curr_date) @tool @@ -36,7 +36,7 @@ def get_balance_sheet( Returns: str: A formatted report containing balance sheet data """ - return route_to_vender("get_balance_sheet", ticker, freq, curr_date) + return route_to_vendor("get_balance_sheet", ticker, freq, curr_date) @tool @@ -55,7 +55,7 @@ def get_cashflow( Returns: str: A formatted report containing cash flow statement data """ - return route_to_vender("get_cashflow", ticker, freq, curr_date) + return route_to_vendor("get_cashflow", ticker, freq, curr_date) @tool @@ -74,4 +74,4 @@ def get_income_statement( Returns: str: A formatted report containing income statement data """ - return route_to_vender("get_income_statement", ticker, freq, curr_date) \ No newline at end of file + return route_to_vendor("get_income_statement", ticker, freq, curr_date) \ No newline at end of file diff --git a/tradingagents/agents/utils/news_data_tools.py b/tradingagents/agents/utils/news_data_tools.py index e42b4dfe..0df9d047 100644 --- a/tradingagents/agents/utils/news_data_tools.py +++ b/tradingagents/agents/utils/news_data_tools.py @@ -1,6 +1,6 @@ from langchain_core.tools import tool from typing import Annotated -from tradingagents.dataflows.interface import route_to_vender +from tradingagents.dataflows.interface import route_to_vendor @tool def get_news( @@ -18,7 +18,7 @@ def get_news( Returns: str: A formatted string containing news data """ - return route_to_vender("get_news", ticker, start_date, end_date) + return route_to_vendor("get_news", ticker, start_date, end_date) @tool def get_global_news( @@ -36,7 +36,7 @@ def get_global_news( Returns: str: A formatted string containing global news data """ - return route_to_vender("get_global_news", curr_date, look_back_days, limit) + return route_to_vendor("get_global_news", curr_date, look_back_days, limit) @tool def get_insider_sentiment( @@ -52,7 +52,7 @@ def get_insider_sentiment( Returns: str: A report of insider sentiment data """ - return route_to_vender("get_insider_sentiment", ticker, curr_date) + return route_to_vendor("get_insider_sentiment", ticker, curr_date) @tool def get_insider_transactions( @@ -68,4 +68,4 @@ def get_insider_transactions( Returns: str: A report of insider transaction data """ - return route_to_vender("get_insider_transactions", ticker, curr_date) + return route_to_vendor("get_insider_transactions", ticker, curr_date) diff --git a/tradingagents/agents/utils/technical_indicators_tools.py b/tradingagents/agents/utils/technical_indicators_tools.py index 86aba653..c6c08bca 100644 --- a/tradingagents/agents/utils/technical_indicators_tools.py +++ b/tradingagents/agents/utils/technical_indicators_tools.py @@ -1,6 +1,6 @@ from langchain_core.tools import tool from typing import Annotated -from tradingagents.dataflows.interface import route_to_vender +from tradingagents.dataflows.interface import route_to_vendor @tool def get_indicators( @@ -20,4 +20,4 @@ def get_indicators( Returns: str: A formatted dataframe containing the technical indicators for the specified ticker symbol and indicator. """ - return route_to_vender("get_indicators", symbol, indicator, curr_date, look_back_days) \ No newline at end of file + return route_to_vendor("get_indicators", symbol, indicator, curr_date, look_back_days) \ No newline at end of file diff --git a/tradingagents/dataflows/alpha_vantage_common.py b/tradingagents/dataflows/alpha_vantage_common.py index aeeb30ef..8fa17a7e 100644 --- a/tradingagents/dataflows/alpha_vantage_common.py +++ b/tradingagents/dataflows/alpha_vantage_common.py @@ -43,7 +43,7 @@ def _make_api_request(function_name: str, params: dict) -> dict | str: api_params.update({ "function": function_name, "apikey": get_api_key(), - "source": "alphavangtagemcp" + "source": "tradingagents", }) # Handle entitlement parameter if present in params or global variable diff --git a/tradingagents/dataflows/interface.py b/tradingagents/dataflows/interface.py index 3a23f4ce..43044149 100644 --- a/tradingagents/dataflows/interface.py +++ b/tradingagents/dataflows/interface.py @@ -133,7 +133,7 @@ def get_vendor(category: str, method: str = None) -> str: # Fall back to category-level configuration return config.get("data_vendors", {}).get(category, "default") -def route_to_vender(method: str, *args, **kwargs): +def route_to_vendor(method: str, *args, **kwargs): """Route method calls to appropriate vendor implementation.""" category = get_category_for_method(method) vendor_config = get_vendor(category, method)