semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Return embedding in MemoryQueryResult if requested

Open awharrison-28 opened this issue 2 years ago • 0 comments

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 embedding field to MemoryQueryResult.
  • 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:

awharrison-28 avatar Apr 18 '23 23:04 awharrison-28