mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix server_tool_use input_json_delta handling and improve Anthropic samples
- Fix: Skip input_json_delta for server_tool_use content blocks in AnthropicClient streaming. Server-managed tools (e.g., skills with code interpreter) were producing Content.from_function_call(name='') entries that caused Anthropic API 400 errors on subsequent turns. - Samples: Add dotenv loading and environment variable documentation to Anthropic Claude samples (MCP, permissions, session, shell, tools, URL, skills).
This commit is contained in:
@@ -1271,8 +1271,8 @@ class RawAnthropicClient(
|
||||
)
|
||||
)
|
||||
case "input_json_delta":
|
||||
# Skip argument deltas for MCP tools — execution is handled server-side.
|
||||
if self._last_call_content_type == "mcp_tool_use":
|
||||
# Skip argument deltas for MCP and server tools — execution is handled server-side.
|
||||
if self._last_call_content_type in ("mcp_tool_use", "server_tool_use"):
|
||||
pass
|
||||
else:
|
||||
call_id = self._last_call_id_name[0] if self._last_call_id_name else ""
|
||||
|
||||
Reference in New Issue
Block a user