Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SummarizeImages to Aryn SDK #1189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/aryn-sdk/aryn_sdk/partition/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def partition_file(
threshold: Optional[Union[float, Literal["auto"]]] = None,
use_ocr: bool = False,
ocr_images: bool = False,
summarize_images: bool = False,
ocr_language: Optional[str] = None,
extract_table_structure: bool = False,
table_extraction_options: dict[str, Any] = {},
Expand Down Expand Up @@ -82,6 +83,7 @@ def partition_file(
default: False
ocr_images: attempt to use OCR to generate a text representation of detected images.
default: False
summarize_images: Generate a text summary of detected images using a VLM.
ocr_language: specify the language to use for OCR. If not set, the language will be english.
default: English
extract_table_structure: extract tables and their structural content.
Expand Down Expand Up @@ -157,6 +159,7 @@ def partition_file(
threshold=threshold,
use_ocr=use_ocr,
ocr_images=ocr_images,
summarize_images=summarize_images,
ocr_language=ocr_language,
extract_table_structure=extract_table_structure,
table_extraction_options=table_extraction_options,
Expand All @@ -180,6 +183,7 @@ def _partition_file_wrapper(
threshold: Optional[Union[float, Literal["auto"]]] = None,
use_ocr: bool = False,
ocr_images: bool = False,
summarize_images: bool = False,
ocr_language: Optional[str] = None,
extract_table_structure: bool = False,
table_extraction_options: dict[str, Any] = {},
Expand Down Expand Up @@ -209,6 +213,7 @@ def _partition_file_wrapper(
threshold=threshold,
use_ocr=use_ocr,
ocr_images=ocr_images,
summarize_images=summarize_images,
ocr_language=ocr_language,
extract_table_structure=extract_table_structure,
table_extraction_options=table_extraction_options,
Expand Down Expand Up @@ -236,6 +241,7 @@ def _partition_file_inner(
threshold: Optional[Union[float, Literal["auto"]]] = None,
use_ocr: bool = False,
ocr_images: bool = False,
summarize_images: bool = False,
ocr_language: Optional[str] = None,
extract_table_structure: bool = False,
table_extraction_options: dict[str, Any] = {},
Expand Down Expand Up @@ -269,6 +275,7 @@ def _partition_file_inner(
threshold=threshold,
use_ocr=use_ocr,
ocr_images=ocr_images,
summarize_images=summarize_images,
ocr_language=ocr_language,
extract_table_structure=extract_table_structure,
table_extraction_options=table_extraction_options,
Expand Down Expand Up @@ -376,6 +383,7 @@ def _json_options(
threshold: Optional[Union[float, Literal["auto"]]] = None,
use_ocr: bool = False,
ocr_images: bool = False,
summarize_images: bool = False,
ocr_language: Optional[str] = None,
extract_table_structure: bool = False,
table_extraction_options: dict[str, Any] = {},
Expand All @@ -393,6 +401,8 @@ def _json_options(
options["use_ocr"] = use_ocr
if ocr_images:
options["ocr_images"] = ocr_images
if summarize_images:
options["summarize_images"] = summarize_images
if ocr_language:
options["ocr_language"] = ocr_language
if extract_images:
Expand Down Expand Up @@ -423,6 +433,7 @@ def partition_file_async_submit(
threshold: Optional[Union[float, Literal["auto"]]] = None,
use_ocr: bool = False,
ocr_images: bool = False,
summarize_images: bool = False,
ocr_language: Optional[str] = None,
extract_table_structure: bool = False,
table_extraction_options: dict[str, Any] = {},
Expand Down Expand Up @@ -479,6 +490,7 @@ def partition_file_async_submit(
threshold=threshold,
use_ocr=use_ocr,
ocr_images=ocr_images,
summarize_images=summarize_images,
ocr_language=ocr_language,
extract_table_structure=extract_table_structure,
table_extraction_options=table_extraction_options,
Expand Down
Loading