Skip to content

fix(api): Update evaluators execution apis #165

Open
nina-kollman wants to merge 3 commits intomainfrom
nk/update_eval_routes
Open

fix(api): Update evaluators execution apis #165
nina-kollman wants to merge 3 commits intomainfrom
nk/update_eval_routes

Conversation

@nina-kollman
Copy link
Copy Markdown
Contributor

@nina-kollman nina-kollman commented Apr 9, 2026

Fixes: TLP-2068

Summary by CodeRabbit

  • Documentation
    • Updated API reference for 40+ evaluator endpoints: evaluator execution routes moved from /v2/evaluators/execute/ to /v2/evaluators//execute and the custom-evaluator creation route consolidated to /v2/evaluators. JSON examples and minor formatting were also refined.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

Updated OpenAPI paths in evaluator documentation and the API spec: moved many evaluator execute routes from /v2/evaluators/execute/{slug} to /v2/evaluators/{slug}/execute, and changed the custom-evaluator creation route to /v2/evaluators (plus minor formatting edits in openapi.json).

Changes

Cohort / File(s) Summary
Create Custom Evaluator
api-reference/evaluators/create-a-custom-llm-as-a-judge-evaluator.mdx
Frontmatter openapi changed from post /v2/evaluators/custom-evaluatorpost /v2/evaluators.
Execute Evaluators (documentation files)
api-reference/evaluators/execute-*-evaluator.mdx (multiple files, e.g., execute-agent-efficiency-evaluator.mdx, execute-answer-completeness-evaluator.mdx, execute-context-relevance-evaluator.mdx, …)
Frontmatter openapi paths updated from post /v2/evaluators/execute/{name}post /v2/evaluators/{name}/execute across all execute evaluator docs.
OpenAPI spec
openapi.json
Path definitions updated to match docs: "/v2/evaluators/execute/<slug>""/v2/evaluators/<slug>/execute" for many evaluators; "/v2/evaluators/custom-evaluator""/v2/evaluators"; minor string/formatting and example adjustments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through docs, one hop, two—

Paths re-formed and endpoints new,
From execute-first to name-first cheer,
Tiny changes, tidy and clear,
A rabbit claps—deploy is near! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating API endpoint paths for evaluator execution endpoints from /execute/ pattern to /{slug}/execute pattern, plus custom evaluator endpoint restructuring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nk/update_eval_routes

Comment @coderabbitai help to get the list of available commands and usage tips.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 9, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
enrolla 🟢 Ready View Preview Apr 9, 2026, 10:56 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
api-reference/evaluators/execute-toxicity-detector-evaluator.mdx (1)

2-2: ⚠️ Potential issue | 🔴 Critical

Same critical path mismatch as execute-topic-adherence-evaluator.mdx.

The openapi.json schema still defines this endpoint at /v2/evaluators/execute/toxicity-detector (see openapi.json:2096-2152), but the documentation is being updated to /v2/evaluators/toxicity-detector/execute. Please see the detailed comment on execute-topic-adherence-evaluator.mdx for the full analysis and verification steps.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/evaluators/execute-toxicity-detector-evaluator.mdx` at line 2,
The documentation path for the toxicity detector endpoint doesn't match the
OpenAPI schema: the MDX shows "post /v2/evaluators/toxicity-detector/execute"
but openapi.json defines "/v2/evaluators/execute/toxicity-detector"; update the
MDX to use the schema canonical path (replace "post
/v2/evaluators/toxicity-detector/execute" with "post
/v2/evaluators/execute/toxicity-detector") or, if the API surface intentionally
changed, update openapi.json accordingly and run the same reconciliation you
applied for execute-topic-adherence-evaluator.mdx so both the documentation
(execute-toxicity-detector-evaluator.mdx) and the OpenAPI schema consistently
use the same endpoint string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/evaluators/create-a-custom-llm-as-a-judge-evaluator.mdx`:
- Line 2: The frontmatter OpenAPI route value "openapi: post /v2/evaluators" is
incorrect; change it to the documented operation path "openapi: post
/v2/evaluators/custom-evaluator" so it matches the OpenAPI spec entry "post
/v2/evaluators/custom-evaluator" and the other page
"create-custom-evaluator.mdx"; update the string in the frontmatter where
"openapi: post /v2/evaluators" appears to exactly "openapi: post
/v2/evaluators/custom-evaluator".

In `@api-reference/evaluators/execute-agent-tool-trajectory-evaluator.mdx`:
- Line 2: The evaluator route in this MDX uses the wrong ordering; change the
OpenAPI path from "/v2/evaluators/{evaluator}/execute" (currently shown as "post
/v2/evaluators/agent-tool-trajectory/execute") to the spec-backed
"/v2/evaluators/execute/{evaluator}" (e.g., "post
/v2/evaluators/execute/agent-tool-trajectory"); apply the same swap to all
evaluator MDX files in api-reference/evaluators/ so routes match the whitelist
pattern "/v2/evaluators/execute/*".

In `@api-reference/evaluators/execute-answer-completeness-evaluator.mdx`:
- Around line 1-3: OpenAPI specs still reference the old path pattern
"/v2/evaluators/execute/{evaluator-name}"; update all occurrences (e.g., the ~35
references in openapi.json and entries in openapi-whitelist.yaml) to the new
path structure "/v2/evaluators/{evaluator-name}/execute". Search for the exact
string "/v2/evaluators/execute/{evaluator-name}" (and any variants like escaped
JSON paths) and replace them with "/v2/evaluators/{evaluator-name}/execute",
ensuring both the operation object keys and any whitelist/path lists are updated
so endpoints like the evaluator "answer-completeness" match the new format used
in execute-answer-completeness-evaluator.mdx.

In `@api-reference/evaluators/execute-topic-adherence-evaluator.mdx`:
- Line 2: Documentation now references the new endpoint pattern POST
/v2/evaluators/topic-adherence/execute but the OpenAPI schema still exposes
/v2/evaluators/execute/topic-adherence; update the OpenAPI spec (openapi.json)
so all evaluator paths follow the new pattern
(/v2/evaluators/<evaluator-name>/execute) — e.g., change
/v2/evaluators/execute/topic-adherence to /v2/evaluators/topic-adherence/execute
(and replicate for the other 34 evaluator endpoints like topic-adherence), or if
backend cannot be changed now, revert the docs in
api-reference/evaluators/execute-topic-adherence-evaluator.mdx to the existing
path until the API is updated; coordinate with the backend team to ensure
whichever source of truth (spec or docs) is aligned before merging.

---

Duplicate comments:
In `@api-reference/evaluators/execute-toxicity-detector-evaluator.mdx`:
- Line 2: The documentation path for the toxicity detector endpoint doesn't
match the OpenAPI schema: the MDX shows "post
/v2/evaluators/toxicity-detector/execute" but openapi.json defines
"/v2/evaluators/execute/toxicity-detector"; update the MDX to use the schema
canonical path (replace "post /v2/evaluators/toxicity-detector/execute" with
"post /v2/evaluators/execute/toxicity-detector") or, if the API surface
intentionally changed, update openapi.json accordingly and run the same
reconciliation you applied for execute-topic-adherence-evaluator.mdx so both the
documentation (execute-toxicity-detector-evaluator.mdx) and the OpenAPI schema
consistently use the same endpoint string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f30d597-a21d-4f38-b5b8-2d5e2e2501f1

📥 Commits

Reviewing files that changed from the base of the PR and between e236f33 and ddde1a0.

📒 Files selected for processing (36)
  • api-reference/evaluators/create-a-custom-llm-as-a-judge-evaluator.mdx
  • api-reference/evaluators/execute-agent-efficiency-evaluator.mdx
  • api-reference/evaluators/execute-agent-flow-quality-evaluator.mdx
  • api-reference/evaluators/execute-agent-goal-accuracy-evaluator.mdx
  • api-reference/evaluators/execute-agent-goal-completeness-evaluator.mdx
  • api-reference/evaluators/execute-agent-tool-error-detector-evaluator.mdx
  • api-reference/evaluators/execute-agent-tool-trajectory-evaluator.mdx
  • api-reference/evaluators/execute-answer-completeness-evaluator.mdx
  • api-reference/evaluators/execute-answer-correctness-evaluator.mdx
  • api-reference/evaluators/execute-answer-relevancy-evaluator.mdx
  • api-reference/evaluators/execute-char-count-evaluator.mdx
  • api-reference/evaluators/execute-char-count-ratio-evaluator.mdx
  • api-reference/evaluators/execute-context-relevance-evaluator.mdx
  • api-reference/evaluators/execute-conversation-quality-evaluator.mdx
  • api-reference/evaluators/execute-faithfulness-evaluator.mdx
  • api-reference/evaluators/execute-html-comparison-evaluator.mdx
  • api-reference/evaluators/execute-instruction-adherence-evaluator.mdx
  • api-reference/evaluators/execute-intent-change-evaluator.mdx
  • api-reference/evaluators/execute-json-validator-evaluator.mdx
  • api-reference/evaluators/execute-perplexity-evaluator.mdx
  • api-reference/evaluators/execute-pii-detector-evaluator.mdx
  • api-reference/evaluators/execute-placeholder-regex-evaluator.mdx
  • api-reference/evaluators/execute-profanity-detector-evaluator.mdx
  • api-reference/evaluators/execute-prompt-injection-evaluator.mdx
  • api-reference/evaluators/execute-prompt-perplexity-evaluator.mdx
  • api-reference/evaluators/execute-regex-validator-evaluator.mdx
  • api-reference/evaluators/execute-secrets-detector-evaluator.mdx
  • api-reference/evaluators/execute-semantic-similarity-evaluator.mdx
  • api-reference/evaluators/execute-sexism-detector-evaluator.mdx
  • api-reference/evaluators/execute-sql-validator-evaluator.mdx
  • api-reference/evaluators/execute-tone-detection-evaluator.mdx
  • api-reference/evaluators/execute-topic-adherence-evaluator.mdx
  • api-reference/evaluators/execute-toxicity-detector-evaluator.mdx
  • api-reference/evaluators/execute-uncertainty-detector-evaluator.mdx
  • api-reference/evaluators/execute-word-count-evaluator.mdx
  • api-reference/evaluators/execute-word-count-ratio-evaluator.mdx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
openapi.json (2)

277-328: ⚠️ Potential issue | 🟠 Major

Update the whitelist before this spec is regenerated.

These route moves only exist in openapi.json right now. scripts/filter-openapi.js rebuilds this file from the backend spec using openapi-whitelist.yaml, and that whitelist still includes /v2/evaluators/execute/* plus /v2/evaluators/custom-evaluator. On the next regeneration, the new /v2/evaluators/{slug}/execute endpoints and POST /v2/evaluators will be filtered back out.

🔧 Suggested follow-up in openapi-whitelist.yaml
 include_paths:
   - /v2/metrics_hwm
   - /v2/organizations
-  - /v2/evaluators/execute/*
-  - /v2/evaluators/custom-evaluator
+  - /v2/evaluators
+  - /v2/evaluators/*/execute
   - /v2/metrics
   - /v2/metrics_hwm
   - /v2/auto-monitor-setups
   - /v2/auto-monitor-setups/*

Also applies to: 329-2323

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@openapi.json` around lines 277 - 328, The openapi whitelist is out of sync
with the new evaluator routes: update openapi-whitelist.yaml to allow the new
POST /v2/evaluators and the new /v2/evaluators/{slug}/execute pattern (and any
related new evaluator paths) and remove the old entries
(/v2/evaluators/execute/* and /v2/evaluators/custom-evaluator) so
scripts/filter-openapi.js won’t strip them on regeneration; after editing the
whitelist, run the filter-openapi.js regeneration to verify the new
/v2/evaluators and /v2/evaluators/{slug}/execute endpoints remain in
openapi.json.

277-328: ⚠️ Potential issue | 🟠 Major

Fix the create-custom-evaluator doc page to use the new path.

Line 277 changes the spec to POST /v2/evaluators, but api-reference/evaluators/create-custom-evaluator.mdx:1-5 still points at post /v2/evaluators/custom-evaluator. That page now targets an operation that no longer exists in the published spec.

🔧 Suggested follow-up in api-reference/evaluators/create-custom-evaluator.mdx
 ---
-openapi: post /v2/evaluators/custom-evaluator
+openapi: post /v2/evaluators
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@openapi.json` around lines 277 - 328, The OpenAPI path for creating custom
evaluators was changed to "POST /v2/evaluators" but the docs page still
references the old "post /v2/evaluators/custom-evaluator"; update
api-reference/evaluators/create-custom-evaluator.mdx to use the new path and
operation name by replacing any occurrences of "/v2/evaluators/custom-evaluator"
or the old operationId with "/v2/evaluators" (and the corresponding POST
operation), and adjust any example curl/JS/HTTP snippets, payloads, and response
schema references to match the new operation defined in the spec (ensure
examples reference response.CreateEvaluatorResponse and
request.CreateCustomEvaluatorInput as in the OpenAPI change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@openapi.json`:
- Around line 277-328: The openapi whitelist is out of sync with the new
evaluator routes: update openapi-whitelist.yaml to allow the new POST
/v2/evaluators and the new /v2/evaluators/{slug}/execute pattern (and any
related new evaluator paths) and remove the old entries
(/v2/evaluators/execute/* and /v2/evaluators/custom-evaluator) so
scripts/filter-openapi.js won’t strip them on regeneration; after editing the
whitelist, run the filter-openapi.js regeneration to verify the new
/v2/evaluators and /v2/evaluators/{slug}/execute endpoints remain in
openapi.json.
- Around line 277-328: The OpenAPI path for creating custom evaluators was
changed to "POST /v2/evaluators" but the docs page still references the old
"post /v2/evaluators/custom-evaluator"; update
api-reference/evaluators/create-custom-evaluator.mdx to use the new path and
operation name by replacing any occurrences of "/v2/evaluators/custom-evaluator"
or the old operationId with "/v2/evaluators" (and the corresponding POST
operation), and adjust any example curl/JS/HTTP snippets, payloads, and response
schema references to match the new operation defined in the spec (ensure
examples reference response.CreateEvaluatorResponse and
request.CreateCustomEvaluatorInput as in the OpenAPI change).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: afb64568-2ebd-437e-9733-6f369775ea4e

📥 Commits

Reviewing files that changed from the base of the PR and between ddde1a0 and 1568915.

📒 Files selected for processing (1)
  • openapi.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants