Overview
The AI filter is the second layer of the hybrid pipeline. AfterrulesFilter narrows the candidate pool using deterministic thresholds, openaiFilter sends those candidates to GPT-4o-mini for curation based on game reputation, community recognition, and cultural relevance.
- SDK:
openainpm package v4 - Endpoint:
POST /v1/chat/completions - Model:
gpt-4o-mini(default, overridable viaOPENAI_MODEL) - Timeout: 30 seconds (
openai.timeoutMs) - Temperature:
0— determinism ensures the same candidate set always produces the same selection, making hash-based caching reliable
API call structure
Input shape
Only the fields needed for quality judgment are sent to GPT. Prices, URLs, and thumbnails are excluded — GPT does not need them to evaluate game reputation.Input fields sent to GPT
Steam application ID. Used as the key for GPT’s selection and reasons map.
Game display name. The primary signal GPT uses to assess reputation.
Parsed integer Metacritic score.
0 if not available.Parsed integer positive review percentage.
0 if not available.Steam review category label (e.g.
"Very Positive", "Overwhelmingly Positive").Expected response shape
GPT is instructed to respond exclusively with a JSON object (enforced viaresponse_format: { type: 'json_object' }):
Array of
steamAppID strings chosen by GPT. Only IDs that exist in the input candidates are accepted — unknown IDs are discarded during validation.Map of
steamAppID to a brief curation reason in Spanish. GPT is prompted to keep reasons under 12 words, but the pipeline also enforces a hard truncation to config.ai.maxReasonLength (120 characters).Response validation
After receiving the raw response,openaiFilter validates and sanitizes before returning:
JSON.parsethe raw string- Verify
selectedIdsis an array; default to[]if not - Verify
reasonsis a plain object; default to{}if not - Cross-reference each ID against the input set — any ID not in the original candidates is silently dropped
- Truncate each reason string to
config.ai.maxReasonLengthcharacters inbuildFilteredDeals
Curation criteria (system prompt)
GPT is instructed to select games that meet at least one of:- AAA titles from major studios (EA, Ubisoft, CD Projekt, Rockstar, Bethesda, etc.)
- AA games from mid-size studios with a recognizable track record
- Highly acclaimed or award-winning indie games (Hades, Hollow Knight, Celeste, Stardew Valley, etc.)
- Lesser-known indies with extremely positive reviews or very strong reputation
- Games that were trending or viral in the last 5 years
- Known franchises, including minor entries
- Niche games with loyal communities and strong reputation on Reddit, YouTube, Twitch, or specialized forums
- Completely unknown games with no clear recognition or community
- Asset flips or generic simulators without a community
- DLCs of unrecognized games