def sanitize(self, input_string: str) -> str:
        """
        Remove potentially harmful characters from the input string.
        
        Args:
            input_string (str): The string to sanitize.
            
        Returns:
            str: The sanitized string.
        """

        try:
            sanitized_string = self.sanitize_json(input_string)
        except json.JSONDecodeError:
            sanitized_string = self.sanitize_string(input_string)
        return sanitized_string

        Remove potentially harmful characters from the input string.
        
        Args:
            input_string (str): The string to sanitize.
            
        Returns:
            str: The sanitized string.
        
src/autogpt_plugins/api_tools/api_tools.py