diff --git a/libs/core/langchain_core/messages/content_blocks.py b/libs/core/langchain_core/messages/content_blocks.py index 5f873e0172e..30398998b13 100644 --- a/libs/core/langchain_core/messages/content_blocks.py +++ b/libs/core/langchain_core/messages/content_blocks.py @@ -470,15 +470,15 @@ class ImageContentBlock(TypedDict): `Examples from IANA `__ """ + index: NotRequired[int] + """Index of block in aggregate response. Used during streaming.""" + url: NotRequired[str] """URL of the image.""" base64: NotRequired[str] """Data as a base64 string.""" - index: NotRequired[int] - """Index of block in aggregate response. Used during streaming.""" - # title: NotRequired[str] # """Title of the image.""" @@ -508,15 +508,15 @@ class VideoContentBlock(TypedDict): `Examples from IANA `__ """ + index: NotRequired[int] + """Index of block in aggregate response. Used during streaming.""" + url: NotRequired[str] """URL of the video.""" base64: NotRequired[str] """Data as a base64 string.""" - index: NotRequired[int] - """Index of block in aggregate response. Used during streaming.""" - # title: NotRequired[str] # """Title of the video.""" @@ -546,15 +546,15 @@ class AudioContentBlock(TypedDict): `Examples from IANA `__ """ + index: NotRequired[int] + """Index of block in aggregate response. Used during streaming.""" + url: NotRequired[str] """URL of the audio.""" base64: NotRequired[str] """Data as a base64 string.""" - index: NotRequired[int] - """Index of block in aggregate response. Used during streaming.""" - # title: NotRequired[str] # """Title of the audio.""" @@ -586,6 +586,9 @@ class PlainTextContentBlock(TypedDict): mime_type: Literal["text/plain"] """MIME type of the file. Required for base64.""" + index: NotRequired[int] + """Index of block in aggregate response. Used during streaming.""" + url: NotRequired[str] """URL of the plaintext.""" @@ -595,9 +598,6 @@ class PlainTextContentBlock(TypedDict): text: NotRequired[str] """Plaintext content. This is optional if the data is provided as base64.""" - index: NotRequired[int] - """Index of block in aggregate response. Used during streaming.""" - title: NotRequired[str] """Title of the text data, e.g., the title of a document.""" @@ -635,15 +635,15 @@ class FileContentBlock(TypedDict): `Examples from IANA `__ """ + index: NotRequired[int] + """Index of block in aggregate response. Used during streaming.""" + url: NotRequired[str] """URL of the file.""" base64: NotRequired[str] """Data as a base64 string.""" - index: NotRequired[int] - """Index of block in aggregate response. Used during streaming.""" - # title: NotRequired[str] # """Title of the file, e.g., the name of a document or file."""