Update app.py
#529
by otake-da - opened
3 unmodified lines456789107 unmodified lines18192021222324252627282930313233343536373839404142433 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolfrom pypdf import PdfReader
from Gradio_UI import GradioUI
7 unmodified lines arg2: the second argument """ return "What magic will you build ?" from pypdf import PdfReader
@tooldef read_pdf_file(file_path: str) -> str: """ This function reads the first three pages of a PDF file and returns its content as a string. Args: file_path: The path to the PDF file. Returns: A string containing the content of the PDF file. """ content = "" reader = PdfReader('paper.pdf') print(len(reader.pages)) pages = reader.pages[:3] for page in pages: content += page.extract_text() return content @tooldef get_current_time_in_timezone(timezone: str) -> str: """A tool that fetches the current local time in a specified timezone.app.py+20