Skip to content

Commit b637c59

Browse files
committed
Move SearchQueryFilterClause to Plugins.Web and make FilterClause constructor public
Per reviewer feedback, moving SearchQueryFilterClause from Microsoft.Extensions.VectorData to Microsoft.SemanticKernel.Plugins.Web namespace as internal class, where it's actually used (Brave/Tavily connectors). Changes: - FilterClause.cs: Changed constructor from 'internal' to 'public' to allow external inheritance - SearchQueryFilterClause.cs: Moved to Plugins.Web/FilterClauses/ as internal sealed class - VectorData.Abstractions.csproj: Added CA1012 suppression (abstract types with public constructors) Trade-off: Opening FilterClause to external inheritance is accepted to minimize MEVD public API surface.
1 parent a689b0c commit b637c59

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3-
namespace Microsoft.Extensions.VectorData;
3+
using Microsoft.Extensions.VectorData;
4+
5+
namespace Microsoft.SemanticKernel.Plugins.Web;
46

57
/// <summary>
68
/// Represents a filter clause that adds terms to the search query itself for text search engines.
@@ -18,7 +20,7 @@ namespace Microsoft.Extensions.VectorData;
1820
///
1921
/// See ADR-TextSearch-Contains-Support.md for architectural context and cross-engine comparison.
2022
/// </remarks>
21-
public sealed class SearchQueryFilterClause : FilterClause
23+
internal sealed class SearchQueryFilterClause : FilterClause
2224
{
2325
/// <summary>
2426
/// Initializes a new instance of the <see cref="SearchQueryFilterClause"/> class.

dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace Microsoft.Extensions.VectorData;
1111
/// </remarks>
1212
public abstract class FilterClause
1313
{
14-
internal FilterClause()
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="FilterClause"/> class.
16+
/// </summary>
17+
public FilterClause()
1518
{
1619
}
1720
}

dotnet/src/VectorData/VectorData.Abstractions/VectorData.Abstractions.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
88
<!-- temporarily disabled due to mysterious build issue -->
99
<EnablePackageValidation>false</EnablePackageValidation>
10+
<!-- Suppress CA1012: FilterClause constructor made public to allow Plugins.Web to inherit -->
11+
<NoWarn>$(NoWarn);CA1012</NoWarn>
1012
</PropertyGroup>
1113

1214
<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />

0 commit comments

Comments
 (0)