claude-code-sdk-python/tests
Arash Dabiri f27c4ab4c7
feat: Added base64 image handling to sdk_mcp_server tool calling (#175)
With this change claude_code_sdk tools can now also return base64
images, in addition to text, following the MCP standard.

For example:
```
import base64

@tool("make_response", "prompt", {"foo": str})
def make_response(args):

    fake_bytes = b"someimagebytes"
    encoded_image = base64.b64encode(fake_bytes).decode("utf-8")

    return {
        "content": [
            {"type": "text", "text": "Hello world!"},
            {
                "type": "image",
                 "mimeType": "image/jpeg",
                 "data": encoded_image,
            },
        ]
    }
```

The image will now be sent to Claude Code when calling the function,
allowing it to react to it.

---------

Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
2025-10-15 07:22:14 -07:00
..
conftest.py Initial Python SDK import 2025-06-12 00:16:19 -07:00
test_changelog.py Add changelog and changelog format check (#77) 2025-07-21 10:53:01 -07:00
test_client.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
test_errors.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
test_integration.py refactor: remove unnecessary node installation check (#189) 2025-09-28 15:16:40 -07:00
test_message_parser.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
test_sdk_mcp_integration.py feat: Added base64 image handling to sdk_mcp_server tool calling (#175) 2025-10-15 07:22:14 -07:00
test_streaming_client.py Fix Windows test failures due to path separator issues (#219) 2025-10-07 16:18:30 -07:00
test_subprocess_buffering.py feat: add cli_path support to ClaudeAgentOptions (#235) 2025-10-12 23:19:53 -07:00
test_tool_callbacks.py feat: add strongly-typed hook inputs with TypedDict (#240) 2025-10-10 16:22:13 -07:00
test_transport.py feat: add cli_path support to ClaudeAgentOptions (#235) 2025-10-12 23:19:53 -07:00
test_types.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00