.Net: PromptRenderFilter that can inspect the prompt, and the response from the LLM? #12244
Replies: 2 comments
-
@dmytrostruk can you suggest an approach to resolve this? |
Beta Was this translation helpful? Give feedback.
-
@Daniellled thanks for your question!
Yes,
It should be possible to do it in a single class that implements We also have this example which demonstrates how to implement Semantic Caching with Filters and it's a similar scenario when you need to correlate the prompt and response: Please let us know if it helps, thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I have a PromptRenderFilter in .NET am I am able to inspect the RenderPrompt, and modify the prompt prior to it being sent to the LLM. While in the same class I would like to look at the response from the LLM and see if it matches the prompt. (or do some work on the response based on the initial prompt)
Is it possible to do that in one class? Or do I need a separate IFunctionInvocationFilter to handle reviewing the response? I thought about having a class implement both IFunctionInvocationFilter and IPromptRenderFilter but since both methods are separate with different context I would have to track which function call belongs to which prompt, so it didn't feel like a good solution.
Beta Was this translation helpful? Give feedback.
All reactions