n8n/packages/@n8n/instance-ai/evaluations/binaryChecks/checks/fulfills-user-request.ts
José Braulio González Valido 700b32237f
feat(ai-builder): Surface WHAT-dimension binary checks per built workflow (no-changelog) (#30932)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 12:18:52 +01:00

26 lines
1.3 KiB
TypeScript

import { createLlmCheck } from './create-llm-check';
export const fulfillsUserRequest = createLlmCheck({
name: 'fulfills_user_request',
description: 'Workflow fulfills every feature the user explicitly requested',
dimension: 'intent_match',
systemPrompt: `You are a strict evaluator checking whether an n8n workflow fulfills a user's request.
For each feature the user explicitly asked for, check:
1. Is there a node of the correct TYPE for that feature? (e.g., YouTube node for YouTube operations)
2. Is that node configured with the correct RESOURCE and OPERATION? (e.g., resource: "caption" for fetching captions, not resource: "video")
3. Is the node actually CONNECTED in the workflow flow?
A node that exists but is misconfigured does NOT count as fulfilling the requirement.
For example, a YouTube node with resource: "video" does NOT fulfill a request to "fetch captions" — captions require resource: "caption".
Be binary: pass ONLY if every explicitly requested feature has a correctly-typed AND correctly-configured node.
Do NOT pass just because a node with the right name exists — verify its actual parameters.`,
humanTemplate: `User Request: {userPrompt}
Generated Workflow:
{generatedWorkflow}
For each feature the user requested, is there a correctly configured node? List each requirement and whether it's met.`,
});