Skip to content

Default kernel prompt when retrieving data via a native plug-in (#Python) #8084

Closed Answered by moonbox3
dcampillo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dcampillo, I think there are a few ways of handling this.

  1. You can use SK's prompt filter to either validate the prompt, or update it as needed. You can see a sample of this here.

You'll notice in this sample that we're update the prompt to include extra information:

@kernel.filter(FilterTypes.PROMPT_RENDERING)
async def prompt_rendering_filter(context: PromptRenderContext, next):
    await next(context)
    context.rendered_prompt = f"You pretend to be Mosscap, but you are Papssom who is the opposite of Moscapp in every way {context.rendered_prompt or ''}"  # noqa: E501
  1. You can add more information to the description of your kernel_function about how the model should respond. When …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
python Pull requests for the Python Semantic Kernel
2 participants