Skip to content

Commit ba45679

Browse files
Add some documentation
1 parent 7d69cbb commit ba45679

File tree

1 file changed

+0
-77
lines changed

1 file changed

+0
-77
lines changed

dotnet/samples/Concepts/FunctionCalling/FunctionCalling.cs

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Microsoft. All rights reserved.
22

3-
using System.ComponentModel;
43
using System.Text;
54
using Microsoft.SemanticKernel;
65
using Microsoft.SemanticKernel.ChatCompletion;
@@ -569,82 +568,6 @@ private static Kernel CreateKernel(ITestOutputHelper? output = null)
569568
}, "GetWeatherForCity", "Gets the current weather for the specified city and specified date time."),
570569
]);
571570

572-
kernel.Plugins.AddFromType<MenuPlugin>();
573-
574571
return kernel;
575572
}
576573
}
577-
578-
public sealed class MenuPlugin
579-
{
580-
[KernelFunction, Description("Provides a list of specials from the menu.")]
581-
public MenuItem[] GetMenu()
582-
{
583-
return s_menuItems;
584-
}
585-
586-
[KernelFunction, Description("Provides a list of specials from the menu.")]
587-
public MenuItem[] GetSpecials()
588-
{
589-
return s_menuItems.Where(i => i.IsSpecial).ToArray();
590-
}
591-
592-
[KernelFunction, Description("Provides the price of the requested menu item.")]
593-
public float? GetItemPrice(
594-
[Description("The name of the menu item.")]
595-
string menuItem)
596-
{
597-
return s_menuItems.FirstOrDefault(i => i.Name.Equals(menuItem, StringComparison.OrdinalIgnoreCase))?.Price;
598-
}
599-
600-
private static readonly MenuItem[] s_menuItems =
601-
[
602-
new()
603-
{
604-
Category = "Soup",
605-
Name = "Clam Chowder",
606-
Price = 4.95f,
607-
IsSpecial = true,
608-
},
609-
new()
610-
{
611-
Category = "Soup",
612-
Name = "Tomato Soup",
613-
Price = 4.95f,
614-
IsSpecial = false,
615-
},
616-
new()
617-
{
618-
Category = "Salad",
619-
Name = "Cobb Salad",
620-
Price = 9.99f,
621-
},
622-
new()
623-
{
624-
Category = "Salad",
625-
Name = "House Salad",
626-
Price = 4.95f,
627-
},
628-
new()
629-
{
630-
Category = "Drink",
631-
Name = "Chai Tea",
632-
Price = 2.95f,
633-
IsSpecial = true,
634-
},
635-
new()
636-
{
637-
Category = "Drink",
638-
Name = "Soda",
639-
Price = 1.95f,
640-
},
641-
];
642-
643-
public sealed class MenuItem
644-
{
645-
public string Category { get; init; }
646-
public string Name { get; init; }
647-
public float Price { get; init; }
648-
public bool IsSpecial { get; init; }
649-
}
650-
}

0 commit comments

Comments
 (0)