-
Notifications
You must be signed in to change notification settings - Fork 318
Open
Labels
Description
Using latest version 0.64.0
The definition for MessageParam
content is:
content: Required[
Union[
str,
Iterable[
Union[
TextBlockParam,
ImageBlockParam,
DocumentBlockParam,
SearchResultBlockParam,
ThinkingBlockParam,
RedactedThinkingBlockParam,
ToolUseBlockParam,
ToolResultBlockParam,
ServerToolUseBlockParam,
WebSearchToolResultBlockParam,
ContentBlock,
]
],
]
]
However, the equivalent definition for BetaMessageParam
is:
content: Required[Union[str, Iterable[BetaContentBlockParam]]]
Where BetaContentBlockParam
is
BetaContentBlockParam: TypeAlias = Union[
BetaTextBlockParam,
BetaImageBlockParam,
BetaRequestDocumentBlockParam,
BetaSearchResultBlockParam,
BetaThinkingBlockParam,
BetaRedactedThinkingBlockParam,
BetaToolUseBlockParam,
BetaToolResultBlockParam,
BetaServerToolUseBlockParam,
BetaWebSearchToolResultBlockParam,
BetaCodeExecutionToolResultBlockParam,
BetaMCPToolUseBlockParam,
BetaRequestMCPToolResultBlockParam,
BetaContainerUploadBlockParam,
]
To my understanding ContentBlock
s are received as API responses and can be passed back as part of history for multi-turn conversations, so am I missing something or should BetaContentBlock
be allowed as a type for BetaMessageParam.content
?