尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证📰 Using OpenAI's LLMs to determine sentiment of The Guardian's headlines. Rise and shine or doom and gloom?
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
The Sentiment of The Guardian
This app periodically loads headlines from The Guardian and evaluates their sentiment through OpenRouter.
Set OPENROUTER_API_KEY in .env.local and in your deployment environment. Direct OpenAI credentials are no longer used. The OpenAI SDK is retained as an OpenRouter-compatible HTTP client.
Model IDs are configured in lib/const.js. All tasks use OpenRouter:查看完整 README ↗This app periodically loads headlines from The Guardian and evaluates their sentiment through OpenRouter.
Set OPENROUTER_API_KEY in .env.local and in your deployment environment. Direct OpenAI credentials are no longer used. The OpenAI SDK is retained as an OpenRouter-compatible HTTP client.
Model IDs are configured in lib/const.js. All tasks use OpenRouter:
| Task | OpenRouter model ID | Reasoning | Output |
|---|---|---|---|
| Headline sentiment assessment | qwen/qwen3-30b-a3b-instruct-2507 | Disabled (none) | A validated score from 1 to 100 |
| Headline commentary | z-ai/glm-5.3 | Low (low) | Short commentary, with a 2,048-token allowance shared by reasoning and output |
| Monthly persons of interest | openai/gpt-6-luna | Low (low) | Three people selected from the month's headlines, using structured JSON |
| Commentary speech | openai/gpt-4o-mini-tts-2025-12-15 | Not applicable | MP3 audio using the alloy voice |
Qwen handles numeric classification; GLM handles commentary; GPT-6 Luna handles monthly synthesis across headlines. GLM requires reasoning, so commentary uses low reasoning with a larger token allowance. Reasoning and speech settings are configured in the corresponding API routes.
The September 17, 2026 benchmark measured 26% lower commentary cost with GLM than Terra Flex across three repeats of the same headlines. This saving depended on cache hits: without cache discounts, the observed outputs would cost approximately the same. Monthly prompts showed no cost savings in that benchmark. Monthly analysis now uses GPT-6 Luna.
Synchronous sentiment, commentary, and monthly persons-of-interest requests ask OpenRouter for service_tier: "flex", including the regeneration script's --single mode. Flex processing trades latency and availability for lower cost. Capacity errors can surface without standard-tier fallback; if a model has no Flex endpoints, OpenRouter may route at standard rates. The response's service_tier reports the tier actually served. Speech and Batch API requests do not set this parameter; batch processing has its own pricing.
Sentiment backfills use Qwen. Persons-of-interest backfills and regenerations use GPT-6 Luna, including the batch script and its --single mode. Updating a model default does not recalculate stored data; historical results retain their previous assessments until explicitly regenerated.
Existing Redis keys are preserved so previously generated commentary and audio remain available.
The regeneration script uses OpenRouter's Batch API. Run with node --env-file=.env.local scripts/batch-poi-regenerate.js and follow its help. Run --prepare again after migrating; old OpenAI batch IDs cannot be retrieved through OpenRouter. OpenRouter batch artifacts use separate filenames to preserve old job records. Submission sends inline requests; retrieval reads inline results and stores them in Redis.
Based on jirihofman/nextjs-fullstack-app-template.
This project supports integration with the MCP Upstash server for managing and interacting with Upstash Redis.
To enable this:
Ensure you have the required credentials for your Upstash Redis instance:
The configuration for the MCP Upstash server is located in .vscode/mcp.json. When starting the server, you will be prompted for these credentials.
The server is started using the @upstash/mcp-server package and connects to your Upstash Redis instance securely.
This setup allows you to manage your Upstash Redis data directly from your development environment using MCP.
# Set initial categories for existing articles
set category:guardian:NEG1 8
set category:guardian:NEG2 5
set category:guardian:NEU 6
set category:guardian:POS1 1
set category:guardian:NEU 0
curl -XPOST https://sentiment-guardian.vercel.app/api/articles -d '{"adminApiKey":"ADMIN_API_KEY"}'
curl -XPOST https://sentiment-guardian.vercel.app/api/sentiment -d '{"adminApiKey":"ADMIN_API_KEY"}'