.Net: Improved Logging for 06-memory-and-embeddings.ipynb (#5638)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

1. This change is required to provide a more detailed and readable
output from the memory search operation.
2. It solves the problem of not having enough information about the
relevance of the search results.
3. This change contributes to the scenario where developers are
debugging or monitoring the memory search operation, as the enhanced
logging will provide more insight into the performance of the search.
4. This change also facilitates learners to modify the search content
and test with the stored vector data.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

This PR modifies the logging format in the
06-memory-and-embeddings.ipynb file in the semantic-kernel project. The
change involves printing out the question and the corresponding
response's relevance and text. This will help developers better
understand the relevance information of the memory search results.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

Co-authored-by: Mark Wallace <[email protected]>
This commit is contained in:
桑榆肖物
2024-04-02 19:04:31 +00:00
committed by GitHub
co-authored by Mark Wallace
parent 0735e84402
commit c65644a175
@@ -194,7 +194,8 @@
"foreach (var q in questions)\n",
"{\n",
" var response = await memory.SearchAsync(MemoryCollectionName, q).FirstOrDefaultAsync();\n",
" Console.WriteLine(q + \" \" + response?.Metadata.Text);\n",
" Console.WriteLine(\"Q: \" + q);\n",
" Console.WriteLine(\"A: \" + response?.Relevance.ToString() + \"\\t\" + response?.Metadata.Text);\n",
"}"
]
},