Skip to content

Conversation

@moonbox3
Copy link
Collaborator

@moonbox3 moonbox3 commented May 2, 2025

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.

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 Python: Azure AI Agent fails to emit intermediate messages for integrated tools (Code Interpreter/Bing) #11847

Contribution Checklist

@moonbox3 moonbox3 self-assigned this May 2, 2025
@moonbox3 moonbox3 requested a review from a team as a code owner May 2, 2025 04:33
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel documentation labels May 2, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented May 2, 2025

Python Unit Test Overview

Tests Skipped Failures Errors Time
3467 5 💤 0 ❌ 0 🔥 2m 5s ⏱️

@TaoChenOSU TaoChenOSU added this pull request to the merge queue May 6, 2025
Merged via the queue into microsoft:main with commit d266ac5 May 6, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel May 6, 2025
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
…unding for AzureAIAgent (microsoft#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 microsoft#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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents documentation python Pull requests for the Python Semantic Kernel

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Python: Azure AI Agent fails to emit intermediate messages for integrated tools (Code Interpreter/Bing)

4 participants