Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to decode tool_input as a JSON #1167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 11, 2024

  1. Attempt to decode tool_input as a JSON

    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 committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    8ad3915 View commit details
    Browse the repository at this point in the history