Update app.py
Browse filesadd pdf reader
3 unmodified lines4567895 unmodified lines151617181920212232 unmodified lines555657585960613 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolfrom Gradio_UI import GradioUI5 unmodified linesArgs:arg1: the first argumentarg2: the second argument"""return "What magic will you build ?"@tooldef get_current_time_in_timezone(timezone: str) -> str:32 unmodified linesagent = CodeAgent(model=model,tools=[final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,3 unmodified lines456789105 unmodified lines16171819202122232425262728293031323334353637383940414232 unmodified lines757677787980813 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolfrom pypdf import PdfReaderfrom Gradio_UI import GradioUI5 unmodified linesArgs:arg1: the first argumentarg2: 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:32 unmodified linesagent = CodeAgent(model=model,tools=[final_answer,read_pdf_file], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,
app.py+22-2