File tree Expand file tree Collapse file tree
EssentialCSharp.Chat.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json;
1313 </RestoreSources >
1414 </PropertyGroup >
15+ <PropertyGroup >
16+ <SemanticKernelVersion >1.72.0</SemanticKernelVersion >
17+ </PropertyGroup >
1518 <ItemGroup Condition =" $(AccessToNugetFeed)" >
1619 <PackageVersion Include =" ContentFeedNuget" Version =" $(ToolingPackagesVersion)" />
1720 </ItemGroup >
3639 <PackageVersion Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 10.0.3" />
3740 <PackageVersion Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 10.0.3" />
3841 <PackageVersion Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 10.0.3" />
39- <PackageVersion Include =" Microsoft.SemanticKernel" Version =" 1.72.0 " />
40- <PackageVersion Include =" Microsoft.SemanticKernel.Connectors.PgVector" Version =" 1.70.0 -preview" />
42+ <PackageVersion Include =" Microsoft.SemanticKernel" Version =" $(SemanticKernelVersion) " />
43+ <PackageVersion Include =" Microsoft.SemanticKernel.Connectors.PgVector" Version =" $(SemanticKernelVersion) -preview" />
4144 <PackageVersion Include =" Microsoft.SourceLink.GitHub" Version =" 10.0.103" />
4245 <PackageVersion Include =" Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version =" 1.23.0" />
4346 <PackageVersion Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 10.0.2" />
Original file line number Diff line number Diff line change 1+ using EssentialCSharp . Chat . Common . Models ;
2+ using Microsoft . SemanticKernel . Connectors . PgVector ;
3+
4+ #pragma warning disable SKEXP0010 // PgVector APIs are experimental
5+
6+ namespace EssentialCSharp . Chat . Tests ;
7+
8+ public class PgVectorConnectorTests
9+ {
10+ /// <summary>
11+ /// Verifies that PostgresVectorStore.GetCollection does not throw a TypeLoadException,
12+ /// which would indicate a version mismatch between Microsoft.SemanticKernel core and
13+ /// Microsoft.SemanticKernel.Connectors.PgVector (e.g., missing vtable slots on
14+ /// internal types like PostgresModelBuilder).
15+ /// </summary>
16+ [ Test ]
17+ public async Task GetCollection_WithBookContentChunk_DoesNotThrowTypeLoadException ( )
18+ {
19+ // Arrange — no real DB connection is needed; connections are only opened for actual queries
20+ var store = new PostgresVectorStore ( "Host=localhost;Database=test;Username=test;Password=test" ) ;
21+
22+ // Act — this triggers loading internal PostgresModelBuilder via PostgresCollection ctor
23+ var collection = store . GetCollection < string , BookContentChunk > ( "test-collection" ) ;
24+
25+ // Assert
26+ await Assert . That ( collection ) . IsNotNull ( ) ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments