© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
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 }
});
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:
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?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Conditional in semantic kernel (skprompt.txt file)
C#CC# / help
3y ago
Semantic kernel
C#CC# / help
2y ago
Semantic Kernel - Open Ai
C#CC# / help
9mo ago
How to RAG by combining Semantic Kernel Memory and Semantic Kernel?
C#CC# / help
15mo ago