semantic-kernel
semantic-kernel copied to clipboard
Return embedding in MemoryQueryResult if requested
Motivation and Context
A previous PR enabled a withEmbedding for all memory get/search methods, but this did not bubble up the embedding through SemanticTextMemory. By default, SemanticTextMemory will not return the embedding.
Description
- Added a nullable
embeddingfield toMemoryQueryResult. MemoryQueryResult.FromMemoryRecord()takes into account the memory record containing a populated embedding.- Removed
MemoryQueryResult.FromJson()constructor - it is not used. - updated planner tests with keyword parameters to make clear the inputs to memory calls.
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: