# -*- coding: utf-8 -*-
# pylint: disable=too-many-ancestors
"""The content blocks of messages"""
from typing import Literal, Union
from typing_extensions import TypedDict, Required, Optional
[docs]
class TextBlock(TypedDict, total=False):
"""The text block."""
type: Required[Literal["text"]]
"""The type of the block"""
text: str
"""The text content"""
[docs]
class ImageBlock(TypedDict, total=False):
"""The image block"""
type: Required[Literal["image"]]
"""The type of the block"""
url: str
"""The url of the image"""
[docs]
class AudioBlock(TypedDict, total=False):
"""The audio block"""
type: Required[Literal["audio"]]
"""The type of the block"""
url: str
"""The url of the audio"""
[docs]
class VideoBlock(TypedDict, total=False):
"""The video block"""
type: Required[Literal["video"]]
"""The type of the block"""
url: str
"""The url of the video"""
[docs]
class FileBlock(TypedDict, total=False):
"""The file block"""
type: Required[Literal["file"]]
"""The type of the block"""
url: str
"""The url of the file"""
ContentBlock = Union[
ToolUseBlock,
ToolResultBlock,
TextBlock,
ImageBlock,
AudioBlock,
VideoBlock,
FileBlock,
]