-
Notifications
You must be signed in to change notification settings - Fork 4k
.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
.Net MEVD Replace VectorSearchResults with IAsyncEnumerable #11486
Conversation
…le<VectorSearchResult> rather than VectorSearchResults
There was a problem hiding this 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()
...s/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/Concepts/Memory/VectorStore_Langchain_Interop.cs
Outdated
Show resolved
Hide resolved
...ctors.AzureCosmosDBMongoDB.UnitTests/AzureCosmosDBMongoDBVectorStoreRecordCollectionTests.cs
Outdated
Show resolved
Hide resolved
...onnectors.AzureCosmosDBNoSQL.UnitTests/AzureCosmosDBNoSQLVectorStoreRecordCollectionTests.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs
Show resolved
Hide resolved
…o removeVSR # Conflicts: # dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs
- change VectorizableTextSearchAsync as well - make sure provider-specific exceptions are wrapped with VectorStoreOperationException
...t/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs
Show resolved
Hide resolved
...t/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs
Outdated
Show resolved
Hide resolved
@@ -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)) |
There was a problem hiding this comment.
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).
...t/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs
Show resolved
Hide resolved
dotnet/samples/Concepts/Memory/VectorStore_Langchain_Interop.cs
Outdated
Show resolved
Hide resolved
- 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
…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
4f80c12
into
microsoft:feature-vector-data-preb2
fixes #11048