Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ EssentialCSharpManuscript.[0-9]
.vs/
obj
bin
TestResults/
~$*.do[ct]x
~*.tmp
~$*.dotm
Expand Down
7 changes: 5 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
<PropertyGroup>
<SemanticKernelVersion>1.72.0</SemanticKernelVersion>
</PropertyGroup>
<ItemGroup Condition="$(AccessToNugetFeed)">
<PackageVersion Include="ContentFeedNuget" Version="$(ToolingPackagesVersion)" />
</ItemGroup>
Expand All @@ -36,8 +39,8 @@
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.3" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.72.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.PgVector" Version="1.70.0-preview" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="$(SemanticKernelVersion)" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.PgVector" Version="$(SemanticKernelVersion)-preview" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.103" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.2" />
Expand Down
28 changes: 28 additions & 0 deletions EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using EssentialCSharp.Chat.Common.Models;
using Microsoft.SemanticKernel.Connectors.PgVector;

namespace EssentialCSharp.Chat.Tests;

public class PgVectorConnectorTests
{
/// <summary>
/// Verifies that PostgresVectorStore.GetCollection does not throw a TypeLoadException,
/// which would indicate a version mismatch between Microsoft.SemanticKernel core and
/// Microsoft.SemanticKernel.Connectors.PgVector (e.g., missing vtable slots on
/// internal types like PostgresModelBuilder).
/// </summary>
[Test]
public async Task GetCollection_WithBookContentChunk_DoesNotThrowTypeLoadException()
{
// Arrange — no real DB connection is needed; connections are only opened for actual queries
#pragma warning disable SKEXP0010 // PostgresVectorStore is experimental
using var store = new PostgresVectorStore("Host=localhost;Database=test;Username=test;Password=test");

// Act — this triggers loading internal PostgresModelBuilder via PostgresCollection ctor
var collection = store.GetCollection<string, BookContentChunk>("test-collection");
#pragma warning restore SKEXP0010

// Assert
await Assert.That(collection).IsNotNull();
}
}
Loading