TextStreamWrapper
| Name | Description |
|---|---|
_wrapper | The underlying stream wrapper. |
_callback | Callback function to process stream events. |
__init__
| Name | Description |
|---|---|
wrapper | The underlying stream wrapper to delegate to. |
callback | Callback function to be called for each event. |
__iter__
| Name | Description |
|---|---|
[TextStreamWrapper](/sdk/python/references/logger/anthropic/stream_manager) | Self as the iterator. |
__next__
| Name | Description |
|---|---|
str | The text content from the event, or empty string if no text. |
StopIteration- When the stream is exhausted.
StreamWrapper
| Name | Type | Description |
|---|---|---|
_mgr | MessageStreamManager | The underlying stream manager. |
_callback | Callable | Callback function for processing events. |
_stream | MessageStream | The active stream instance. |
__init__
| Name | Type | Description |
|---|---|---|
mgr | MessageStreamManager | The underlying stream manager to wrap. |
callback | Callable[[MessageStreamEvent], None] | Callback function |
__enter__
| Name | Description |
|---|---|
MessageStream | A stream instance with callback support. |
__exit__
| Name | Description |
|---|---|
exc_type | The exception type if an exception occurred. |
exc | The exception instance if an exception occurred. |
exc_tb | The traceback if an exception occurred. |
__iter__
| Name | Description |
|---|---|
[StreamWrapper](/sdk/python/references/logger/anthropic/stream_manager) | Self as the iterator. |
__next__
| Name | Description |
|---|---|
MessageStreamEvent | The next event from the stream. |
StopIteration- When the stream is exhausted.
__getattr__
| Name | Type | Description |
|---|---|---|
name | str | The attribute name to access. |
| Name | Description |
|---|---|
Any | The attribute value from the underlying manager. |