Python: Bing custom search tool content support (#12415)

### Motivation and Context

In the `azure-ai-agent` package version 1.1.0b1, they provided the
`AgentsNamedToolChoiceType.BING_CUSTOM_SEARCH` enum. Adding this to then
provide support for generating bing grounding content for
streaming/non-streaming path.

<!-- 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

- Add BING_CUSTOM_SEARCH enum to allow for content support.
- Bumps `pyproject.toml` `azure-ai-agents` min allowed version to
`1.1.0b1` which includes this new enum.

<!-- 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 😄
This commit is contained in:
Evan Mattson
2025-06-09 23:10:44 +00:00
committed by GitHub
parent 3e31c3bdc6
commit c3c8dfabc6
3 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ classifiers = [
dependencies = [
# azure agents
"azure-ai-projects >= 1.0.0b11",
"azure-ai-agents >= 1.0.0",
"azure-ai-agents >= 1.1.0b1",
"aiohttp ~= 3.8",
"cloudevents ~=1.0",
"pydantic >=2.0,!=2.10.0,!=2.10.1,!=2.10.2,!=2.10.3,<2.12",
@@ -285,7 +285,10 @@ class AgentThreadActions:
function_step=function_step,
tool_call=tool_call, # type: ignore
)
case AgentsNamedToolChoiceType.BING_GROUNDING:
case (
AgentsNamedToolChoiceType.BING_GROUNDING
| AgentsNamedToolChoiceType.BING_CUSTOM_SEARCH
):
logger.debug(
f"Entering tool_calls (bing_grounding) for run [{run.id}], agent "
f" `{agent.name}` and thread `{thread_id}`"
@@ -528,7 +531,10 @@ class AgentThreadActions:
case AgentsNamedToolChoiceType.CODE_INTERPRETER:
content = generate_streaming_code_interpreter_content(agent.name, details)
content_is_visible = True
case AgentsNamedToolChoiceType.BING_GROUNDING:
case (
AgentsNamedToolChoiceType.BING_GROUNDING
| AgentsNamedToolChoiceType.BING_CUSTOM_SEARCH
):
content = generate_streaming_bing_grounding_content(
agent_name=agent.name, step_details=details
)
+4 -4
View File
@@ -349,16 +349,16 @@ wheels = [
[[package]]
name = "azure-ai-agents"
version = "1.0.0"
version = "1.1.0b1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "azure-core", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
{ name = "isodate", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
{ name = "typing-extensions", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/fe/65/3718f646fea42cac9a6120621d5ed067d6c00476d47bf329cf80331e965e/azure_ai_agents-1.0.0.tar.gz", hash = "sha256:ccedf84bfafa59db79bb7adcfb0eb2970edc6dff58490d946bb3c0432b19b75f", size = 298143 }
sdist = { url = "https://files.pythonhosted.org/packages/c2/a1/5013d9fbc465d6e98442f86576eda8055c42369d3db99a20a48899480738/azure_ai_agents-1.1.0b1.tar.gz", hash = "sha256:43e9f1b49d813ca9da843ae7e85488cc04413c3a1f59b60a971361850265fb69", size = 302260 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/5d/6e/94aed845af9f2e6b1498cd5b43635ba6510c9260229e0700448bb24edfb0/azure_ai_agents-1.0.0-py3-none-any.whl", hash = "sha256:89a522b966380018c0f6a46ada62555a65b70d980ce9a22dee00d84efdf91f32", size = 187045 },
{ url = "https://files.pythonhosted.org/packages/39/2a/82258b6250728b17277298855db691be4b7dfcb9d15b34da89808c2a5ac7/azure_ai_agents-1.1.0b1-py3-none-any.whl", hash = "sha256:d3ee4e596cad9ab3e239a988b5f4ddccc06fcde2c6e3d91e2c8b94bfa4c71844", size = 189449 },
]
[[package]]
@@ -5655,7 +5655,7 @@ requires-dist = [
{ name = "aiortc", marker = "extra == 'realtime'", specifier = ">=1.9.0" },
{ name = "anthropic", marker = "extra == 'anthropic'", specifier = "~=0.32" },
{ name = "autogen-agentchat", marker = "extra == 'autogen'", specifier = ">=0.2,<0.4" },
{ name = "azure-ai-agents", specifier = ">=1.0.0" },
{ name = "azure-ai-agents", specifier = ">=1.1.0b1" },
{ name = "azure-ai-inference", marker = "extra == 'azure'", specifier = ">=1.0.0b6" },
{ name = "azure-ai-projects", specifier = ">=1.0.0b11" },
{ name = "azure-core-tracing-opentelemetry", marker = "extra == 'azure'", specifier = ">=1.0.0b11" },