File size: 1,381 Bytes
7d7d91d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7d48943
 
7d7d91d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.OpenAI;
using System.ComponentModel;

namespace FoodHealthChecker.SemanticKernel.Plugins
{
    public class FoodCheckerFilterPlugin
    {
        private readonly KernelFunction _verifyFoodRelatedImages;
        private readonly KernelFunction _verifyFoodIngredients;
        [Description("The food health checker analyze the given image and check if they are healthy or not")]
        public FoodCheckerFilterPlugin()
        {
            PromptExecutionSettings settings = new OpenAIPromptExecutionSettings()
            {
                Temperature = 0.0,
                TopP = 0.9,
                MaxTokens = 10
            };

            _verifyFoodRelatedImages = KernelFunctionFactory.CreateFromPrompt(
                FoodCheckerFilterPluginTemplates.VerifyFoodRelatedImages,
                description: "",
                executionSettings: settings);

            _verifyFoodIngredients = KernelFunctionFactory.CreateFromPrompt(
                FoodCheckerFilterPluginTemplates.VerifyFoodIngredients,
                description: "",
                executionSettings: settings);
        }


    }

    public class FoodCheckerFilterPluginTemplates
    {
        public const string VerifyFoodIngredients = @"TODO";
        public const string VerifyFoodRelatedImages = @"TODO";
    }
}