< Previous Challenge - Home - Next Challenge >
In this challenge, you’ll learn to use filters in Semantic Kernel. Filters allow you to intercept and observe the behavior of the kernel—such as viewing rendered prompts and monitoring function invocations. This can be a powerful tool for debugging and enhancing your AI solutions.
Your team must:
DefaultPromptFilter
to attach a filter to the kernel. This filter will let you intercept the final form of prompts before they are submitted to the Large Language Model (LLM).You may now go to the starter solution in Visual Studio and complete Challenge 2. Locate the exercises by searching for // TODO: [Challenge 2]
Open-ended exercise (recommended to be completed at the end of the hackathon):
2.3.1
: Design your own IFunctionInvocationFilter
to intercept and monitor function calls happening in the background of Semantic Kernel.DefaultPromptFilter
as a template to build your own custom prompt filters in future challenges.await next(context);
in your handlers to allow other filters to run.To complete this challenge successfully, you must:
Optional: Implement the function invocation filter and demonstrate that it captures and logs function calls.
If you want to explore further, consider these additional challenges:
DefaultPromptFilter
to capture additional metadata about the prompts.