Sometimes when i try to use the PythonRepltool in a python agent , i get an error when I run the
Agent.run() with my own input and requirement telling me an output parsing error occurred. In order to pass this error back to the agent and have it try again, pass handle_parsing_errors =True to the agentExecuter , But the strange thing is that i have the correct output beside this error.
Then i added it but i still have the same error
.
1 Like
Please clarify which lecture / lab you’re referring to.
1 Like
it’s the agents lab (the last one in langchain for llm application development course) the agent that I’ve used was the same one found in the lab which is the one for using the PythonReplTool but I was trying to run the agent with my own input which is these lines of code:
new_dict = {“task_name”: “Online meeting” , “Steps”: {“Step 1” :[“charge laptop”,“1 hour”], “Step 2” : [“bring notebook” ,“2 min”] ,“Step 3” : [“bring pen” ,’ 1 minute’ ] }}
agent.run(f"““given a dictionary, replace each duration (whether it’s
written in integer or text implying that this is a duration) with its
timedelta format then extract hours, minutes, and seconds from the
timedelta and format the result as “hh:mm:ss” so instead o the original
duration i want to see the new format “hh:mm:ss”: {new_dict}””")
1 Like
The 2 main things to consider when dealing with nested structures are:
- Describing you data structure clearly.
- Instructing the LLM on what and how to summarize.
While your data does look nice, providing a generic hint that you’re passing a dictionary might not get the expected results. Getting timings in a list will work:
1 Like