© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Ricegun

❔ Conditional in semantic kernel (skprompt.txt file)

Hey guys,
I currently using semantic kernel to do stuff related with AI in my console app.

In semantic kernel, we can use parameter that will be replaced and become part of the prompt, for example (this is skprompt.txt looks like):
------------------------------------------------
We have list of animals below:
{{$animals}}
We have list of plants below:
{{$plants}}

Please explain about it in 2 paragraphs.
------------------------------------------------

For some reason, if the animals parameter is empty, or if plants is empty, i want to remove it from skprompt.txt.

So, if i only have animals value, but the plants are empty, i want skprompt.txt automatically become like this:
------------------------------------------------
We have list of animals below:
{{$animals}}

Please explain about it in 2 paragraphs.
------------------------------------------------

Is it possible to implement it using semantic kernel? I want to do this, so I don't need to create many skprompt.txt file for each condition.

Thanks!
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

MathPlugin in skprompt.txt file [Semantic kernel]
C#CC# / help
2y 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