refactor: Restructure OCR module and centralize config
This commit is contained in:
@@ -36,6 +36,10 @@ class ImageParser(BaseParser):
|
||||
image_url = self.storage.upload_bytes(content, file_ext=ext)
|
||||
logger.info(f"Successfully uploaded image, URL: {image_url[:50]}...")
|
||||
|
||||
if not image_url:
|
||||
logger.warning(f"Failed to upload image: {self.file_name}")
|
||||
return Document(content=f"{self.file_name}", images={})
|
||||
|
||||
# Generate markdown text
|
||||
text = f""
|
||||
images = {image_url: base64.b64encode(content).decode()}
|
||||
|
||||
Reference in New Issue
Block a user