Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented May 4, 2025

Following #11832, this shortens the names of provider implementation types as discussed in API review (e.g. AzureCosmosDBMongoDBVectorStoreRecordCollection -> CosmosMongoCollection)

  • For Cosmos, I've left CosmosMongo vs. CosmosNoSql (note lower-case Sql rather than the previous SQL) to disambiguate, as discussed in API review.
  • We could also shorten PostgresVectorStore to PostgresStore (similar to how we have PostgresCollection now). For now I'm leaving PostgresVectorStore - we can discuss.
  • No namespaces/nuget package names are touched - I'll do this in a later PR.

Closes #11230

@roji roji requested a review from westey-m May 4, 2025 11:55
@roji roji requested a review from a team as a code owner May 4, 2025 11:55
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel memory labels May 4, 2025
@roji roji linked an issue May 4, 2025 that may be closed by this pull request
@github-actions github-actions bot changed the title Shorten MEVD implementation type names .Net: Shorten MEVD implementation type names May 4, 2025
@roji roji temporarily deployed to integration May 4, 2025 11:55 — with GitHub Actions Inactive
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, I love the simplicity of the new names! Thank you @roji !

/// <returns>The record key.</returns>
public delegate TKey? InMemoryVectorStoreKeyResolver<TKey, TRecord>(TRecord record)
[Experimental("MEVD9000")]
public delegate TKey? InMemoryKeyResolver<TKey, TRecord>(TRecord record)
Copy link
Member

Choose a reason for hiding this comment

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

We should try to replace a custom delgate with Func if possible (I see it has a generic constraint, but if it's being used with a method that already has such constraint, we could get rid of it)

I don't ask for doing this in this PR, we could just give it a try and maybe avoid the need of having another experimental type

Copy link
Member

Choose a reason for hiding this comment

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

I've sent #11889 to address this

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not quite sure whether these resolvers are necessary or what the motivation for them is - we may just want to remove them altogether... I'll bring it up in an upcoming standup. In any case, they're flagged as experimental so we always have the option to remove them later.

/// <param name="record">The record that contains the vector to look up.</param>
/// <returns>The named vector from the record.</returns>
public delegate object? InMemoryVectorStoreVectorResolver<TRecord>(string vectorName, TRecord record);
[Experimental("MEVD9000")]
Copy link
Member

Choose a reason for hiding this comment

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

Same as for the other reslolver delegate: could we make it a Func?

Copy link
Member Author

Choose a reason for hiding this comment

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

namespace Microsoft.SemanticKernel.Connectors.SqlServer;

internal sealed class RecordMapper<TRecord>(CollectionModel model)
internal sealed class SqlServerMapper<TRecord>(CollectionModel model)
Copy link
Member

Choose a reason for hiding this comment

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

FWIW I have used the RecordMapper name on purpose: it's an internal type of the Sql package, so for me there was no need to use the Sql prefix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, the only thing is to make it easier for us to navigate the codebase in the IDE, i.e. to jump directly to the mapper of a specific provider... Otherwise, if we have lots of RecordMappers in different providers, navigations becomes difficult...

Now with the shorter names, PostgresMapper, SqlServerMapper etc. seem reasonable enough to me in any case...

@adamsitnik adamsitnik merged commit 1d82e6c into microsoft:feature-vector-data-preb3 May 5, 2025
17 checks passed
@roji roji deleted the MoarRenaming branch May 5, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel memory .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: [MEVD] Shorten IVectorStoreRecordCollection (and related) names

3 participants