From 77daf0c2035ec7982794b556970a6ea1652922b7 Mon Sep 17 00:00:00 2001 From: Kosta Petan Date: Thu, 9 Nov 2023 09:46:27 +0000 Subject: [PATCH] breaking change WIP --- src/apps/cli/cli.csproj | 4 +- src/apps/gh-flow-df/gh-flow-df.csproj | 4 +- src/apps/gh-flow/gh-flow.csproj | 2 +- src/apps/seed-memory/seed-memory.csproj | 4 +- .../Elsa.SemanticKernel.csproj | 4 +- .../Microsoft.AI.DevTeam.Skills/Developer.cs | 50 +++++++++++++++---- .../Microsoft.AI.DevTeam.Skills.csproj | 2 +- .../Actors/Ingester/Ingester.cs | 7 +-- .../Actors/ProductManager/ProductManager.cs | 7 ++- .../Microsoft.AI.DevTeam.csproj | 2 +- 10 files changed, 58 insertions(+), 28 deletions(-) diff --git a/src/apps/cli/cli.csproj b/src/apps/cli/cli.csproj index d1bfcd0ad..b930ed06f 100644 --- a/src/apps/cli/cli.csproj +++ b/src/apps/cli/cli.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/apps/gh-flow-df/gh-flow-df.csproj b/src/apps/gh-flow-df/gh-flow-df.csproj index aba8a20b4..07d73342f 100644 --- a/src/apps/gh-flow-df/gh-flow-df.csproj +++ b/src/apps/gh-flow-df/gh-flow-df.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/src/apps/gh-flow/gh-flow.csproj b/src/apps/gh-flow/gh-flow.csproj index 3596510a5..cc7e902d1 100644 --- a/src/apps/gh-flow/gh-flow.csproj +++ b/src/apps/gh-flow/gh-flow.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/apps/seed-memory/seed-memory.csproj b/src/apps/seed-memory/seed-memory.csproj index 5bb4ec8ec..e73fad29e 100644 --- a/src/apps/seed-memory/seed-memory.csproj +++ b/src/apps/seed-memory/seed-memory.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj index c6f821073..85445d758 100644 --- a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj +++ b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cs b/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cs index 50ffc01da..a6e51484c 100644 --- a/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cs +++ b/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cs @@ -48,21 +48,49 @@ public static class Developer { public static SemanticFunctionConfig Explain = new SemanticFunctionConfig { PromptTemplate = """ - You are a Software Developer. - Please explain the code that is in the input below. You can include references or documentation links in your explanation. - Also where appropriate please output a list of keywords to describe the code or its capabilities. - example: - Keywords: Azure, networking, security, authentication + You are an experienced software developer, with strong experience in Azure and Microsoft technologies. + Extract the key features and capabilities of the code file below, with the intent to build an understanding of an entire code repository. + You can include references or documentation links in your explanation. Also where appropriate please output a list of keywords to describe the code or its capabilities. + Example: + Keywords: Azure, networking, security, authentication - If the code's purpose is not clear output an error: + ===code=== + {{$input}} + ===end-code=== + Only include the points in a bullet point format and DON'T add anything outside of the bulleted list. + Be short and concise. + If the code's purpose is not clear output an error: Error: The model could not determine the purpose of the code. - - -- - Input: {{$input}} """, Name = nameof(Explain), SkillName = nameof(CodeExplainer), - Description = "From a description of a coding task out put the code or scripts necessary to complete the task.", + Description = "From a source file produce an explanation of what the code does", + MaxTokens = 6500, + Temperature = 0.0, + TopP = 0.0, + PPenalty = 0.0, + FPenalty = 0.0 + }; + + public static SemanticFunctionConfig ConsolidateUnderstanding = new SemanticFunctionConfig + { + PromptTemplate = """ + You are an experienced software developer, with strong experience in Azure and Microsoft technologies. + You are trying to build an understanding of the codebase from code files. This is the current understanding of the project: + ===current-understanding=== + {{$input}} + ===end-current-understanding=== + and this is the new information that surfaced + ===new-understanding=== + {{$newUnderstanding}} + ===end-new-understanding=== + Your job is to update your current understanding with the new information. + Only include the points in a bullet point format and DON'T add anything outside of the bulleted list. + Be short and concise. + """, + Name = nameof(Explain), + SkillName = nameof(CodeExplainer), + Description = "From a source file produce an explanation of what the code does", MaxTokens = 6500, Temperature = 0.0, TopP = 0.0, @@ -70,3 +98,5 @@ public static class Developer { FPenalty = 0.0 }; } + + diff --git a/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj index 11eebbb3e..fb2eeb6a7 100644 --- a/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj +++ b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj @@ -7,6 +7,6 @@ - + diff --git a/src/libs/Microsoft.AI.DevTeam/Actors/Ingester/Ingester.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Ingester/Ingester.cs index 40ab7103a..f724a56e8 100644 --- a/src/libs/Microsoft.AI.DevTeam/Actors/Ingester/Ingester.cs +++ b/src/libs/Microsoft.AI.DevTeam/Actors/Ingester/Ingester.cs @@ -23,9 +23,7 @@ public class Ingester : SemanticPersona, IIngestRepo var language = await _ghService.GetMainLanguage(org, repo); var files = await _ghService.GetFiles(org, repo, branch, Language.Filters[language]); - var pm = GrainFactory.GetGrain(0, suffix); var dev = GrainFactory.GetGrain(0, suffix); - var devLead = GrainFactory.GetGrain(0, suffix); foreach (var file in files) { @@ -33,10 +31,7 @@ public class Ingester : SemanticPersona, IIngestRepo codeAnalysis.ToList().ForEach(async c => await _kernel.Memory.SaveInformationAsync(MemorySegment, c.CodeBlock, Guid.NewGuid().ToString(), c.Meaning)); - Task.WaitAll(new[] { - pm.BuildUnderstanding(file.Content), - dev.BuildUnderstanding(file.Content), - devLead.BuildUnderstanding(file.Content)}); + await dev.BuildUnderstanding(file.Content); } } } diff --git a/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cs b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cs index 4f4bde3ca..a217aed05 100644 --- a/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cs +++ b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cs @@ -9,7 +9,7 @@ public class ProductManager : SemanticPersona, IManageProduct private readonly IKernel _kernel; protected override string MemorySegment => "pm-memory"; - public ProductManager(IKernel kernel,[PersistentState("state", "messages")] IPersistentState state) : base(state) + public ProductManager(IKernel kernel,[PersistentState("state", "messages")] IPersistentState state) : base(state) { _kernel = kernel; } @@ -39,4 +39,9 @@ public class ProductManager : SemanticPersona, IManageProduct await _state.WriteStateAsync(); return resultMessage; } + + public Task BuildUnderstanding(string content) + { + throw new NotImplementedException(); + } } diff --git a/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj index b3c2a1dd6..4e767065d 100644 --- a/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj +++ b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj @@ -10,7 +10,7 @@ - +