-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
383 lines (362 loc) · 10.8 KB
/
Copy pathconfig.example.yaml
File metadata and controls
383 lines (362 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# 全球新闻抓取和分析系统配置文件示例
# 复制此文件为 config.yaml 并填入你的配置
# Gmail配置
email:
smtp_server: "smtp.gmail.com"
smtp_port: 587
sender_email: "your-email@gmail.com" # 请修改为你的Gmail地址
sender_password: "your-app-password" # 请使用Gmail应用专用密码,不是登录密码
recipient_email: "your-email@gmail.com" # 接收邮件的地址(保留向后兼容)
recipient_emails: # 支持多个接收邮箱(推荐使用)
- "your-email@gmail.com"
- "another@example.com" # 可以添加更多邮箱
- "team@company.com"
# 大模型配置 (支持OpenAI和Anthropic)
llm:
provider: "openai" # 可选: openai, anthropic, openai-compatible
api_key: "your-api-key-here" # 请填入你的API Key
model: "gpt-4o" # OpenAI: gpt-4o, gpt-4-turbo; Anthropic: claude-3-5-sonnet-20241022
base_url: "" # OpenAI兼容接口的base_url,如使用OpenAI官方可留空
max_tokens: 4000
temperature: 0.7
timeout_seconds: 1800 # 本地模型处理长上下文时允许最多等待30分钟
max_retries: 1 # 超时后只重试一次,避免任务长时间堆积
# News API配置
news_api:
enabled: true
api_key: "your-newsapi-key" # 从 https://newsapi.org 获取
countries: ["us", "gb", "de", "fr", "ru", "sg", "th", "id", "jp", "in"]
categories: ["business", "technology", "general"]
page_size: 10
max_articles_per_country: 10
# 免费、无需 API Key 的全球新闻索引。仅保留白名单媒体,并作为 RSS 的补充。
gdelt:
enabled: true
timespan: "1d"
max_records_per_query: 20
queries:
- "(economy OR market OR inflation OR \"interest rate\")"
- "(semiconductor OR chip OR AI OR memory OR storage)"
- "(bank OR credit OR liquidity OR consumer OR retail)"
- "(US election OR White House OR Congress OR foreign policy OR Middle East)"
trusted_domains:
- "reuters.com"
- "bbc.com"
- "ft.com"
- "apnews.com"
- "cnbc.com"
- "npr.org"
- "theguardian.com"
- "federalreserve.gov"
# Google News 搜索 RSS:免费无需密钥,仅接受媒体名称白名单。
google_news:
enabled: true
language: "en-US"
country: "US"
ceid: "US:en"
max_records_per_query: 20
queries:
- "global economy markets"
- "semiconductor AI memory storage"
- "banking credit consumer retail"
- "US election White House Congress Middle East foreign policy"
- "site:imf.org/en/News/Articles IMF"
trusted_sources:
- "Reuters"
- "BBC"
- "Financial Times"
- "Associated Press"
- "CNBC"
- "NPR"
- "The Guardian"
- "International Monetary Fund | IMF"
# IMF 的 RSS 页面会返回 HTML/403;保留官网归档作为独立的尽力抓取入口。
imf_archive:
enabled: true
url: "https://www.imf.org/en/whats-new-archive"
language: "en"
lookback_days: 30
max_records: 10
region: "international"
priority: 5
sectors: ["finance", "policy"]
# RSS Feed配置
rss_feeds:
enabled: true
sources:
# 全球综合
- name: "BBC World News"
url: "http://feeds.bbci.co.uk/news/world/rss.xml"
region: "global"
priority: 5
- name: "BBC Business"
url: "http://feeds.bbci.co.uk/news/business/rss.xml"
region: "global"
priority: 5
- name: "Al Jazeera"
url: "https://www.aljazeera.com/xml/rss/all.xml"
region: "global"
priority: 5
# 美国
- name: "NPR News"
url: "https://feeds.npr.org/1001/rss.xml"
region: "americas"
priority: 5
- name: "CNN Top Stories"
url: "http://rss.cnn.com/rss/cnn_topstories.rss"
region: "americas"
priority: 4
- name: "CNN World"
url: "http://rss.cnn.com/rss/cnn_world.rss"
region: "americas"
priority: 4
# 欧洲
- name: "Financial Times"
url: "https://www.ft.com/?format=rss"
region: "europe"
priority: 5
- name: "Deutsche Welle"
url: "https://rss.dw.com/xml/rss-en-all"
region: "europe"
priority: 4
- name: "France 24"
url: "https://www.france24.com/en/rss"
region: "europe"
priority: 4
- name: "The Guardian World"
url: "https://www.theguardian.com/world/rss"
region: "europe"
priority: 5
# 亚洲和东南亚
- name: "Channel NewsAsia"
url: "https://www.channelnewsasia.com/api/v1/rss-outbound-feed?_format=xml"
region: "asia"
priority: 5
- name: "Nikkei Asia"
url: "https://asia.nikkei.com/rss/feed/nar"
region: "asia"
priority: 5
- name: "The Straits Times"
url: "https://www.straitstimes.com/news/world/rss.xml"
region: "asia"
priority: 4
- name: "Bangkok Post"
url: "https://www.bangkokpost.com/rss/data/news.xml"
region: "asia"
priority: 3
- name: "South China Morning Post"
url: "https://www.scmp.com/rss/91/feed"
region: "asia"
priority: 5
# 俄罗斯
- name: "TASS"
url: "https://tass.com/rss/v2.xml"
region: "russia"
priority: 3
- name: "Moscow Times"
url: "https://www.themoscowtimes.com/rss/news"
region: "russia"
priority: 4
# 国际组织
- name: "UN News"
url: "https://news.un.org/feed/subscribe/en/news/all/rss.xml"
region: "international"
priority: 4
- name: "Federal Reserve Press"
url: "https://www.federalreserve.gov/feeds/press_all.xml"
region: "americas"
priority: 5
sectors: ["finance", "policy"]
# 新闻抓取配置
fetcher:
max_articles: 50 # 每次抓取的最大文章数
fetch_interval_hours: 24 # 抓取间隔(小时)
timeout_seconds: 30 # 请求超时时间
retry_attempts: 3 # 失败重试次数
retry_delay_seconds: 5 # 重试延迟
user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
# 内容过滤配置
content_filter:
min_content_length: 100 # 最小内容长度
exclude_keywords: # 排除包含这些关键词的文章
- "horoscope"
- "celebrity gossip"
- "entertainment"
- "sports"
include_keywords: # 优先包含这些关键词的文章
- "economy"
- "market"
- "trade"
- "gdp"
- "inflation"
- "policy"
- "geopolitical"
- "sanctions"
- "investment"
- "stock"
- "AI"
- "IT"
- "semiconductor"
- "chip"
- "memory"
- "storage"
- "HBM"
- "bank"
- "credit"
- "interest rate"
- "consumer"
- "retail"
- "证监会"
- "人民银行"
- "工信部"
- "election"
- "White House"
- "Congress"
- "President"
- "外交政策"
- "美国大选"
- "白宫"
- "国会"
sector_keywords:
tech: ["AI", "semiconductor", "chip", "memory", "storage", "HBM", "算力", "芯片", "半导体", "存储"]
finance: ["bank", "banking", "credit", "interest rate", "liquidity", "银行", "券商", "保险", "降准", "降息"]
consumer: ["consumer", "retail", "consumer spending", "消费", "零售", "社零", "以旧换新", "食品饮料"]
policy: ["policy", "regulation", "Federal Reserve", "PBOC", "CSRC", "政策", "监管", "证监会", "人民银行", "工信部"]
us_politics: ["election", "White House", "Congress", "President", "campaign", "sanctions", "foreign policy", "美国大选", "白宫", "国会", "选举", "外交政策"]
# 美股和 A 股行业行情。A 股代码使用腾讯日线代码与东财 secid 的组合。
markets:
enabled: true
historical_days: 90
timeout_seconds: 20
retry_attempts: 2
retry_delay_seconds: 2
assets:
- name: "标普500ETF"
symbol: "SPY"
provider: "yahoo"
market: "US"
sector: "broad"
- name: "纳斯达克100ETF"
symbol: "QQQ"
provider: "yahoo"
market: "US"
sector: "tech"
- name: "美国半导体ETF"
symbol: "SMH"
provider: "yahoo"
market: "US"
sector: "tech"
- name: "美国金融ETF"
symbol: "XLF"
provider: "yahoo"
market: "US"
sector: "finance"
- name: "美国必需消费ETF"
symbol: "XLP"
provider: "yahoo"
market: "US"
sector: "consumer"
- name: "美国可选消费ETF"
symbol: "XLY"
provider: "yahoo"
market: "US"
sector: "consumer"
- name: "VIX恐慌指数"
symbol: "^VIX"
provider: "yahoo"
market: "US"
sector: "risk"
- name: "沪深300"
symbol: "000300"
tencent_symbol: "sh000300"
secid: "1.000300"
provider: "eastmoney"
market: "CN"
sector: "broad"
- name: "科创50"
symbol: "000688"
tencent_symbol: "sh000688"
secid: "1.000688"
provider: "eastmoney"
market: "CN"
sector: "tech"
- name: "半导体ETF"
symbol: "512480.SS"
provider: "yahoo"
market: "CN"
sector: "tech"
- name: "银行ETF"
symbol: "512800.SS"
provider: "yahoo"
market: "CN"
sector: "finance"
- name: "消费ETF"
symbol: "159928.SZ"
provider: "yahoo"
market: "CN"
sector: "consumer"
# 默认用权威新闻与市场相对强弱生成行业情绪摘要。
# 股吧抓取为可选功能,请确认数据源条款后才启用并配置代码。
sentiment:
enabled: true
guba_enabled: false
timeout_seconds: 15
guba_codes:
tech: []
finance: []
consumer: []
# 分析配置
analysis:
focus_areas:
- "全球经济趋势"
- "地缘政治风险"
- "贸易关系变化"
- "货币政策"
- "全球股市影响因素"
- "中国A股市场分析"
- "大宗商品价格"
- "科技发展趋势"
- "AI行业发展"
- "新能源汽车"
- "半导体产业链"
output_language: "zh-CN" # 输出语言
include_predictions: true # 是否包含预测
prediction_timeframe: "未来1-3个月" # 预测时间范围
include_a_share_analysis: true # 是否包含A股专项分析
short_term_timeframes: ["未来5个交易日", "未来1-4周"]
us_market_focus:
- "科技/AI/半导体与存储"
- "金融与利率传导"
- "必需及可选消费"
a_share_focus:
- "沪深300指数趋势"
- "创业板/科创板机会"
- "行业板块轮动"
- "政策导向行业"
- "出口导向企业影响"
- "资金流向分析"
- "芯片/AI/存储产业链"
- "银行/券商/保险"
- "必需消费与可选消费"
# 日志配置
logging:
level: "INFO" # DEBUG, INFO, WARNING, ERROR, CRITICAL
file: "logs/news_analyzer.log"
max_file_size_mb: 10
backup_count: 5
console_output: true
# 调度配置
scheduler:
enabled: true
run_time: "08:00" # 每天运行时间 (24小时制)
timezone: "Asia/Shanghai" # 时区
# 数据存储配置
storage:
save_raw_news: true
news_cache_dir: "data/news_cache"
reports_dir: "data/reports"
mobile_reports_dir: "data/mobile_reports"
market_cache_dir: "data/market_cache"
historical_news_days: 14
historical_news_max_per_day: 25
max_cache_days: 360 # 缓存保留天数