Skip to content

[Feature] UI - Search Tools: Show Config Defined Search Tools#20436

Merged
yuneng-jiang merged 3 commits intomainfrom
litellm_search_tools_config_ui
Feb 4, 2026
Merged

[Feature] UI - Search Tools: Show Config Defined Search Tools#20436
yuneng-jiang merged 3 commits intomainfrom
litellm_search_tools_config_ui

Conversation

@yuneng-jiang
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🧹 Refactoring
✅ Test

Changes

Refactored Search Tools components by renaming files from snake_case to PascalCase for consistency. Migrated the search tools table implementation to use Ant Design's Table component, extracting column definitions into a separate SearchToolColumn.tsx file. Added unit tests for SearchTools and SearchToolView components.

Screenshots

image image

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 4, 2026 8:41pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This PR refactors the Search Tools UI components by renaming files from snake_case to PascalCase and migrating from TanStack's DataTable to Ant Design's Table component.

Key Changes:

  • Renamed directory from search_tools to SearchTools and all component files to PascalCase for consistency
  • Migrated table implementation from TanStack Table (DataTable) to Ant Design Table
  • Added is_from_config field to distinguish config-defined search tools from database-stored ones
  • Added "Source" column showing "Config" or "DB" tags to indicate origin
  • Disabled Edit/Delete actions for config-defined tools with helpful tooltips
  • Replaced custom DeleteModal with reusable DeleteResourceModal showing detailed resource information
  • Added comprehensive unit tests for SearchTools and SearchToolView components (512 new lines of tests)

Testing:

  • Two new test files with 34 test cases covering component rendering, authentication, CRUD operations, navigation, and edge cases
  • Tests use proper mocking of dependencies and cover both success and error scenarios

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are primarily refactoring (file renaming) and UI framework migration with no changes to backend logic or API contracts. The PR includes comprehensive unit tests covering all functionality and follows established patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/SearchTools/types.tsx Added is_from_config field to SearchTool interface to distinguish config-defined vs DB-stored tools
ui/litellm-dashboard/src/components/SearchTools/SearchToolColumn.tsx Migrated column definitions from TanStack Table to Ant Design Table, added Source column and disabled edit/delete for config-based tools
ui/litellm-dashboard/src/components/SearchTools/SearchTools.tsx Refactored to use Ant Design Table instead of DataTable, improved DeleteResourceModal usage with detailed resource information
ui/litellm-dashboard/src/components/SearchTools/SearchTools.test.tsx New comprehensive unit tests covering all SearchTools component behaviors including authentication, CRUD operations, and navigation
ui/litellm-dashboard/src/components/SearchTools/SearchToolView.test.tsx New comprehensive unit tests for SearchToolView component covering display, copy functionality, and edge cases

Sequence Diagram

sequenceDiagram
    participant User
    participant SearchTools
    participant API
    participant Backend
    
    User->>SearchTools: Load Search Tools Page
    SearchTools->>API: fetchSearchTools(accessToken)
    API->>Backend: GET /search_tools
    Backend-->>API: { search_tools: [...] }
    API-->>SearchTools: SearchTool[]
    SearchTools->>API: fetchAvailableSearchProviders(accessToken)
    API->>Backend: GET /search_providers
    Backend-->>API: { providers: [...] }
    API-->>SearchTools: AvailableSearchProvider[]
    SearchTools->>SearchTools: Render Ant Design Table with tools
    
    alt Config-Defined Tool
        SearchTools->>SearchTools: Show "Config" tag in Source column
        SearchTools->>SearchTools: Disable Edit/Delete actions
        Note over SearchTools: is_from_config = true
    else DB-Stored Tool
        SearchTools->>SearchTools: Show "DB" tag in Source column
        SearchTools->>SearchTools: Enable Edit/Delete actions
        Note over SearchTools: is_from_config = false
    end
    
    alt User clicks tool ID
        User->>SearchTools: Click tool ID button
        SearchTools->>SearchTools: Navigate to SearchToolView
        SearchToolView->>User: Display tool details & tester
    end
    
    alt User edits DB tool
        User->>SearchTools: Click Edit button
        SearchTools->>SearchTools: Open edit modal with form
        User->>SearchTools: Submit changes
        SearchTools->>API: updateSearchTool(accessToken, toolId, data)
        API->>Backend: PUT /search_tool/{toolId}
        Backend-->>API: Updated tool
        API-->>SearchTools: Success
        SearchTools->>SearchTools: Refetch tools & close modal
    end
    
    alt User deletes DB tool
        User->>SearchTools: Click Delete button
        SearchTools->>SearchTools: Open DeleteResourceModal
        User->>SearchTools: Confirm delete
        SearchTools->>API: deleteSearchTool(accessToken, toolId)
        API->>Backend: DELETE /search_tool/{toolId}
        Backend-->>API: Success
        API-->>SearchTools: Success
        SearchTools->>SearchTools: Refetch tools & close modal
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@yuneng-jiang yuneng-jiang merged commit d2e1131 into main Feb 4, 2026
57 of 66 checks passed
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.

1 participant