feat: Alpha Vantage备选数据源配置

- Alpha Vantage API Key: W5PTA2J5OB16W02L
- 数据源优先级: Yahoo Finance → Alpha Vantage
- 当Yahoo Finance限流时自动fallback到Alpha Vantage
This commit is contained in:
小钰 committed 2026-07-08 17:05:13 +08:00
1 parent af1391d6ae
commit 9a6c476ff1
2 files changed
+23

No files matched your search

+11
View File
@@ -530,6 +530,7 @@ def run_analysis(task_id, ticker, date):
# 设置环境变量
os.environ['OPENAI_COMPATIBLE_API_KEY'] = 'tp-ce6eaqg1gh1uev46i4oexh4sahloyfo2hfpxuc2n9m7yl9dd'
os.environ['FRED_API_KEY'] = '825283926dd016ea66e96cc919e047da'
os.environ['ALPHA_VANTAGE_API_KEY'] = 'W5PTA2J5OB16W02L'
log(f'📊 开始分析 {ticker} ({date})')
log(f'🤖 模型: MiMo-v2.5-pro')
@@ -546,6 +547,16 @@ def run_analysis(task_id, ticker, date):
config['max_debate_rounds'] = 1
config['max_risk_discuss_rounds'] = 1
# 配置数据源:Yahoo Finance优先,Alpha Vantage作为备选
config['data_vendors'] = {
'core_stock_apis': 'yfinance,alpha_vantage',
'technical_indicators': 'yfinance,alpha_vantage',
'fundamental_data': 'yfinance,alpha_vantage',
'news_data': 'yfinance,alpha_vantage',
'macro_data': 'fred',
'prediction_markets': 'polymarket',
}
log('🔧 配置完成,启动分析引擎...')
ta = TradingAgentsGraph(debug=True, config=config)