mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
665aacf1ad
This commit fixes three issues in the security_filter_middleware: 1. Missing context.terminate flag - Without this, middleware continues processing after setting blocked response 2. No streaming support - When context.is_streaming is True, middleware now returns async generator with ChatResponseUpdate 3. Checks all messages - Changed to check only context.messages[-1] (most recent user message) instead of iterating through conversation history Changes: - Added AsyncIterable import - Added ChatResponseUpdate and TextContent imports - Modified security_filter_middleware to handle both streaming and non-streaming modes - Added context.terminate = True to properly stop execution - Changed message checking logic to only inspect the last user message Co-authored-by: Victor Dibia <chuvidi2003@gmail.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
665aacf1ad
·
2025-11-13 04:20:44 +00:00
History