Skip to content

Guardrails: Updated the Topic Relevance API Endpoint to LLM Prompt Configs#191

Merged
Ayush8923 merged 16 commits into
mainfrom
feat/dashboard-analytics-page
Jun 3, 2026
Merged

Guardrails: Updated the Topic Relevance API Endpoint to LLM Prompt Configs#191
Ayush8923 merged 16 commits into
mainfrom
feat/dashboard-analytics-page

Conversation

@Ayush8923
Copy link
Copy Markdown
Collaborator

@Ayush8923 Ayush8923 commented Jun 3, 2026

Issue: #190

Summary:

  • Updated the topic relevance API endpoint to the new LLM Prompt Config.
  • Updated the query params and payload structure for LLM Prompt Configs API.
  • UI updates on the analytics page

@Ayush8923 Ayush8923 self-assigned this Jun 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

📝 Walkthrough

Walkthrough

The PR migrates guardrails API routes and frontend components from /topic_relevance_configs to /llm_prompt_configs endpoints with corrected parameter names and PATCH-based updates. Concurrently, analytics components adopt a new AnalyticsCardAccent type and update UI labels to distinguish AI metrics from evaluation metrics.

Changes

Guardrails llm_prompt_configs Migration

Layer / File(s) Summary
Backend route handlers for llm_prompt_configs
app/api/guardrails/llm_prompt_configs/[llm_prompt_config_id]/route.ts, app/api/guardrails/llm_prompt_configs/route.ts
GET, POST, PATCH (replacing PUT), and DELETE handlers update to use llm_prompt_config_id from params, call the /api/v1/guardrails/llm_prompt_configs backend endpoints, and preserve query strings in GET requests.
Frontend guardrails components
app/components/guardrails/TopicRelevanceField.tsx, app/components/guardrails/TopicRelevanceModal.tsx
TopicRelevanceField fetches from /llm_prompt_configs endpoint and reads the llm_prompt_configs response field; both components display configuration from llm_prompt with fallback to configuration, and TopicRelevanceModal sends POST body with validator_name and llm_prompt to the new endpoint.

Analytics Accent Type and UI Updates

Layer / File(s) Summary
Analytics accent type definition
app/lib/types/analytics.ts
Introduces new exported AnalyticsCardAccent union type with values "cost", "usage", and "activity".
Analytics component color and content updates
app/components/analytics/AnalyticsChartCard.tsx, app/components/analytics/AnalyticsTotalsRow.tsx
Chart series colors are updated to dark blue and yellow; card accent mapping adopts AnalyticsCardAccent type; grid content relabels metrics to distinguish AI metrics (cost/tokens/requests) from evaluation metrics (eval cost/tokens/runs) with updated hints and tooltips.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • vprashrex
  • Prajna1999
  • nishika26

Poem

🐰 A rabbit hops through guardrails anew,
llm_prompt configs in place of the old brew,
PATCH replaces PUT with grace,
while analytics shine with colors so bright—
AI and eval metrics find their own place,
dancing in harmony, a beautiful sight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: updating the Topic Relevance API endpoint to use LLM Prompt Configs, which is reflected across multiple files including route handlers and UI components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashboard-analytics-page

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Ayush8923 Ayush8923 merged commit 706ad03 into main Jun 3, 2026
2 checks passed
@Ayush8923 Ayush8923 deleted the feat/dashboard-analytics-page branch June 3, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants