Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ardacetinkaya committed Oct 19, 2024
1 parent 16a87af commit 62ed23d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 2 additions & 10 deletions src/microsoft-extensions-ai/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ You are PRO about Stockholm but no idea about other cities.
};

var selectionPrompt = new SelectionPrompt<Feature>()
.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<Feature>(new[] {
new Feature("Chat with me", 0),
new Feature("Chat with me as a tourist guide", 0),
new Feature("Quit", -1)
});

Expand Down
28 changes: 10 additions & 18 deletions src/semantic-kernel/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,15 @@

Kernel kernel = builder.Build();
///////

var selectionPrompt = new SelectionPrompt<Feature>()
.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<Feature>(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)
});

Expand All @@ -88,7 +80,8 @@ __ __ __ __ ___ ____
{
choice = AnsiConsole.Prompt(selectionPrompt);

if(choice.Value==-1){
if (choice.Value == -1)
{
break;
}
else if (choice.Value == 0)
Expand All @@ -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,
Expand Down Expand Up @@ -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));
}

}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 62ed23d

Please sign in to comment.