This app periodically loads headlines from The Guardian and evaluates their sentiment using OpenAI's GPT-4 model.
It used to use GPT-3.5-turbo model but its results were not ideal. GPT-4 performs much better even though it is a bit pricier. To compensate for that we don't send article description anymore.
Since 2023-11-30 gpt-4-1106-preview
is used to save some bucks.
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:
- Upstash REST URL
- Upstash REST Token
- Upstash REST Email
- Upstash REST API Key
-
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.
- find lowest sentiment for a range 2024-01-01 - 2024-01-05
- how many records is there in article:guardian
# 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"}'