How separate user input and systemprompt when invoking the Kernel Functions? #12733
Replies: 3 comments 1 reply
-
Hi @grafanaKibana, are you using SK .NET or Python? Ultimately, the prompt is getting configured as key-value pairs of {"role": , "message": }. In your text prompt above, it looks like the entire prompt, once rendered with the {{$input}} will be sent as a user message? Whereas in the agent example, the system instructions are configured as a If that is indeed the case, I'm confused why Azure's content filtering would be differentiating the messages between different roles... Perhaps I'm misunderstanding something. Depending upon which SK language you're using, I can help direct to some samples that can allow for the use of xml tags to specify if a portion of the prompt should be user versus system. |
Beta Was this translation helpful? Give feedback.
-
@markwallace-microsoft do you have any thoughts here? |
Beta Was this translation helpful? Give feedback.
-
@markwallace-microsoft @moonbox3 any update on this? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have several plugins with functions where the entire prompt, including input parameters, is embedded in a single template. Here’s a sanitized but representative example of one such prompt:
The issue I’m encountering is that when
$input
contains something that should trigger Azure’s content filtering, it doesn’t, presumably because the input is injected directly into this full prompt as a variable. However, when I tested an Agent-based approach where the system prompt is passed asSystemInstructions
and the user input is provided as a separateuser
message, content filtering works as expected.My question:
Is there a way to achieve a similar separation of roles/messages within
KernelFunction
to allow Azure’s content filtering to behave correctly? Or would you recommend a different approach for addressing this issue?Beta Was this translation helpful? Give feedback.
All reactions