-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Python: Azure AI Agent fails to emit intermediate messages for integrated tools (Code Interpreter/Bing) #11847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @rutzsco, thanks for filing. #11850 has the fixes for these issues. Please do read through the PR description and let me know if you have any questions. One note as I called out in the PR description: the For the Bing tool, this was a complete gap. I added support for it, with the caveat that the streaming case isn't currently returning the |
…unding for AzureAIAgent (#11850) ### Motivation and Context The AzureAIAgent streaming event path for handling streaming code output as well as both streaming and non-streaming Bing Grounding tool calls were missing in the current implementation. This PR adds handling for those two scenarios. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Updates to allow for proper handling of streaming code using the AzureAIAgent - code_interpreter: note that the code interpreter tool call is handled as returning `StreamingTextContent` with the `metadata` dict configured with `{"code": True}`. - bing_grounding: support for the Bing Grounding Tool is added. There is a current issue with streaming events and the Bing Grounding tool - the `requesturl` as part of the tool call is coming back empty. This issue has been raised with the appropriate team. Both streaming and non-streaming do properly return the `StreamingAnnotationContent` or `AnnotationContent` respectively. - Samples were added to show interaction with the AzureAIAgent and these tools, some also showing how to use the `on_intermediate_message` callback. - Fixes #11847 <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
For Azure AI Agents with integrated tools enabled (specifically Code Interpreter and Bing Grounding), the intermediate message callback is not being invoked to indicate when a tool call starts and completes. Without this capability, a Chat UI cannot show users the real-time steps taken to fulfill their requests.
To reproduce
Expected behavior
As described in the documentation, the callback function should fire for each integrated tool call in the Azure AI Agent Service:
https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-streaming?pivots=programming-language-python#handling-intermediate-messages-with-a-streaming-response
Platform
Additional Information
While debugging I could see events coming back from the AI Agent Service but not handled in agent_thread_actions.py:
semantic-kernel/python/semantic_kernel/agents/azure_ai/agent_thread_actions.py
Line 425 in 97c2524
The text was updated successfully, but these errors were encountered: