From e53659fe7dddd81153e5b8659966a7da8e368a99 Mon Sep 17 00:00:00 2001 From: lasseedfast Date: Tue, 8 Oct 2024 10:53:26 +0200 Subject: [PATCH] Refactor single_pdf.py to remove unused variables and prompt user for input --- examples/single_pdf.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/single_pdf.py b/examples/single_pdf.py index eec338d..68bb112 100644 --- a/examples/single_pdf.py +++ b/examples/single_pdf.py @@ -2,12 +2,6 @@ import asyncio import io from highlight_pdf import Highlighter -# User input/question -user_input = "What are the main findings?" - -# Answer received from LLM based on text in a PDF -llm_answer = "The main findings are that the treatment was effective in 70% of cases." - # PDF filename pdf_filename = "example_pdf_document.pdf" @@ -23,8 +17,8 @@ highlighter = Highlighter( # Define the main asynchronous function to highlight the PDF async def main(): highlighted_pdf_buffer = await highlighter.highlight( - user_input=user_input, - data=[{"text": llm_answer, "pdf_filename": pdf_filename, "pages": pages}] + user_input=input('User input: '), + pdf_filename=pdf_filename, ) # Save the highlighted PDF to a new file