Skip to content

Conversation

@JeffreySu
Copy link
Contributor

No description provided.

zhao365845726 and others added 6 commits October 10, 2025 21:07
Optimize the VectorDB class in the Senparc.AI.Interfaces class
Debug Embedding Function Content
[2025-11-01] v0.24.4 Combine VectorDBType from different projects
@JeffreySu JeffreySu requested review from Copilot and zhao365845726 and removed request for Copilot November 1, 2025 03:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR consolidates VectorDB type enumerations from different projects into a single unified definition. The main purpose is to simplify the codebase by combining VectorDBType enumerations and updating the vector store configuration logic to use the consolidated enum.

Key changes:

  • Replaced the extensive VectorDBType enum (with 19 values) with a simplified enum containing 9 basic types (Memory, HardDisk, Redis, Mulivs, Chroma, PostgreSQL, Sqlite, SqlServer, Qdrant)
  • Updated switch-case statements in KernelConfigExtensions to map to the new enum values
  • Removed redundant code and unused SenparcSetting parameter from sample application

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
Senparc.AI.csproj Updated version to 0.24.4 and added release note for VectorDBType consolidation
ISenparcAiSetting.cs Replaced the complex VectorDBType enum (19 values) with a simplified version (9 values), commented out the old enum
Enums.cs Commented out the duplicate VectorDBType enum definition
Senparc.AI.Kernel.csproj Updated version to 0.25.3
KernelConfigExtensions.cs Refactored switch statements to use new VectorDBType values, added using statement for VectorDB
Senparc.AI.Agents.csproj Updated version to 0.5.7
Program.cs Removed unused SenparcSetting initialization and parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

case VectorDB.VectorDBType.CosmosDBMongoDB:
case VectorDBType.Memory:
{
vectorStore = new InMemoryVectorStore();
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Disposable 'InMemoryVectorStore' is created but not disposed.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Nov 1, 2025

@JeffreySu I've opened a new pull request, #161, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 1, 2025

@JeffreySu I've opened a new pull request, #162, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 1, 2025

@JeffreySu I've opened a new pull request, #163, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 5 commits November 1, 2025 05:38
Wrap disposable vector stores in using statements to prevent resource leaks
Fix VectorStore lifecycle management and remove premature disposal
Copy link
Contributor

Copilot AI commented Nov 1, 2025

@JeffreySu I've opened a new pull request, #164, to work on those changes. Once the pull request is ready, I'll request review from you.

@JeffreySu JeffreySu requested a review from Copilot November 1, 2025 08:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// JDBC=8,
// Milvus=9, //Planed (not included in https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/inmemory-connector?pivots=programming-language-csharp)
// MongoDB=10,
// Pinecon=11,
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Possible typo: 'Pinecon' should likely be 'Pinecone' (the vector database name) in commented code.

Suggested change
// Pinecon=11,
// Pinecone=11,

Copilot uses AI. Check for mistakes.
case VectorDB.VectorDBType.CosmosDBMongoDB:
case VectorDBType.Memory:
{
vectorStore = new InMemoryVectorStore();
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Disposable 'InMemoryVectorStore' is created but not disposed.

Copilot uses AI. Check for mistakes.
Comment on lines +273 to +275
vectorStore = new RedisVectorStore(database,
new() { StorageType = RedisStorageType.Json });
collection = vectorStore.GetCollection<TKey, TRecord>(name, vectorStoreRecordDefinition);
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Disposable 'RedisVectorStore' is created but not disposed.

Suggested change
vectorStore = new RedisVectorStore(database,
new() { StorageType = RedisStorageType.Json });
collection = vectorStore.GetCollection<TKey, TRecord>(name, vectorStoreRecordDefinition);
using (var redisVectorStore = new RedisVectorStore(database,
new() { StorageType = RedisStorageType.Json }))
{
collection = redisVectorStore.GetCollection<TKey, TRecord>(name, vectorStoreRecordDefinition);
}

Copilot uses AI. Check for mistakes.
@JeffreySu JeffreySu merged commit c16e244 into main Nov 1, 2025
7 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.

3 participants