|
1 | 1 | // Copyright (c) Microsoft. All rights reserved.
|
2 | 2 |
|
3 |
| -using System.ComponentModel; |
4 | 3 | using System.Text;
|
5 | 4 | using Microsoft.SemanticKernel;
|
6 | 5 | using Microsoft.SemanticKernel.ChatCompletion;
|
@@ -569,82 +568,6 @@ private static Kernel CreateKernel(ITestOutputHelper? output = null)
|
569 | 568 | }, "GetWeatherForCity", "Gets the current weather for the specified city and specified date time."),
|
570 | 569 | ]);
|
571 | 570 |
|
572 |
| - kernel.Plugins.AddFromType<MenuPlugin>(); |
573 |
| - |
574 | 571 | return kernel;
|
575 | 572 | }
|
576 | 573 | }
|
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