{"record":{"id":"fa58cb8b84fc31f4","repo":"mem0ai/mem0","slug":"configuration-must-have-a-model-attribute","errorCode":null,"errorMessage":"Configuration must have a 'model' attribute","messagePattern":"Configuration must have a 'model' attribute","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/llms/base.py","lineNumber":36,"sourceCode":"        \"\"\"\n        if config is None:\n            self.config = BaseLlmConfig()\n        elif isinstance(config, dict):\n            # Handle dict-based configuration (backward compatibility)\n            self.config = BaseLlmConfig(**config)\n        else:\n            self.config = config\n\n        # Validate configuration\n        self._validate_config()\n\n    def _validate_config(self):\n        \"\"\"\n        Validate the configuration.\n        Override in subclasses to add provider-specific validation.\n        \"\"\"\n        if not hasattr(self.config, \"model\"):\n            raise ValueError(\"Configuration must have a 'model' attribute\")\n\n    def _is_reasoning_model(self, model: str) -> bool:\n        \"\"\"\n        Check if the model is a reasoning model or GPT-5 series that doesn't support certain parameters.\n\n        An explicit ``is_reasoning_model`` on the config takes precedence over the\n        name-based heuristic. This lets deployments with custom/versioned model\n        names (e.g. Azure ``gpt-5.4-nano-2026-03-17``) opt in or out without\n        relying on string matching. When the config value is ``None`` (default),\n        classification falls back to the name-based heuristic below.\n\n        Args:\n            model: The model name to check\n\n        Returns:\n            bool: True if the model is a reasoning model or GPT-5 series\n        \"\"\"\n        explicit = getattr(self.config, \"is_reasoning_model\", None)","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/llms/base.py#L18-L54","documentation":"Error \"Configuration must have a 'model' attribute\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/llms/base.py:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a proper config object with a 'model' attribute to the LLM constructor."],"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"}