Skip to content

Commit

Permalink
add: Async with
Browse files Browse the repository at this point in the history
  • Loading branch information
chloedia committed Nov 25, 2024
1 parent 5bc430a commit 1b91281
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def processor_metadata(self):

async def process_file_inner(self, file: QuivrFile) -> list[Document]:
logger.info(f"Uploading file {file.path} to MegaParse")
client = MegaParseNATSClient(ClientNATSConfig())
response = await client.parse_file(file=file.path)
async with MegaParseNATSClient(ClientNATSConfig()) as client:
response = await client.parse_file(file=file.path)

logger.info(f"File : {response}")
document = Document(
page_content=response,
Expand Down

0 comments on commit 1b91281

Please sign in to comment.