.Net: Net: feat: Modernize TavilyTextSearch and BraveTextSearch connectors with ITextSearch<TRecord> interface (microsoft#10456) #13191
+1,060
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modernize TavilyTextSearch and BraveTextSearch connectors with ITextSearch interface
Problem Statement
The TavilyTextSearch and BraveTextSearch connectors currently implement only the legacy ITextSearch interface, forcing users to use clause-based TextSearchFilter instead of modern type-safe LINQ expressions. Additionally, the existing LINQ support is limited to basic expressions (equality, AND operations).
Technical Approach
This PR modernizes both connectors with generic interface implementation and extends LINQ filtering to support OR operations, negation, and inequality operators. The implementation adds type-safe model classes and enhanced expression tree analysis capabilities.
Implementation Details
Core Changes
Enhanced LINQ Expression Support
Code Examples
Before (Legacy Interface)
After (Generic Interface)
Implementation Benefits
Interface Modernization
Enhanced Filtering Capabilities
Developer Experience
Validation Results
Build Verification
dotnet build --configuration Release --interactive
Test Results
Full Test Suite:
Core Unit Tests:
dotnet test src\SemanticKernel.UnitTests\SemanticKernel.UnitTests.csproj --configuration Release
Test Failure Analysis
The 1,361 test failures are infrastructure/configuration issues, not code defects:
These failures are expected in development environments without external API configurations.
Code Quality
dotnet format SK-dotnet.slnx
Files Modified
Breaking Changes
None. All existing LINQ expressions continue to work unchanged with enhanced error message generation.
Multi-PR Context
This is PR 5 of 6 in the structured implementation approach for Issue #10456. This PR completes the modernization of remaining text search connectors with enhanced LINQ expression capabilities while maintaining full backward compatibility.