diff --git a/src/anthropic/lib/bedrock/_stream_decoder.py b/src/anthropic/lib/bedrock/_stream_decoder.py index 02e81a3c..4fe83d41 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() diff --git a/src/anthropic/lib/streaming/_beta_messages.py b/src/anthropic/lib/streaming/_beta_messages.py index b8f3675a..ff45204b 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 diff --git a/src/anthropic/lib/streaming/_beta_types.py b/src/anthropic/lib/streaming/_beta_types.py index 24bb710c..41a9fdf8 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'}` """ diff --git a/src/anthropic/lib/streaming/_messages.py b/src/anthropic/lib/streaming/_messages.py index 857f9734..f3335a5b 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 diff --git a/src/anthropic/lib/streaming/_types.py b/src/anthropic/lib/streaming/_types.py index 0918427a..a25f0364 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'}` """