Home / Function/ __stream_text__() — anthropic-sdk-python Function Reference

__stream_text__() — anthropic-sdk-python Function Reference

Architecture documentation for the __stream_text__() function in _messages.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  8964e1e1_2c00_18de_9e3a_1af7f134ab20["__stream_text__()"]
  e621e870_ca7f_408e_c8bb_3d408ede66a4["MessageStream"]
  8964e1e1_2c00_18de_9e3a_1af7f134ab20 -->|defined in| e621e870_ca7f_408e_c8bb_3d408ede66a4
  style 8964e1e1_2c00_18de_9e3a_1af7f134ab20 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/streaming/_messages.py lines 140–143

    def __stream_text__(self) -> Iterator[str]:
        for chunk in self:
            if chunk.type == "content_block_delta" and chunk.delta.type == "text_delta":
                yield chunk.delta.text

Subdomains

Frequently Asked Questions

What does __stream_text__() do?
__stream_text__() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/streaming/_messages.py.
Where is __stream_text__() defined?
__stream_text__() is defined in src/anthropic/lib/streaming/_messages.py at line 140.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free