{"record":{"id":"73a2aed100e5679b","repo":"langchain-ai/langgraph","slug":"response-format-must-be-array-or-object-got","errorCode":null,"errorMessage":"response_format must be 'array' or 'object', got {response_format!r}","messagePattern":"response_format must be 'array' or 'object', got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/_async/assistants.py","lineNumber":584,"sourceCode":"            `response_format=\"object\"`).\n\n        ???+ example \"Example Usage\"\n\n            ```python\n            client = get_client(url=\"http://localhost:2024\")\n            response = await client.assistants.search(\n                metadata = {\"name\":\"my_name\"},\n                graph_id=\"my_graph_id\",\n                limit=5,\n                offset=5,\n                response_format=\"object\"\n            )\n            next_cursor = response[\"next\"]\n            assistants = response[\"assistants\"]\n            ```\n        \"\"\"\n        if response_format not in (\"array\", \"object\"):\n            raise ValueError(\n                f\"response_format must be 'array' or 'object', got {response_format!r}\"\n            )\n        payload: dict[str, Any] = {\n            \"limit\": limit,\n            \"offset\": offset,\n        }\n        if metadata:\n            payload[\"metadata\"] = metadata\n        if graph_id:\n            payload[\"graph_id\"] = graph_id\n        if name:\n            payload[\"name\"] = name\n        if sort_by:\n            payload[\"sort_by\"] = sort_by\n        if sort_order:\n            payload[\"sort_order\"] = sort_order\n        if select:\n            payload[\"select\"] = select","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/_async/assistants.py#L566-L602","documentation":"Argument guard in the async assistants.search client method: response_format must be exactly 'array' (return a plain list) or 'object' (return a dict with pagination info like next_cursor). Any other value is rejected before the HTTP request is made.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/_async/assistants.py:584 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass response_format=\"array\" or \"object\"","Omit response_format to use the default"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}