慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
本源之绩:续探大语言模型于自动化流程之用
Amit Singh · 2026-05-24 · via DEV Community

此篇乃吾所建微服务之续。欲观系列前文,可检吾前篇。


言简意赅吾设一每周之管道,自新闻之出处,抽其新至十篇之文,择其能立可证伪之论,补其阙漏之要旨,觅二独立之证,启待纳之请示。claims/proofs/之檔。凡此諸事,皆運行於數段Python腳本、二項自製OpenRouter技能,及二項GitHub Actions之間。


吾前文已述,如何結合Firecrawl、OpenRouter API及Github Action工作流程,自動化攝取頂級新聞來源。今文將復施此法,以處理新聞來源之聲明及其證據。

初遇之难,在于寻法以取新闻源所发近文。幸得之。NewsData.IO(NewsData.io)此供API以索搜、采集及追踪寰宇新闻。NewsData.io之免费层级赐予吾每日200 API积分,足敷一周遍寻12源(NewsData.io)。目下姑且如是淡然自适

1️⃣ 汲取最新文章 —— newsdata_io.py

首事乃为于NewsData.io latest之端点,作一薄裹。其引之新文,于所定域中。

# Free‑tier‑friendly query params
CATEGORY = "environment,technology,world"
LANGUAGE = "en"
REMOVE_DUPLICATE = "1"
SIZE = "10"
DATATYPE = "news,research,analysis,pressRelease"

NEWSDATA_API_BASE_URL = os.getenv(
    "NEWSDATA_API_BASE_URL", "https://newsdata.io/api/1"
)
NEWSDATA_API_KEY = os.environ["NEWSDATA_API_KEY"]

def get_claims(src_domain_url: str):
    """
    Call the NewsData.io `/latest` endpoint for a specific domain.
    Returns a list of article dicts (or None on error).
    """
    endpoint = f"{NEWSDATA_API_BASE_URL}/latest"
    params = {
        "category": CATEGORY,
        "language": LANGUAGE,
        "removeduplicate": REMOVE_DUPLICATE,
        "size": SIZE,
        "datatype": DATATYPE,
        "apikey": NEWSDATA_API_KEY,
        "domainurl": src_domain_url,
    }
    response = requests.get(endpoint, params=params, timeout=10)
    if response.status_code != 200:
        print(
            f"Error: couldn't fetch claims for {src_domain_url}: {response.status_code}"
        )
        # Show suggestions if the API knows a better domain
        resp_body = response.json()
        if (
            resp_body.get("results") is not None
            and resp_body.get("results")[0].get("suggestion") is not None
        ):
            print(
                f"Suggested domain url(s) for {src_domain_url}: {resp_body['results'][0]['suggestion']}"
            )
        return None
    return response.json()["results"]

Enter fullscreen mode Exit fullscreen mode

何以为要:免费套餐每日仅赐200积分,故吾辈求索轻简:一域之限,十果之取,类目窄收。DATATYPE之滤,意存广纳;后时则删非可证者。


2️⃣ 滤求可证之断——断证之能

吾今之计分,唯伪证可辨者方计之。故于 NewsData API 所返之伪证,吾独择其最合 可辨伪之伪证 准者而存之.

吾以大言(LLMs)为之分类,详言之,吾将 NewsData API 所返之对象数组,转送于 OpenRouter API。

[{
"article_id": "40305aa160787297dd3f9cc15faa8637",
"link": "https://www.theguardian.com/us-news/2026/may/22/kansas-bird-nest-truck",
"title": "Federally protected bird’s nest holds up sale of Ford truck in Kansas",
"description": "A robin built a nest on a Ford-F-250’s tire and laid its eggs in it; a law prohibits removing it while inhabited by bird brood A truck sold by a Kansas dealership cannot be taken from the lot by its new owner because a family of robins is living atop one of the vehicle’s tires. The relatively novel situation has gained widespread attention after the dealership in the Kansas community of Olathe wrote about it on its Facebook page – and it perhaps taught many that active robin nests are protected by federal law from the US. Continue reading...",
"keywords": [
"birds",
"kansas",
"wildlife",
"ford",
"animals",
"us news",
"law (us)"
],
"creator": [
"josé olivares"
],
"language": "english",
"country": [
"united states of america"
],
"category": [
"top",
"environment"
],
"datatype": "news",
"pubDate": "2026-05-22 19:03:07",
"pubDateTZ": "UTC",
"fetched_at": "2026-05-22 19:32:47",
"image_url": "https://i.guim.co.uk/img/media/c9e972eb2d494c4a9c713a7b5550f0fa9efcae1f/0_503_1536_1229/master/1536.jpg?width=140&quality=85&auto=format&fit=max&s=ad95c6dcdf71df9bc3461b683effe424",
"video_url": null,
"source_id": "theguardian",
"source_name": "The Guardian",
"source_priority": 106,
"source_url": "https://www.theguardian.com",
"source_icon": "https://n.bytvi.com/theguardian.jpg",
"duplicate": false
}]

入全景模式 出全景模式

为助分类,吾撰一AI代理技能。其令大语言模型:

  1. 遍访各文章URL,以网络搜索之器。
  2. 其文是否载有可客观证其为真或为伪之主张。
  3. 还原文仅一 JSON 对象,合乎其则。
CLAIM_FILTER_PROMPT = (
    "Use web search tool to visit the link for each article, access the content and then assess if it is a falsifiable claim."
    "Out of these 10 articles, only return 1 article that best fits the falsifiable claim criterion."
    "Prefer claims that have been made by the news source directly."
    "Keep the json structure of the claims the same as the original schema in the input. Do not add, remove, or modify any key or value."
    "Only output the plain json array string that I can safely unmarshal."
    "Do not format the string. Do not output anything else."
)

req_content = (
    "Following is a list of 10 articles published by the same news outlet. Each article is represented by a json string type element in the array"
    f"\n\n{claims}\n\n"
    f"{CLAIM_FILTER_PROMPT}"
)

filtered_claims = openrouter.req_w_addons(
    req_content, skill=falsifiable_claim_skill, tools=[openrouter.WEB_SEARCH_TOOL]
)

入全屏模式 出全屏模式

结果:一独,结构良善之主张,具所有必场,以成主张纳文之册。

吾今仅择一证,俟核验摄取之务稳、OpenRouter应答之信,则增其数,亦频其入.


3️⃣ 补遗缺失之述——速为概要之过

NewsData.io时或返"null"description之域。遇此,吾询OpenRouter 概要此文,限五百字内。

CLAIM_SUMMARY_PROMPT = (
    "Use web search tool to visit the link to the article and access its content."
    "Summarize the article in under 500 characters."
    "Return only the summary without any additional text."
)

req_content = (
    "Following is the url to an article published by a news media outlet."
    f"\n\n{claim['link']}\n\n"
    f"{CLAIM_SUMMARY_PROMPT}"
)

claim_summary = openrouter.req_w_addons(
    req_content, tools=[openrouter.WEB_SEARCH_TOOL]
)

claim["description"] = claim_summary

全屏模式。 退出全屏模式。

今每项主张,皆具简明可读之述,纵源API未填。


4️⃣ 每周主张吸纳 - GitHub Actions 工作流

通体运行于 GitHub Actions。一周一更。工作流程检视仓库,安装依赖,运行ingest_claims.py,遂开 Pull Request。

workflow execution

终局:一个人电脑(PC)每周日现新据牒,备审。


五、取证吞证.py+流程

既入一证,吾欲以证之或辨之。其证核之问,令大智之语寻独立之源,而标其名以布尔之supports_claim

为助大语言模型于网搜中觅证以辅或驳所引之论,吾复撰一技,声索核实,其能行如下之事:

  1. 撷取并验证可证伪之主张取媒体文章/帖子之URL,辨其内容之核心、可验之主张,务求具体,可证其为真或为伪。
  2. 施行定向网搜: 以时序查询之法,寻得至多二份高质外部文书,直证或驳斥所陈之论,严察时序之关联(契合论之时间范畴)
  3. 返可核之证文URL:输出JSON数组,列所获URL,附布尔标识(支持声明:真/假),示每文献是否印证或驳斥原声明,优先取官方/权威之出处,次及意见之文。
CLAIM_VERIFICATION_PROMPT = (
    "Use web search tool to access the claim link, fetch the content and process it."
    "Use the web search tool again to look for proofs in the form of official statements, press releases, or reports from reputable sources to prove the claim right or wrong conclusively."
    "Ensure that the proofs belong to the same timeline as the claim. Do not include outdated sources."
    "Output links to the 2 sources that prove the claim right or wrong and specify as a boolean whether they support the claim or not."
    "The output format should be a json array with each element being a json object corresponding to a source supporting or refuting the claim."
    "Each json element should follow the following schema: {\"uri\": \"string\", \"supports_claim\": boolean}"
)

req_content = (
    "Following is a link to a falsifiable claim by a news media outlet as an article"
    f"\n\n{claim['uri']}\n\n"
    f"{CLAIM_VERIFICATION_PROMPT}"
)

claim_proofs = openrouter.req_w_addons(
    req_content, skill=claim_verification_skill, tools=[openrouter.WEB_SEARCH_TOOL]
)

进入全屏模式 退出全屏模式

证伪流程: 若如申索吸纳之流程,吾每周亦运行证物吸纳之流程。其运行于ingest_proofs.py脚本,于新支创建证文书,复自是支创建请于之。main枝。

workflow execution example

结果:一个人电脑每周日现新证以证所诉,待审。


六、开路者之可靠性增进

吾之OpenRouter API使用日增,故免费层级之模型清单,缩为如下:

FREE_MODELS_DOC = [
    "google/gemma-4-31b-it:free",
    "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",
    "openrouter/free"
]

入全景模式 出全屏模式

此三模态恒得佳果,而居免费之阶。

退避重试之环启行路者之文(__JHSNS_SEG_64947a0f_105__)

复增渐延之候于重试,以减逢伺侧之失之机。

for i in range(1, OPENROUTER_MAX_RETRIES + 1):
    status, body = helper.post_request(...)
    if status in (0, 429) or 500 <= status < 600:
        print(f"OpenRouter API returned status {status}, retrying...", file=sys.stderr)
        time.sleep(10 * i)
        continue
    # success handling...

全屏模式入。 全屏模式出。

效验:五百之误率骤降,周间API之费恒在免费级之限下。

吾甚悦此OpenRouter之仪表盘。

Token usage dashboard


权衡与局限

方面 权衡
免费套餐限制 200 NewsData.io 信用点/日限制吾等仅能每运行使用一域名。欲扩展至多平台,需付费方案或更巧妙的批量处理.
每源仅一主张 吾故独取“优”之可证伪之论,以简其务。后之工将支持每文多列高质之论。
大语言模型之幻象 纵有论证之能,犹可现陈旧之链。时序之觉助之,然非灵丹。
证之质 证文自取,然大事之辩,犹宜人察。

八、结论&继之以往

以缀合之NewsData.io(NewsData.io), 定制可证伪之主张声索核验之技,OpenRouter(具渐次缓退与免费层级轮换之模),及GitHub Actions,吾构一省费至极、全然自动化之管,化质朴之讯为条理井然、可证伪之断言文书,并附佐证之据。

来者何事?

  1. 于断言与证物添信度之分数,俾下游之用者得衡验据。
  2. 自周而改为日,纳取于高量之出处,俟重试之理昭若坚石。
  3. 负性之试,盖吾未睹断言为谬之例,疑诸大智之能者慎之如履薄冰。

若尔好奇,其全码存于萨提亚透镜/源代码仓库。若有建议或疑问于吾,但可投于评论区。