Skip to content

.Net MEVD Replace VectorSearchResults with IAsyncEnumerable #11486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 12, 2025

Conversation

adamsitnik
Copy link
Member

fixes #11048

…le<VectorSearchResult> rather than VectorSearchResults
@adamsitnik adamsitnik requested review from roji and westey-m April 10, 2025 14:56
@adamsitnik adamsitnik requested a review from a team as a code owner April 10, 2025 14:56
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel memory labels Apr 10, 2025
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Looks good! 3 general comments:

  • VectorizedSearchAsync also needs to have its return type changed, as the others
  • There are some cases where it should be possible to just use AsAsyncEnumerable() and return the result from that, rather than making the method async and yielding results
  • In many tests it should be possible to now merge the two lines together (i.e. BlaBlaSearch().ToListAsync()

…o removeVSR

# Conflicts:
#	dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs
- change VectorizableTextSearchAsync as well
- make sure provider-specific exceptions are wrapped with VectorStoreOperationException
@@ -56,7 +56,7 @@ public static async IAsyncEnumerable<T> WrapAsyncEnumerableAsync<T>(
var more = await enumerator.MoveNextAsync();
return (enumerator.Current, more);
}
catch (Exception ex)
catch (Exception ex) when (ex is not (NotSupportedException or ArgumentException))
Copy link
Member

Choose a reason for hiding this comment

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

I think we should be going the other way, and specifically identifying the exceptions we want to wrap. For example, this will still wrap OperationCanceledException.

I'd recommend not dealing with this in this PR, but doing a proper separate pass across all providers to check on the exception behavior, as discussed offline (#11512).

- inline variables that just store the VectorizedSearchAsync result
- reduce the number of places we perfom async foreach just to yield the results
- make IncludeTotalCount obsolete
@adamsitnik adamsitnik added the msft.ext.vectordata Related to Microsoft.Extensions.VectorData label Apr 11, 2025
…3): error WHITESPACE: Fix whitespace formatting. Insert '\s'."

I can't repro it locally, here is my attempt to fix it
…o removeVSR

# Conflicts:
#	dotnet/src/IntegrationTests/Connectors/Memory/Weaviate/WeaviateVectorStoreRecordCollectionTests.cs
@adamsitnik adamsitnik merged commit 4f80c12 into microsoft:feature-vector-data-preb2 Apr 12, 2025
11 checks passed
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 msft.ext.vectordata Related to Microsoft.Extensions.VectorData .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants