From 62ed23d09f2678be17932465558bf35f152e90d6 Mon Sep 17 00:00:00 2001 From: Arda Cetinkaya Date: Sat, 19 Oct 2024 12:56:43 +0200 Subject: [PATCH] Update --- README.md | 3 --- src/microsoft-extensions-ai/Program.cs | 12 ++--------- src/semantic-kernel/Program.cs | 28 +++++++++----------------- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index c779ec6..5526148 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,6 @@ There is also new GitHub Marketplace for models(Preview) - https://github.com/ma I will try to update this repository to learn and play more. And please feel free to share any feedback or help me out to figure out those, I will really appreciate... - -![What](/img01.png) - ![What](/img02.png) ![What](/img03.png) diff --git a/src/microsoft-extensions-ai/Program.cs b/src/microsoft-extensions-ai/Program.cs index 06720e9..4992067 100644 --- a/src/microsoft-extensions-ai/Program.cs +++ b/src/microsoft-extensions-ai/Program.cs @@ -25,19 +25,11 @@ You are PRO about Stockholm but no idea about other cities. }; var selectionPrompt = new SelectionPrompt() - .Title(@" - __ __ __ __ ___ ____ - / / / /___ / // /____ / | / _/ - / /_/ // _ \ / // // __ \ / /| | / / - / __ // __// // // /_/ / / ___ | _/ / -/_/ /_/ \___//_//_/ \____/ /_/ |_|/___/ - - What do you want me to do? - ") + .Title(@"What do you want me to do?s") .PageSize(10) .MoreChoicesText("[grey](Move up and down to reveal more options)[/]") .AddChoices(new[] { - new Feature("Chat with me", 0), + new Feature("Chat with me as a tourist guide", 0), new Feature("Quit", -1) }); diff --git a/src/semantic-kernel/Program.cs b/src/semantic-kernel/Program.cs index dcf4ff6..0145488 100644 --- a/src/semantic-kernel/Program.cs +++ b/src/semantic-kernel/Program.cs @@ -60,23 +60,15 @@ Kernel kernel = builder.Build(); /////// - + var selectionPrompt = new SelectionPrompt() - .Title(@" - __ __ __ __ ___ ____ - / / / /___ / // /____ / | / _/ - / /_/ // _ \ / // // __ \ / /| | / / - / __ // __// // // /_/ / / ___ | _/ / -/_/ /_/ \___//_//_/ \____/ /_/ |_|/___/ - - What do you want me to do? - ") + .Title(@"What do you want me to do?") .PageSize(10) .MoreChoicesText("[grey](Move up and down to reveal more options)[/]") .AddChoices(new[] { new Feature("Chat with me", 0), - new Feature("Suggest me a movie (w/VolatileMemoryStore)", 1), - new Feature("Suggest me a movie (w/MongoDBMemoryStore)", 2), + new Feature("Search a movie (w/VolatileMemoryStore)", 1), + new Feature("Search me a movie (w/MongoDBMemoryStore)", 2), new Feature("Quit", -1) }); @@ -88,7 +80,8 @@ __ __ __ __ ___ ____ { choice = AnsiConsole.Prompt(selectionPrompt); - if(choice.Value==-1){ + if (choice.Value == -1) + { break; } else if (choice.Value == 0) @@ -101,7 +94,7 @@ __ __ __ __ ___ ____ ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions, // Controls randomness in the response, use lower to be more deterministic. Temperature = 0.7, - + // Controls text diversity by selecting the most probable words until a set probability is reached. TopP = 1, ModelId = settings.ModelId, @@ -129,9 +122,7 @@ await LoopAsync($"Tell me more about what are you looking for?", async (question memory = await GenerateMongoDBMemory(memoryName); await LoopAsync($"Tell me more about what are you looking for?", async (question) => - { - await ProcessMovieSuggestionWithEmbeddedSearchAsync(question, memory, memoryName); - }); + await ProcessMovieSuggestionWithEmbeddedSearchAsync(question, memory, memoryName)); } } @@ -260,7 +251,8 @@ await memory.SaveReferenceAsync( return memory; } -record Feature(string DisplayName, int Value){ +record Feature(string DisplayName, int Value) +{ public override string ToString() { return DisplayName;