{"record":{"id":"02f2a16e8a23eda3","repo":"mem0ai/mem0","slug":"messages-must-be-str-dict-or-list-dict-got-ty","errorCode":null,"errorMessage":"messages must be str, dict, or list[dict], got {type(messages).__name__}","messagePattern":"messages must be str, dict, or list\\[dict\\], got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/client/main.py","lineNumber":213,"sourceCode":"        Returns:\n            A dictionary containing the API response in v1.1 format.\n\n        Raises:\n            ValidationError: If the input data is invalid.\n            AuthenticationError: If authentication fails.\n            RateLimitError: If rate limits are exceeded.\n            MemoryQuotaExceededError: If memory quota is exceeded.\n            NetworkError: If network connectivity issues occur.\n            MemoryNotFoundError: If the memory doesn't exist (for updates/deletes).\n        \"\"\"\n        kwargs = {**(options.model_dump(exclude_unset=True) if options else {}), **kwargs}\n        # Handle different message input formats (align with OSS behavior)\n        if isinstance(messages, str):\n            messages = [{\"role\": \"user\", \"content\": messages}]\n        elif isinstance(messages, dict):\n            messages = [messages]\n        elif not isinstance(messages, list):\n            raise ValueError(f\"messages must be str, dict, or list[dict], got {type(messages).__name__}\")\n\n        kwargs = self._prepare_params(kwargs)\n        payload = self._prepare_payload(messages, kwargs)\n        response = self.client.post(\"/v3/memories/add/\", json=payload)\n        response.raise_for_status()\n        if \"metadata\" in kwargs:\n            del kwargs[\"metadata\"]\n        capture_client_event(\"client.add\", self, {\"keys\": list(kwargs.keys()), \"sync_type\": \"sync\"})\n        return response.json()\n\n    @api_error_handler\n    def get(self, memory_id: str) -> Dict[str, Any]:\n        \"\"\"Retrieve a specific memory by ID.\n\n        Args:\n            memory_id: The ID of the memory to retrieve.\n\n        Returns:","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/client/main.py#L195-L231","documentation":"Error \"messages must be str, dict, or list[dict], got {type(messages).__name__}\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/client/main.py:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass messages as a string, a dict like {'role':'user','content':'...'}, or a list of such dicts."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}