| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from typing import Union, Iterable |
| 4 |
from typing_extensions import Literal, Required, TypedDict |
| 5 |
|
| 6 |
from .content_block import ContentBlock |
| 7 |
from .text_block_param import TextBlockParam |
| 8 |
from .image_block_param import ImageBlockParam |
| 9 |
from .document_block_param import DocumentBlockParam |
| 10 |
from .thinking_block_param import ThinkingBlockParam |
| 11 |
from .tool_use_block_param import ToolUseBlockParam |
| 12 |
from .tool_result_block_param import ToolResultBlockParam |
| 13 |
from .search_result_block_param import SearchResultBlockParam |
| 14 |
from .server_tool_use_block_param import ServerToolUseBlockParam |
| 15 |
from .container_upload_block_param import ContainerUploadBlockParam |
| 16 |
from .redacted_thinking_block_param import RedactedThinkingBlockParam |
| 17 |
from .web_fetch_tool_result_block_param import WebFetchToolResultBlockParam |
| 18 |
from .web_search_tool_result_block_param import WebSearchToolResultBlockParam |
| 19 |
from .tool_search_tool_result_block_param import ToolSearchToolResultBlockParam |
| 20 |
from .code_execution_tool_result_block_param import CodeExecutionToolResultBlockParam |
| 21 |
from .bash_code_execution_tool_result_block_param import BashCodeExecutionToolResultBlockParam |
| 22 |
from .text_editor_code_execution_tool_result_block_param import TextEditorCodeExecutionToolResultBlockParam |
| 23 |
|
| 24 |
__all__ = ["MessageParam"] |
| 25 |
|
| 26 |
|
| 27 |
class MessageParam(TypedDict, total=False): |
| 28 |
content: Required[ |
| 29 |
Union[ |
| 30 |
str, |
| 31 |
Iterable[ |
| 32 |
Union[ |
| 33 |
TextBlockParam, |
| 34 |
ImageBlockParam, |
| 35 |
DocumentBlockParam, |
| 36 |
SearchResultBlockParam, |
| 37 |
ThinkingBlockParam, |
| 38 |
RedactedThinkingBlockParam, |
| 39 |
ToolUseBlockParam, |
| 40 |
ToolResultBlockParam, |
| 41 |
ServerToolUseBlockParam, |
| 42 |
WebSearchToolResultBlockParam, |
| 43 |
WebFetchToolResultBlockParam, |
| 44 |
CodeExecutionToolResultBlockParam, |
| 45 |
BashCodeExecutionToolResultBlockParam, |
| 46 |
TextEditorCodeExecutionToolResultBlockParam, |
| 47 |
ToolSearchToolResultBlockParam, |
| 48 |
ContainerUploadBlockParam, |
| 49 |
ContentBlock, |
| 50 |
] |
| 51 |
], |
| 52 |
] |
| 53 |
] |
| 54 |
|
| 55 |
role: Required[Literal["user", "assistant", "system"]] |