{"record":{"id":"17f5aa3996871a69","repo":"mem0ai/mem0","slug":"model-self-config-model-in-litellm-does-not-su","errorCode":null,"errorMessage":"Model '{self.config.model}' in litellm does not support function calling.","messagePattern":"Model '(.+?)' in litellm does not support function calling\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/llms/litellm.py","lineNumber":71,"sourceCode":"        messages: List[Dict[str, str]],\n        response_format=None,\n        tools: Optional[List[Dict]] = None,\n        tool_choice: str = \"auto\",\n    ):\n        \"\"\"\n        Generate a response based on the given messages using Litellm.\n\n        Args:\n            messages (list): List of message dicts containing 'role' and 'content'.\n            response_format (str or object, optional): Format of the response. Defaults to \"text\".\n            tools (list, optional): List of tools that the model can call. Defaults to None.\n            tool_choice (str, optional): Tool choice method. Defaults to \"auto\".\n\n        Returns:\n            str: The generated response.\n        \"\"\"\n        if tools and not litellm.supports_function_calling(self.config.model):\n            raise ValueError(f\"Model '{self.config.model}' in litellm does not support function calling.\")\n\n        params = {\n            \"model\": self.config.model,\n            \"messages\": messages,\n            \"temperature\": self.config.temperature,\n            \"top_p\": self.config.top_p,\n        }\n        if self._uses_max_completion_tokens(self.config.model):\n            params[\"max_completion_tokens\"] = self.config.max_tokens\n        else:\n            params[\"max_tokens\"] = self.config.max_tokens\n        if response_format:\n            params[\"response_format\"] = response_format\n        if tools:  # TODO: Remove tools if no issues found with new memory addition logic\n            params[\"tools\"] = tools\n            params[\"tool_choice\"] = tool_choice\n\n        response = litellm.completion(**params)","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/llms/litellm.py#L53-L89","documentation":"Error \"Model '{self.config.model}' in litellm does not support function calling.\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/llms/litellm.py:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a litellm model that supports function calling, or disable tools in the request."],"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-15T17:31:12.345Z"}