Skip to content

Commit

Permalink
feat: async load (#71)
Browse files Browse the repository at this point in the history
* async load

* feat: converter kwargs
  • Loading branch information
AmineDiro committed Jul 30, 2024
1 parent a4b5572 commit fbc3e1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions megaparse/Converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def __init__(
self.llama_parse_api_key = llama_parse_api_key
self.strategy = strategy

async def aload(self, **kwargs) -> LangChainDocument:
async def aload(self, **convert_kwargs) -> LangChainDocument:
file_extension: str = os.path.splitext(self.file_path)[1]
if file_extension == ".docx":
converter = DOCXConverter()
Expand All @@ -372,7 +372,7 @@ async def aload(self, **kwargs) -> LangChainDocument:
else:
raise ValueError(f"Unsupported file extension: {file_extension}")

return await converter.convert(self.file_path, **kwargs)
return await converter.convert(self.file_path, **convert_kwargs)

def load(self, **kwargs) -> LangChainDocument:
file_extension: str = os.path.splitext(self.file_path)[1]
Expand Down

0 comments on commit fbc3e1b

Please sign in to comment.