Update app.py
#530
by otake-da - opened
3 unmodified lines456789105 unmodified lines1617181819202122232425262728293031323334353637383940414232 unmodified lines75767758787980813 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolfrom pypdf import PdfReader
from Gradio_UI import GradioUI
5 unmodified lines Args: arg1: the first argument 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:32 unmodified lines agent = CodeAgent( model=model, tools=[final_answer], ## add your tools here (don't remove final answer) 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