-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
273 lines (254 loc) · 15.1 KB
/
config.py
File metadata and controls
273 lines (254 loc) · 15.1 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
"""park-intel configuration."""
import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv(Path(__file__).parent / ".env")
# --- Paths ---
BASE_DIR = Path(__file__).parent
DATA_DIR = BASE_DIR / "data"
DB_PATH = DATA_DIR / "park_intel.db"
# --- API ---
API_HOST = "127.0.0.1"
API_PORT = 8001
# --- CORS ---
CORS_ORIGINS: list[str] = [
o.strip()
for o in os.getenv(
"CORS_ORIGINS",
"http://localhost:5174,http://localhost:8001,http://127.0.0.1:8001",
).split(",")
if o.strip()
]
# --- Collector: Hacker News ---
HN_API_BASE = "https://hn.algolia.com/api/v1"
HN_MIN_SCORE: int = 20
HN_HITS_PER_PAGE: int = 50
HN_SEARCH_KEYWORDS: list[str] = ["crypto", "AI", "trading", "LLM", "agent", "Claude", "OpenAI", "semiconductor", "quant", "fintech", "robotics", "automation"]
# --- Collector: Xueqiu ---
XUEQIU_COOKIE: str = os.getenv("XUEQIU_COOKIE", "")
XUEQIU_KOL_IDS: list[dict[str, str]] = [
{"name": "不明真相的群众", "id": "1955602780", "tag": "macro"},
{"name": "大道无形我有型", "id": "1247347556", "tag": "value"},
{"name": "但斌", "id": "1102105103", "tag": "value"},
{"name": "唐朝", "id": "8290096439", "tag": "value"},
{"name": "DAVID自由之路", "id": "5819606767", "tag": "macro"},
{"name": "释老毛", "id": "6146070786", "tag": "value"},
{"name": "月风_投资笔记", "id": "8833808060", "tag": "macro"},
{"name": "盛丰衍", "id": "2533840321", "tag": "trading"},
{"name": "梁宏", "id": "9887656769", "tag": "value"},
{"name": "坚信价值", "id": "4206051491", "tag": "value"},
{"name": "望京博格", "id": "4579887327", "tag": "tech"},
{"name": "呼伦少威", "id": "3755834159", "tag": "tech"},
{"name": "ETF拯救世界", "id": "4776750571", "tag": "tech"},
{"name": "紫葳侍郎", "id": "2289280338", "tag": "tech"},
{"name": "超短线投机者", "id": "4792753218", "tag": "trading"},
{"name": "追龙头", "id": "8425285191", "tag": "trading"},
{"name": "陈达美股投资", "id": "9598793634", "tag": "us-stock"},
{"name": "Ricky", "id": "6654628252", "tag": "us-stock"},
{"name": "美股研究社", "id": "3582153332", "tag": "us-stock"},
{"name": "仓又加错-刘成岗", "id": "1434679955", "tag": "us-stock"},
]
# --- Collector: Yahoo Finance ---
YAHOO_TICKERS: list[str] = [
"GC=F", # Gold Futures
"GLD", # SPDR Gold Shares ETF
"IAU", # iShares Gold Trust
"NEM", # Newmont (largest gold miner)
"GOLD", # Barrick Gold
]
YAHOO_SEARCH_KEYWORDS: list[str] = [
"gold price",
"XAUUSD",
"gold futures",
"federal reserve gold",
"central bank gold reserves",
]
# --- Collector: Google News ---
GOOGLE_NEWS_QUERIES: list[dict[str, str]] = [
{"query": "gold price forecast", "hl": "en-US", "gl": "US"},
{"query": "XAUUSD trading", "hl": "en-US", "gl": "US"},
{"query": "gold market analysis", "hl": "en-US", "gl": "US"},
{"query": "federal reserve interest rate gold", "hl": "en-US", "gl": "US"},
{"query": "central bank gold reserves", "hl": "en-US", "gl": "US"},
{"query": "黄金价格走势", "hl": "zh-CN", "gl": "CN"},
{"query": "黄金投资分析", "hl": "zh-CN", "gl": "CN"},
]
# --- LLM Tagging ---
ANTHROPIC_API_KEY: str = os.getenv("ANTHROPIC_API_KEY", "")
# --- Source Bootstrap Data (V2: seed only) ---
# Used ONLY by sources/seed.py to populate the source_registry table on first run.
# Runtime (scheduler, health, feed) reads from the DB registry, not this list.
# To change source intervals or active state, edit the registry via the service layer.
SOURCE_BOOTSTRAP: list[dict] = [
{"source": "hackernews", "interval_hours": 1, "category": "frontier-tech"},
{"source": "xueqiu", "interval_hours": 1, "category": "cn-finance"},
{"source": "rss", "interval_hours": 1, "category": "mixed"},
{"source": "github_trending", "interval_hours": 1, "category": "frontier-tech"},
{"source": "yahoo_finance", "interval_hours": 1, "category": "macro"},
{"source": "google_news", "interval_hours": 1, "category": "macro"},
{"source": "social_kol", "interval_hours": 1, "category": "mixed"},
{"source": "reddit", "interval_hours": 1, "category": "mixed"},
{"source": "github_release", "interval_hours": 1, "category": "ai-agent"},
{"source": "website_monitor", "interval_hours": 1, "category": "mixed"},
]
# --- Collector: Social KOL ---
SOCIAL_KOL_HANDLES: list[dict] = [
{"handle": "sama", "category": "llm"},
{"handle": "DarioAmodei", "category": "llm"},
{"handle": "GregBrockman", "category": "llm"},
{"handle": "karpathy", "category": "llm"},
{"handle": "demishassabis", "category": "llm"},
{"handle": "ylecun", "category": "llm"},
{"handle": "AndrewYNg", "category": "llm"},
{"handle": "ClementDelangue", "category": "llm"},
{"handle": "DrJimFan", "category": "ai-agent"},
{"handle": "hwchase17", "category": "ai-agent"},
{"handle": "rowancheung", "category": "ai-agent"},
{"handle": "swyx", "category": "ai-agent"},
{"handle": "finkd", "category": "frontier-tech"},
{"handle": "elonmusk", "category": "frontier-tech"},
{"handle": "satyanadella", "category": "frontier-tech"},
{"handle": "sundarpichai", "category": "frontier-tech"},
{"handle": "pmarca", "category": "frontier-tech"},
{"handle": "VitalikButerin", "category": "crypto"},
{"handle": "cz_binance", "category": "crypto"},
{"handle": "brian_armstrong", "category": "crypto"},
{"handle": "saylor", "category": "crypto"},
{"handle": "WuBlockchain", "category": "crypto"},
{"handle": "balaji", "category": "crypto"},
]
# --- Collector: Reddit ---
REDDIT_SUBREDDITS: list[dict] = [
{"subreddit": "MachineLearning", "category": "llm"},
{"subreddit": "LocalLLaMA", "category": "llm"},
{"subreddit": "ChatGPT", "category": "llm"},
{"subreddit": "OpenAI", "category": "llm"},
{"subreddit": "artificial", "category": "llm"},
{"subreddit": "singularity", "category": "llm"},
{"subreddit": "Anthropic", "category": "llm"},
{"subreddit": "CryptoCurrency", "category": "crypto"},
{"subreddit": "Bitcoin", "category": "crypto"},
{"subreddit": "ethereum", "category": "crypto"},
{"subreddit": "defi", "category": "crypto"},
{"subreddit": "programming", "category": "frontier-tech"},
{"subreddit": "ExperiencedDevs", "category": "frontier-tech"},
]
# --- Collector: GitHub Release ---
GITHUB_TOKEN: str = os.getenv("GITHUB_TOKEN", "")
GITHUB_RELEASE_REPOS: list[dict] = [
{"repo": "openclaw/openclaw", "category": "ai-agent"},
{"repo": "anthropics/claude-code", "category": "ai-agent"},
{"repo": "google-gemini/gemini-cli", "category": "ai-agent"},
{"repo": "openai/codex", "category": "ai-agent"},
]
# --- Collector: Webpage Monitor ---
WEBPAGE_MONITORS: list[dict] = [
{
"name": "Anthropic Claude Blog",
"type": "scrape",
"url": "https://claude.com/blog/",
"category": "llm",
},
{
"name": "OpenClaw Docs",
"type": "github_commits",
"repo": "openclaw/openclaw",
"path": "docs/",
"category": "ai-agent",
},
]
# --- Collector: RSS ---
RSS_FEEDS: list[dict] = [
# === AI / LLM Blogs ===
{"name": "Simon Willison", "url": "https://simonwillison.net/atom/everything/", "category": "llm"},
{"name": "Lilian Weng", "url": "https://lilianweng.github.io/index.xml", "category": "llm"},
{"name": "Sebastian Raschka", "url": "https://magazine.sebastianraschka.com/feed", "category": "llm"},
{"name": "HuggingFace Blog", "url": "https://huggingface.co/blog/feed.xml", "category": "llm"},
{"name": "OpenAI Blog", "url": "https://openai.com/blog/rss.xml", "category": "llm"},
{"name": "Google DeepMind Blog", "url": "https://deepmind.google/blog/rss.xml", "category": "llm"},
{"name": "NVIDIA AI Blog", "url": "https://blogs.nvidia.com/feed/", "category": "llm"},
{"name": "Gary Marcus", "url": "https://garymarcus.substack.com/feed", "category": "llm"},
{"name": "AI Snake Oil", "url": "https://aisnakeoil.substack.com/feed", "category": "llm"},
{"name": "Gwern", "url": "https://gwern.substack.com/feed", "category": "llm"},
{"name": "minimaxir", "url": "https://minimaxir.com/index.xml", "category": "llm"},
{"name": "Google AI Blog", "url": "https://blog.google/technology/ai/rss/", "category": "llm"},
# === AI Newsletter ===
{"name": "Ben's Bites", "url": "https://www.bensbites.com/feed", "category": "ai-agent"},
{"name": "The Decoder", "url": "https://the-decoder.com/feed/", "category": "ai-agent"},
{"name": "MIT Technology Review", "url": "https://www.technologyreview.com/feed", "category": "ai-agent"},
{"name": "VentureBeat AI", "url": "https://venturebeat.com/category/ai/feed/", "category": "ai-agent"},
# === Frontier Tech ===
{"name": "Hacker News Frontpage", "url": "https://hnrss.org/frontpage", "category": "frontier-tech"},
{"name": "Ars Technica", "url": "https://feeds.arstechnica.com/arstechnica/index", "category": "frontier-tech"},
{"name": "Wired", "url": "https://www.wired.com/feed/rss", "category": "frontier-tech"},
{"name": "IEEE Spectrum", "url": "https://spectrum.ieee.org/feeds/feed.rss", "category": "frontier-tech"},
{"name": "ByteByteGo", "url": "https://blog.bytebytego.com/feed", "category": "frontier-tech"},
{"name": "Product Hunt", "url": "https://www.producthunt.com/feed", "category": "frontier-tech"},
{"name": "Paul Graham", "url": "http://www.aaronsw.com/2002/feeds/pgessays.rss", "category": "frontier-tech"},
{"name": "Geohot", "url": "https://geohot.github.io/blog/feed.xml", "category": "frontier-tech"},
{"name": "antirez", "url": "http://antirez.com/rss", "category": "frontier-tech"},
{"name": "Mitchell Hashimoto", "url": "https://mitchellh.com/feed.xml", "category": "frontier-tech"},
{"name": "Dan Abramov", "url": "https://overreacted.io/rss.xml", "category": "frontier-tech"},
{"name": "matklad", "url": "https://matklad.github.io/feed.xml", "category": "frontier-tech"},
{"name": "Hillel Wayne", "url": "https://buttondown.com/hillelwayne/rss", "category": "frontier-tech"},
{"name": "404 Media", "url": "https://www.404media.co/rss", "category": "frontier-tech"},
# === Crypto ===
{"name": "CoinDesk", "url": "https://www.coindesk.com/arc/outboundfeeds/rss/", "category": "crypto"},
{"name": "The Block", "url": "https://www.theblock.co/rss.xml", "category": "crypto"},
{"name": "Decrypt", "url": "https://decrypt.co/feed", "category": "crypto"},
{"name": "Cointelegraph", "url": "https://cointelegraph.com/rss", "category": "crypto"},
{"name": "Messari", "url": "https://messari.io/rss", "category": "crypto"},
{"name": "Bankless", "url": "https://newsletter.banklesshq.com/feed", "category": "crypto"},
{"name": "a16z Crypto", "url": "https://a16zcrypto.substack.com/feed", "category": "crypto"},
{"name": "Vitalik Buterin", "url": "https://vitalik.eth.limo/feed.xml", "category": "crypto"},
# === Former Substack feeds (merged in) ===
{"name": "The Pomp Letter", "url": "https://pomp.substack.com/feed", "category": "crypto"},
{"name": "Doomberg", "url": "https://doomberg.substack.com/feed", "category": "frontier-tech"},
{"name": "One Useful Thing", "url": "https://www.oneusefulthing.org/feed", "category": "llm"},
{"name": "AI Supremacy", "url": "https://www.ai-supremacy.com/feed", "category": "llm"},
{"name": "Interconnects", "url": "https://www.interconnects.ai/feed", "category": "llm"},
{"name": "Dwarkesh Patel", "url": "https://www.dwarkeshpatel.com/feed", "category": "frontier-tech"},
{"name": "SemiAnalysis", "url": "https://semianalysis.substack.com/feed", "category": "frontier-tech"},
# === 中文科技 ===
{"name": "机器之心", "url": "https://www.jiqizhixin.com/rss", "category": "cn-tech"},
{"name": "36kr", "url": "https://36kr.com/feed", "category": "cn-tech"},
{"name": "爱范儿", "url": "https://www.ifanr.com/feed", "category": "cn-tech"},
{"name": "少数派", "url": "https://sspai.com/feed", "category": "cn-tech"},
{"name": "InfoQ中文", "url": "https://www.infoq.cn/feed", "category": "cn-tech"},
# === 中文财经 ===
{"name": "华尔街见闻", "url": "https://wallstreetcn.com/rss", "category": "cn-finance"},
# === AI Platform Blogs ===
{"name": "OpenAI Developers Blog","url": "https://developers.openai.com/rss.xml", "category": "ai-agent"},
]
# --- Ticker Extraction ---
QUANT_API_BASE_URL = os.getenv("QUANT_API_BASE_URL", "http://localhost:8000")
TICKER_ALIASES: dict[str, str] = {
"NVIDIA": "NVDA", "英伟达": "NVDA",
"APPLE": "AAPL", "苹果": "AAPL",
"MICROSOFT": "MSFT", "微软": "MSFT",
"GOOGLE": "GOOGL", "ALPHABET": "GOOGL", "谷歌": "GOOGL",
"AMAZON": "AMZN", "亚马逊": "AMZN",
"META": "META", "FACEBOOK": "META",
"TESLA": "TSLA", "特斯拉": "TSLA",
"NETFLIX": "NFLX",
"AMD": "AMD", "超威半导体": "AMD",
"INTEL": "INTC", "英特尔": "INTC",
"TSMC": "TSM", "台积电": "TSM",
"ASML": "ASML",
"BROADCOM": "AVGO", "博通": "AVGO",
"QUALCOMM": "QCOM", "高通": "QCOM",
"JPMORGAN": "JPM", "摩根大通": "JPM",
"GOLDMAN SACHS": "GS", "高盛": "GS",
"BERKSHIRE": "BRK.B", "伯克希尔": "BRK.B",
"NEWMONT": "NEM",
"BARRICK": "GOLD", "巴里克": "GOLD",
"COINBASE": "COIN",
"MICROSTRATEGY": "MSTR",
"ALIBABA": "BABA", "阿里巴巴": "BABA",
"TENCENT": "TCEHY", "腾讯": "TCEHY",
"BAIDU": "BIDU", "百度": "BIDU",
"JD.COM": "JD", "京东": "JD",
"PINDUODUO": "PDD", "拼多多": "PDD",
"NIO": "NIO", "蔚来": "NIO",
"BYDCOMPANY": "BYDDY", "比亚迪": "BYDDY",
}