mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
|
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test-e2e (3.13) (push) Blocked by required conditions
Test / test-examples (3.11) (push) Blocked by required conditions
Test / test-examples (3.12) (push) Blocked by required conditions
Test / test-examples (3.13) (push) Blocked by required conditions
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
Test / test-e2e (3.10) (push) Blocked by required conditions
Test / test-e2e (3.11) (push) Blocked by required conditions
Test / test-e2e (3.12) (push) Blocked by required conditions
Test / test-examples (3.10) (push) Blocked by required conditions
## Summary - Adds support for streaming partial messages through the `include_partial_messages` option - Introduces `StreamEvent` message type to handle Anthropic API stream events - Enables real-time streaming of Claude's responses for building interactive UIs ## Changes - Added `StreamEvent` dataclass with proper structure matching TypeScript SDK (uuid, session_id, event, parent_tool_use_id) - Added `include_partial_messages` boolean option to `ClaudeCodeOptions` - Updated message parser to handle `stream_event` message type - Updated subprocess CLI transport to pass `--include-partial-messages` flag when enabled - Added example demonstrating partial message streaming usage ## Test plan - [x] Verified CLI flag is passed correctly when `include_partial_messages=True` - [x] Confirmed `StreamEvent` structure matches TypeScript SDK implementation - [x] Added test for user parameter in transport - [x] Example runs successfully with streaming events 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| hooks.py | ||
| include_partial_messages.py | ||
| mcp_calculator.py | ||
| quick_start.py | ||
| streaming_mode.py | ||
| streaming_mode_ipython.py | ||
| streaming_mode_trio.py | ||
| tool_permission_callback.py | ||