From 4b4d6285509f5ce0b89989cb311ece73c4a1d9cd Mon Sep 17 00:00:00 2001 From: Craig Presti <146438+craigomatic@users.noreply.github.com> Date: Fri, 31 Mar 2023 08:10:12 -0700 Subject: [PATCH] Create a unique id per paragraph when summarisation is larger than a single unit --- samples/dotnet/github-skills/GitHubSkill.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/dotnet/github-skills/GitHubSkill.cs b/samples/dotnet/github-skills/GitHubSkill.cs index 67fd8b22e907..eb96a276dda7 100644 --- a/samples/dotnet/github-skills/GitHubSkill.cs +++ b/samples/dotnet/github-skills/GitHubSkill.cs @@ -191,12 +191,12 @@ private async Task SummarizeCodeFileAsync(string filePath, string repositoryUri, } } - foreach (var paragraph in paragraphs) + for (int i = 0; i < paragraphs.Count; i++) { await this._kernel.Memory.SaveInformationAsync( $"{repositoryUri}-{repositoryBranch}", - text: $"{paragraph} File:{repositoryUri}/blob/{repositoryBranch}/{fileUri}", - id: fileUri); + text: $"{paragraphs[i]} File:{repositoryUri}/blob/{repositoryBranch}/{fileUri}", + id: $"{fileUri}_{i}"); } } else