mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Strip tools from FoundryAgent request when agent_reference is present (#5101)
_prepare_options() now removes tools, tool_choice, and parallel_tool_calls from run_options after injecting agent_reference. The Foundry API rejects requests containing both fields. FunctionTools are still invoked client-side by the function invocation layer. Fixes #5087 Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
e10d448ae2
commit
18d1ba3624
@@ -293,6 +293,13 @@ class RawFoundryAgentChatClient( # type: ignore[misc]
|
||||
# Inject agent reference
|
||||
run_options["extra_body"] = {"agent_reference": self._get_agent_reference()}
|
||||
|
||||
# Strip tools from request body - Foundry API rejects requests with both
|
||||
# agent_reference and tools present. FunctionTools are invoked client-side
|
||||
# by the function invocation layer, not sent to the service.
|
||||
run_options.pop("tools", None)
|
||||
run_options.pop("tool_choice", None)
|
||||
run_options.pop("parallel_tool_calls", None)
|
||||
|
||||
return run_options
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user