mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
[BREAKING] Python: Add InvokeFunctionTool action for declarative workflows (#3716)
* add(declarative): Declarative workflow InvokeFunctionTool feature * Cleanup * Address PR feedback * Remove InvokeTool kind, consolidate to InvokeFunctionTool * Fix sample locations * pin azure-ai-projects to 2.0.0b3 due to breaking changes
This commit is contained in:
committed by
GitHub
Unverified
parent
f77f40b987
commit
40d2fac29c
@@ -2164,15 +2164,11 @@ class FunctionInvocationLayer(Generic[OptionsCoT]):
|
||||
# Error threshold reached: force a final non-tool turn so
|
||||
# function_call_output items are submitted before exit.
|
||||
mutable_options["tool_choice"] = "none"
|
||||
elif (
|
||||
max_function_calls is not None
|
||||
and total_function_calls >= max_function_calls
|
||||
):
|
||||
elif max_function_calls is not None and total_function_calls >= max_function_calls:
|
||||
# Best-effort limit: checked after each batch of parallel calls completes,
|
||||
# so the current batch always runs to completion even if it overshoots.
|
||||
logger.info(
|
||||
"Maximum function calls reached (%d/%d). "
|
||||
"Stopping further function calls for this request.",
|
||||
"Maximum function calls reached (%d/%d). Stopping further function calls for this request.",
|
||||
total_function_calls,
|
||||
max_function_calls,
|
||||
)
|
||||
@@ -2302,15 +2298,11 @@ class FunctionInvocationLayer(Generic[OptionsCoT]):
|
||||
mutable_options["tool_choice"] = "none"
|
||||
elif result["action"] != "continue":
|
||||
return
|
||||
elif (
|
||||
max_function_calls is not None
|
||||
and total_function_calls >= max_function_calls
|
||||
):
|
||||
elif max_function_calls is not None and total_function_calls >= max_function_calls:
|
||||
# Best-effort limit: checked after each batch of parallel calls completes,
|
||||
# so the current batch always runs to completion even if it overshoots.
|
||||
logger.info(
|
||||
"Maximum function calls reached (%d/%d). "
|
||||
"Stopping further function calls for this request.",
|
||||
"Maximum function calls reached (%d/%d). Stopping further function calls for this request.",
|
||||
total_function_calls,
|
||||
max_function_calls,
|
||||
)
|
||||
|
||||
@@ -34,7 +34,8 @@ dependencies = [
|
||||
# connectors and functions
|
||||
"openai>=1.99.0",
|
||||
"azure-identity>=1,<2",
|
||||
"azure-ai-projects >= 2.0.0b3",
|
||||
# Pinned to 2.0.0b3 - breaking changes in 2.0.0b4, unpin once upgrades complete
|
||||
"azure-ai-projects == 2.0.0b3",
|
||||
"mcp[ws]>=1.24.0,<2",
|
||||
"packaging>=24.1",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user