semantic-kernel
semantic-kernel copied to clipboard
Qdrant: fix skipping upserts
Description
In the Qdrant connector, during Upsert(), it checks whether the vector already exists in the db; if so, it calls continue and skips upserting. The expected behavior of Upsert() is Insert+Update, but currently only the insert is working updates are explicitly skipped.
Resolves https://github.com/microsoft/semantic-kernel/issues/1035
Also includes some minor cleanup on the internal request builder classes:
- DeleteRange
- UpsertRange ...allow you to create the Builder, add all operations, and Build() in a single statement, so you never have to hold an instance of the Builder as a var just to operate a loop.
Contribution Checklist
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with
dotnet format - [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone :smile:
@tawalke This code is UNTESTED (hence the "Draft" status). Can you please take over this PR, test with a qdrant instance?