crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Attempt to decode tool_input as a JSON

Open meetwudi opened this issue 1 year ago • 2 comments

We currently evaluate tool_input as a Python object. However, self._validate_tool_input may return a JSON string instead. This causes an error when tool_input contains lowercase true/false, which are valid JSON values but not valid Python (True/False).

As a result, the agent could enter an infinite loop if tool_input keeps resolving to a JSON string like:

{"timeMin": "2024-08-12T00:00:00Z", "timeMax": "2024-08-13T00:00:00Z", "single_events": true, "order_by": "startTime", "calendar_id": "primary"}

This commit addresses the issue by ensuring that tool_input is correctly parsed as JSON when necessary, preventing the infinite loop.

meetwudi avatar Aug 11 '24 21:08 meetwudi

This PR is stale because it has been open for 45 days with no activity.

github-actions[bot] avatar Oct 04 '24 12:10 github-actions[bot]

Hey @meetwudi! Could you take a look to see if this still applies? If there are any conflicts, it would be great if you could help resolve them. Also, if you could provide a use case for testing, that would be super helpful. Thanks.

pythonbyte avatar Dec 09 '24 14:12 pythonbyte