Add PDF Parser Block (#1600)

This commit is contained in:
Shuchang Zheng 2025-01-20 12:33:54 -08:00 committed by GitHub
parent 8f3941b6b5
commit 1796af6df9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 143 additions and 2 deletions

View file

@ -215,6 +215,13 @@ class FileParserBlockYAML(BlockYAML):
file_type: FileType
class PDFParserBlockYAML(BlockYAML):
block_type: Literal[BlockType.PDF_PARSER] = BlockType.PDF_PARSER # type: ignore
file_url: str
json_schema: dict[str, Any] | None = None
class ValidationBlockYAML(BlockYAML):
block_type: Literal[BlockType.VALIDATION] = BlockType.VALIDATION # type: ignore
@ -343,6 +350,7 @@ BLOCK_YAML_SUBCLASSES = (
| WaitBlockYAML
| FileDownloadBlockYAML
| UrlBlockYAML
| PDFParserBlockYAML
)
BLOCK_YAML_TYPES = Annotated[BLOCK_YAML_SUBCLASSES, Field(discriminator="block_type")]