Skip to content

Commit 5acf3f2

Browse files
committed
feat(pdf-parser): Enhance generation configuration with max output tokens
- Add max_output_tokens parameter to generation_config in _call_provider_with_retry - Update _parse_with_native_pdf_processing to include max_output_tokens in generation_config
1 parent 99ec229 commit 5acf3f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agentle/parsing/parsers/pdf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,9 @@ async def _call_provider_with_retry(
739739
file_part,
740740
developer_prompt=developer_prompt,
741741
response_schema=VisualMediaDescription,
742+
generation_config=GenerationConfig(
743+
max_output_tokens=self.max_output_tokens
744+
)
742745
),
743746
timeout=self.image_description_timeout,
744747
)
@@ -856,6 +859,7 @@ async def _parse_with_native_pdf_processing(self, document_path: str) -> ParsedF
856859
response_schema=PDFPageExtraction,
857860
generation_config=GenerationConfig(
858861
timeout_s=300.0,
862+
max_output_tokens=self.max_output_tokens
859863
),
860864
model=self.model,
861865
)

0 commit comments

Comments
 (0)