代码优化

This commit is contained in:
liuminhui 2024-07-23 10:26:31 +08:00
parent f9d3a8c521
commit 6c39c80d94
3 changed files with 2 additions and 2 deletions

View file

@ -122,6 +122,7 @@ class OmniParseClient:
OmniParsedResult: The result of the pdf parsing.
"""
self.verify_file_ext(file_input, {".pdf"})
# parse_pdf supports parsing by accepting only the byte data of the file.
file_info = await self.get_file_info(file_input, only_bytes=True)
endpoint = f"{self.parse_document_endpoint}/pdf"
resp = await self._request_parse(endpoint=endpoint, files={"file": file_info})