From 8a1a7317d63abad8e985e1746ba8400df1cd7e85 Mon Sep 17 00:00:00 2001 From: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:09:18 +0200 Subject: [PATCH 1/5] Fix formatting of docstring --- src/anthropic/lib/bedrock/_stream_decoder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anthropic/lib/bedrock/_stream_decoder.py b/src/anthropic/lib/bedrock/_stream_decoder.py index 02e81a3ca..4fe83d414 100644 --- a/src/anthropic/lib/bedrock/_stream_decoder.py +++ b/src/anthropic/lib/bedrock/_stream_decoder.py @@ -28,7 +28,7 @@ def __init__(self) -> None: self.parser = EventStreamJSONParser() def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: - """Given an iterator that yields lines, iterate over it & yield every event encountered""" + """Given an iterator that yields lines, iterate over it & yield every event encountered.""" from botocore.eventstream import EventStreamBuffer event_stream_buffer = EventStreamBuffer() @@ -40,7 +40,7 @@ def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: yield ServerSentEvent(data=message, event="completion") async def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]: - """Given an async iterator that yields lines, iterate over it & yield every event encountered""" + """Given an async iterator that yields lines, iterate over it & yield every event encountered.""" from botocore.eventstream import EventStreamBuffer event_stream_buffer = EventStreamBuffer() From 1514cfc9b0e082858eb5384e2d4f861f3ccf34af Mon Sep 17 00:00:00 2001 From: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:11:26 +0200 Subject: [PATCH 2/5] docstring --- src/anthropic/lib/streaming/_messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anthropic/lib/streaming/_messages.py b/src/anthropic/lib/streaming/_messages.py index 857f97348..f3335a5b9 100644 --- a/src/anthropic/lib/streaming/_messages.py +++ b/src/anthropic/lib/streaming/_messages.py @@ -107,7 +107,7 @@ def get_final_text(self) -> str: return "".join(text_blocks) def until_done(self) -> None: - """Blocks until the stream has been consumed""" + """Blocks until the stream has been consumed.""" consume_sync_iterator(self) # properties @@ -246,7 +246,7 @@ async def get_final_text(self) -> str: return "".join(text_blocks) async def until_done(self) -> None: - """Waits until the stream has been consumed""" + """Waits until the stream has been consumed.""" await consume_async_iterator(self) # properties From d32436d37d6c0469ea8c2836e309b0923bad9a84 Mon Sep 17 00:00:00 2001 From: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:12:53 +0200 Subject: [PATCH 3/5] docstring --- src/anthropic/lib/streaming/_beta_messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anthropic/lib/streaming/_beta_messages.py b/src/anthropic/lib/streaming/_beta_messages.py index b8f3675a4..ff45204b3 100644 --- a/src/anthropic/lib/streaming/_beta_messages.py +++ b/src/anthropic/lib/streaming/_beta_messages.py @@ -108,7 +108,7 @@ def get_final_text(self) -> str: return "".join(text_blocks) def until_done(self) -> None: - """Blocks until the stream has been consumed""" + """Blocks until the stream has been consumed.""" consume_sync_iterator(self) # properties @@ -248,7 +248,7 @@ async def get_final_text(self) -> str: return "".join(text_blocks) async def until_done(self) -> None: - """Waits until the stream has been consumed""" + """Waits until the stream has been consumed.""" await consume_async_iterator(self) # properties From 41782c8409ad16287565c060f4b03af980c38795 Mon Sep 17 00:00:00 2001 From: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:14:34 +0200 Subject: [PATCH 4/5] docstring --- src/anthropic/lib/streaming/_types.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/anthropic/lib/streaming/_types.py b/src/anthropic/lib/streaming/_types.py index 0918427a5..a25f0364a 100644 --- a/src/anthropic/lib/streaming/_types.py +++ b/src/anthropic/lib/streaming/_types.py @@ -20,44 +20,44 @@ class TextEvent(BaseModel): type: Literal["text"] text: str - """The text delta""" + """The text delta.""" snapshot: str - """The entire accumulated text""" + """The entire accumulated text.""" class CitationEvent(BaseModel): type: Literal["citation"] citation: Citation - """The new citation""" + """The new citation.""" snapshot: List[Citation] - """All of the accumulated citations""" + """All of the accumulated citations.""" class ThinkingEvent(BaseModel): type: Literal["thinking"] thinking: str - """The thinking delta""" + """The thinking delta.""" snapshot: str - """The accumulated thinking so far""" + """The accumulated thinking so far.""" class SignatureEvent(BaseModel): type: Literal["signature"] signature: str - """The signature of the thinking block""" + """The signature of the thinking block.""" class InputJsonEvent(BaseModel): type: Literal["input_json"] partial_json: str - """A partial JSON string delta + """A partial JSON string delta. e.g. `'"San Francisco,'` """ @@ -65,7 +65,6 @@ class InputJsonEvent(BaseModel): snapshot: object """The currently accumulated parsed object. - e.g. `{'location': 'San Francisco, CA'}` """ From 4993dd68b8fc521b3b049befef1637a912cd8362 Mon Sep 17 00:00:00 2001 From: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:15:19 +0200 Subject: [PATCH 5/5] docstring --- src/anthropic/lib/streaming/_beta_types.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/anthropic/lib/streaming/_beta_types.py b/src/anthropic/lib/streaming/_beta_types.py index 24bb710c0..41a9fdf8e 100644 --- a/src/anthropic/lib/streaming/_beta_types.py +++ b/src/anthropic/lib/streaming/_beta_types.py @@ -20,44 +20,44 @@ class BetaTextEvent(BaseModel): type: Literal["text"] text: str - """The text delta""" + """The text delta.""" snapshot: str - """The entire accumulated text""" + """The entire accumulated text.""" class BetaCitationEvent(BaseModel): type: Literal["citation"] citation: Citation - """The new citation""" + """The new citation.""" snapshot: List[Citation] - """All of the accumulated citations""" + """All of the accumulated citations.""" class BetaThinkingEvent(BaseModel): type: Literal["thinking"] thinking: str - """The thinking delta""" + """The thinking delta.""" snapshot: str - """The accumulated thinking so far""" + """The accumulated thinking so far.""" class BetaSignatureEvent(BaseModel): type: Literal["signature"] signature: str - """The signature of the thinking block""" + """The signature of the thinking block.""" class BetaInputJsonEvent(BaseModel): type: Literal["input_json"] partial_json: str - """A partial JSON string delta + """A partial JSON string delta. e.g. `'"San Francisco,'` """ @@ -65,7 +65,6 @@ class BetaInputJsonEvent(BaseModel): snapshot: object """The currently accumulated parsed object. - e.g. `{'location': 'San Francisco, CA'}` """