In Exercise #1 for the Graded Assignment in Module 3 for Agentic AI course, I am struggling to update the message with the LLM response. I get this for an error:
Failed test case: generate_research_report_with_tools raised TypeError: Object of type builtin_function_or_method is not JSON serializable.
Expected: no exception
Got: Object of type builtin_function_or_method is not JSON serializable
The tool gets called in this block of code:
try:
tool_func = TOOL_MAPPING[tool_name]
result = tool_func(**args)
except Exception as e:
result = {“error”: str(e)}
So I’m trying to pass result within the json.dump() function, but I get an error for it. I’ve testing printing the result variable and I can clearly see it’s the value I want. Not sure what I’m missing.