❔ 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!
2 Replies