22
33from __future__ import annotations
44
5- from typing import Union
5+ from typing import Union , Iterable
66from datetime import datetime
7- from typing_extensions import Annotated , TypedDict
7+ from typing_extensions import Literal , Annotated , TypedDict
88
99from .._types import Base64FileInput
1010from .._utils import PropertyInfo
1111from .._models import set_pydantic_config
1212
13- __all__ = ["UserInputBlockParam" , "Image" , "Text" ]
13+ __all__ = ["UserInputBlockParam" , "Image" , "Input" , "InputImage" , "InputText" , " Text" ]
1414
1515
1616class Image (TypedDict , total = False ):
1717 """
1818 ImageInput allows sending images to the agent.
19- Media type is inferred from magic bytes by the backend .
19+ Client must provide the MIME type; backend validates against magic bytes .
2020 """
2121
2222 data : Annotated [Union [str , Base64FileInput ], PropertyInfo (format = "base64" )]
23- """Raw image data (max 4MB). Supported formats: PNG, JPEG, WebP."""
23+ """Raw image data (max 4MB). Supported formats: PNG, JPEG."""
24+
25+ mime_type : Annotated [Literal ["image/png" , "image/jpeg" ], PropertyInfo (alias = "mimeType" )]
2426
2527
2628set_pydantic_config (Image , {"arbitrary_types_allowed" : True })
2729
2830
31+ class InputImage (TypedDict , total = False ):
32+ """
33+ ImageInput allows sending images to the agent.
34+ Client must provide the MIME type; backend validates against magic bytes.
35+ """
36+
37+ data : Annotated [Union [str , Base64FileInput ], PropertyInfo (format = "base64" )]
38+ """Raw image data (max 4MB). Supported formats: PNG, JPEG."""
39+
40+ mime_type : Annotated [Literal ["image/png" , "image/jpeg" ], PropertyInfo (alias = "mimeType" )]
41+
42+
43+ set_pydantic_config (InputImage , {"arbitrary_types_allowed" : True })
44+
45+
46+ class InputText (TypedDict , total = False ):
47+ content : str
48+
49+
50+ class Input (TypedDict , total = False ):
51+ image : InputImage
52+ """
53+ ImageInput allows sending images to the agent. Client must provide the MIME
54+ type; backend validates against magic bytes.
55+ """
56+
57+ text : InputText
58+
59+
2960class Text (TypedDict , total = False ):
3061 content : str
3162
@@ -38,8 +69,10 @@ class UserInputBlockParam(TypedDict, total=False):
3869
3970 image : Image
4071 """
41- ImageInput allows sending images to the agent. Media type is inferred from magic
42- bytes by the backend .
72+ ImageInput allows sending images to the agent. Client must provide the MIME
73+ type; backend validates against magic bytes .
4374 """
4475
76+ inputs : Iterable [Input ]
77+
4578 text : Text
0 commit comments