重写为 AI 情报 Agent 并接入 Jenkins 流水线
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from app.db.models import Topic
|
||||
from app.db.session import SessionLocal
|
||||
|
||||
|
||||
DEFAULT_TOPICS = [
|
||||
{
|
||||
"name": "Large models and agents",
|
||||
"description": "New model releases, agent frameworks, tooling, benchmarks, and product launches.",
|
||||
},
|
||||
{
|
||||
"name": "Open-source AI projects",
|
||||
"description": "Important GitHub projects, open model releases, framework updates, and adoption signals.",
|
||||
},
|
||||
{
|
||||
"name": "AI products and funding",
|
||||
"description": "AI product launches, startup funding, acquisitions, and strategic market movement.",
|
||||
},
|
||||
]
|
||||
|
||||
def main() -> None:
|
||||
# 种子数据只创建模型研判时使用的长期主题,采集来源由Agent运行时动态完成。
|
||||
db = SessionLocal()
|
||||
try:
|
||||
for item in DEFAULT_TOPICS:
|
||||
exists = db.query(Topic).filter(Topic.name == item["name"]).first()
|
||||
if exists:
|
||||
continue
|
||||
db.add(Topic(**item, enabled=True))
|
||||
db.commit()
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user