feat(data): add FRED macro indicators as an optional vendor

Surface Federal Reserve Economic Data (rates, inflation, labor, growth) to the
news analyst via a new get_macro_indicators tool and a macro_data vendor
category. Friendly aliases (cpi, unemployment, fed_funds_rate, 10y_treasury,
yield_curve, ...) map to FRED series IDs; raw series IDs are accepted too. The
report gives the latest value, change over the window, and a recent observation
table. Windowing is lookahead-safe (observation_end = curr_date), missing values
are skipped, and a missing FRED_API_KEY surfaces as a clear not-configured
condition through the vendor router rather than a crash.
This commit is contained in:
Yijia-Xiao committed 2026-06-14 06:08:31 +00:00
1 parent 895ed130f9
commit ddfb840ecf
9 files changed
+453 -2

No files matched your search

+12
View File
@@ -24,6 +24,7 @@ from .alpha_vantage import (
get_global_news as get_alpha_vantage_global_news,
)
from .alpha_vantage_common import AlphaVantageRateLimitError
from .fred import get_macro_data as get_fred_macro_data
from .symbol_utils import NoMarketDataError
# Configuration and routing logic
@@ -61,11 +62,18 @@ TOOLS_CATEGORIES = {
"get_global_news",
"get_insider_transactions",
]
},
"macro_data": {
"description": "Macroeconomic indicators (rates, inflation, labor, growth)",
"tools": [
"get_macro_indicators",
]
}
}
VENDOR_LIST = [
"yfinance",
"fred",
"alpha_vantage",
]
@@ -111,6 +119,10 @@ VENDOR_METHODS = {
"alpha_vantage": get_alpha_vantage_insider_transactions,
"yfinance": get_yfinance_insider_transactions,
},
# macro_data
"get_macro_indicators": {
"fred": get_fred_macro_data,
},
}
def get_category_for_method(method: str) -> str: