I am developing an agent with Langgraph and I would like to use a specific pdf file as a base for my agent. However, when I am defining my code as a tool I am getting an error.
I am first reading the pdf file as a string which is then passed into the tool definition.
file_path = ("./myfile.pdf")
loader = PyPDFLoader(file_path)
pages = loader.load_and_split()
val = ""
for i in range(len(pages)):
val = val +str(pages[i])
global file
file = val.strip().replace("\n", " ")
@tool
def exponentiate(file:str)->str:
"Read pdf"
return file
Error:
TypeError: ‘list’ object is not callable
What do I make incorrect here?