C#C
C#2y ago
TJacken

MathPlugin in skprompt.txt file [Semantic kernel]

What is proper way to set params in skprompt.txt file to call MathPlugin.Add function:

Console.WriteLine("Enter numbers: ");

var input1 = Console.ReadLine();
var input2 = Console.ReadLine();

var result = await kernel.InvokeAsync(prompts["math"], new() 
{
    { "input1", input1 },
    { "input2", input2 }
});


skprompt.txt file:

Get me the sum of passed numbers:

{{ MathPlugin.Add value=$input1 amount=$input2 }}

Assistant:


I got this answer when I enter 1 and 5 for example:

You've only provided one number, which is 6. In order to calculate a sum, I'll need at least two numbers. Can you provide another number?
Was this page helpful?