Skip to content

Commit a45c87a

Browse files
committed
feat(file-parser): Add max_output_tokens parameter for response generation
- Introduce max_output_tokens attribute to FileParser for controlling token generation in responses - Update process_documents function to pass max_output_tokens during document parsing
1 parent 5acf3f2 commit a45c87a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agentle/parsing/parsers/file_parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ class FileParser(DocumentParser):
261261
Note: When this is enabled, most other configuration options are ignored as the AI handles all processing.
262262
"""
263263

264+
max_output_tokens: int | None = Field(default=None)
265+
"""Maximum number of tokens to generate in the response."""
266+
264267
async def parse_async(self, document_path: str) -> ParsedFile:
265268
"""
266269
Asynchronously parse a document using the appropriate parser for its file type.
@@ -378,4 +381,5 @@ async def process_documents():
378381
use_native_docx_processing=self.use_native_docx_processing,
379382
strategy=self.strategy,
380383
model=self.model,
384+
max_output_tokens=self.max_output_tokens,
381385
).parse_async(document_path=str(resolved_path))

0 commit comments

Comments
 (0)