Skip to content

docs: add docstrings to MessageStream and AsyncMessageStream#1321

Open
mastash3ff wants to merge 1 commit intoanthropics:mainfrom
mastash3ff:docs/add-messagestream-docstrings
Open

docs: add docstrings to MessageStream and AsyncMessageStream#1321
mastash3ff wants to merge 1 commit intoanthropics:mainfrom
mastash3ff:docs/add-messagestream-docstrings

Conversation

@mastash3ff
Copy link
Copy Markdown

Summary

MessageStream and AsyncMessageStream are public classes exported from
anthropic.lib.streaming and used directly by callers of the streaming API.
Both classes were missing class-level docstrings, and three properties on each
(response, request_id, current_message_snapshot) had no documentation.

Changes

  • Added class docstring to MessageStream describing usage as a context manager and available helpers
  • Added class docstring to AsyncMessageStream (async counterpart)
  • Added property docstrings for response, request_id, and current_message_snapshot on both classes
  • current_message_snapshot docstring notes the AssertionError raised if accessed before iteration starts

MessageStream and AsyncMessageStream are public classes used by callers
of the streaming API, but their class-level docstrings and several
property docstrings (response, request_id, current_message_snapshot)
were missing.  Add them so the classes are self-documenting in IDEs
and generated API references.
@mastash3ff mastash3ff requested a review from a team as a code owner April 1, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant