diff --git a/src/anthropic/lib/streaming/_types.py b/src/anthropic/lib/streaming/_types.py index 7399e76f4..8e4a1e404 100644 --- a/src/anthropic/lib/streaming/_types.py +++ b/src/anthropic/lib/streaming/_types.py @@ -110,7 +110,10 @@ class ContentBlockStopEvent(RawContentBlockStopEvent): class ParsedMessageStopEvent(RawMessageStopEvent, GenericModel, Generic[ResponseFormatT]): type: Literal["message_stop"] - message: ParsedMessage[ResponseFormatT] + if TYPE_CHECKING: + message: ParsedMessage[ResponseFormatT] + else: + message: ParsedMessage class ParsedContentBlockStopEvent(RawContentBlockStopEvent, GenericModel, Generic[ResponseFormatT]):