|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | 5 | from typing import Union, Optional |
6 | | -from typing_extensions import Literal, Required, Annotated, TypedDict |
| 6 | +from typing_extensions import Literal, Required, TypeAlias, TypedDict |
7 | 7 |
|
8 | | -from ..._types import Base64FileInput |
9 | | -from ..._utils import PropertyInfo |
10 | | -from ..._models import set_pydantic_config |
| 8 | +from .beta_url_image_source_param import BetaURLImageSourceParam |
| 9 | +from .beta_base64_image_source_param import BetaBase64ImageSourceParam |
11 | 10 | from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam |
12 | 11 |
|
13 | 12 | __all__ = ["BetaImageBlockParam", "Source"] |
14 | 13 |
|
15 | | - |
16 | | -class Source(TypedDict, total=False): |
17 | | - data: Required[Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")]] |
18 | | - |
19 | | - media_type: Required[Literal["image/jpeg", "image/png", "image/gif", "image/webp"]] |
20 | | - |
21 | | - type: Required[Literal["base64"]] |
22 | | - |
23 | | - |
24 | | -set_pydantic_config(Source, {"arbitrary_types_allowed": True}) |
| 14 | +Source: TypeAlias = Union[BetaBase64ImageSourceParam, BetaURLImageSourceParam] |
25 | 15 |
|
26 | 16 |
|
27 | 17 | class BetaImageBlockParam(TypedDict, total=False): |
|
0 commit comments