You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When connecting a kernel to an assistant it does not seem to fire the filters. Filters work fine with normal SK agents but when using the OpenAIAssistantAgent in particular the filters never hit when added in the kernelbuilder.
To Reproduce
Steps to reproduce the behavior:
Instantiate an OpenAIAssistantAgent
pass it a kernel with filters added during build
chat with the agent
You will notice that the filters are never raised by the kernel, neither when prompt rendering or calling tools
Expected behavior
The Filters should function as they do for any other agents in SK
github-actionsbot
changed the title
Bug: .NET OpenAIAssistantAgent class IAutoFunctionInvocationFilter and IPromptRenderFilter do not work
.Net: Bug: .NET OpenAIAssistantAgent class IAutoFunctionInvocationFilter and IPromptRenderFilter do not work
Nov 13, 2024
crickman
changed the title
.Net: Bug: .NET OpenAIAssistantAgent class IAutoFunctionInvocationFilter and IPromptRenderFilter do not work
.Net - Bug: OpenAIAssistantAgent class IAutoFunctionInvocationFilter and IPromptRenderFilter do not work
Nov 13, 2024
Hi @Mano1192 - I've been able to make progress on exploring this issue.
As we've discussed out-of-band:
IFunctionInvocationFilter does currently engage as expected for each function invocation.
IPromptRenderFilter not egaged as neither the OpenAIAssistantAgent nor ChatCompletionAgent make internal use of a prompt-function. (The system instruction is rendered as a IPromptTemplate but filters only engage at the prompt-function level.) PromptFunctions that are invoked by the model as part of tool-calling will result in filter engagement.
IAutoFunctionInvocationFilter engagement is currently driven by each connector as has been overlooked / omitted when using OpenAIAssistantAgent. It does engage for ChatCompletionAgent however. I am currently working to activate this filter for OpenAIAssistantAgent.
A one note on your AutoFunctionInvocationFilter class.
Instead of context.ChatHistory.Last(), I think you can utlize context.ChatMessageContent. In the AssistantCase, ChatHistory won't be populated since querying the entire thread will add non-trivial latency.
Describe the bug
When connecting a kernel to an assistant it does not seem to fire the filters. Filters work fine with normal SK agents but when using the OpenAIAssistantAgent in particular the filters never hit when added in the kernelbuilder.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Filters should function as they do for any other agents in SK
Instantiation:
Kernel builder:
Prompt Filters:
The text was updated successfully, but these errors were encountered: