aidputils.agents.tools.http.parsers.json_parser

JSON response parser.

Handles parsing of JSON responses with auto-detection and malformed JSON handling.

class aidputils.agents.tools.http.parsers.json_parser.JsonResponseParser[source]

Bases: ResponseParser

Parser for JSON responses.

classmethod content_types() List[str][source]

Return content-types this parser handles.

parse(raw_data: Any, headers: Dict[str, str]) Any[source]

Parse JSON response data.

Parameters:
  • raw_data – Raw response data (dict, list, or string)

  • headers – Response headers

Returns:

Parsed JSON data (dict or list)

get_response_type() str[source]

Return response type identifier.