| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from typing import Union, Optional |
| 4 |
from typing_extensions import Literal, Required, TypeAlias, TypedDict |
| 5 |
|
| 6 |
from .url_pdf_source_param import URLPDFSourceParam |
| 7 |
from .citations_config_param import CitationsConfigParam |
| 8 |
from .base64_pdf_source_param import Base64PDFSourceParam |
| 9 |
from .plain_text_source_param import PlainTextSourceParam |
| 10 |
from .content_block_source_param import ContentBlockSourceParam |
| 11 |
from .file_document_source_param import FileDocumentSourceParam |
| 12 |
from .cache_control_ephemeral_param import CacheControlEphemeralParam |
| 13 |
|
| 14 |
__all__ = ["DocumentBlockParam", "Source"] |
| 15 |
|
| 16 |
Source: TypeAlias = Union[ |
| 17 |
Base64PDFSourceParam, PlainTextSourceParam, ContentBlockSourceParam, URLPDFSourceParam, FileDocumentSourceParam |
| 18 |
] |
| 19 |
|
| 20 |
|
| 21 |
class DocumentBlockParam(TypedDict, total=False): |
| 22 |
source: Required[Source] |
| 23 |
|
| 24 |
type: Required[Literal["document"]] |
| 25 |
|
| 26 |
cache_control: Optional[CacheControlEphemeralParam] |
| 27 |
"""Create a cache control breakpoint at this content block.""" |
| 28 |
|
| 29 |
citations: Optional[CitationsConfigParam] |
| 30 |
|
| 31 |
context: Optional[str] |
| 32 |
|
| 33 |
title: Optional[str] |