{"record":{"id":"6cd2499e36a1d4a1","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-6cd249","errorCode":null,"errorMessage":"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}","messagePattern":"Extra fields not allowed: (.+?)\\. Please input only the following fields: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/configs/vector_stores/turbopuffer.py","lineNumber":39,"sourceCode":"\n    @model_validator(mode=\"before\")\n    @classmethod\n    def check_api_key(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n        api_key = values.get(\"api_key\")\n        if not api_key and \"TURBOPUFFER_API_KEY\" not in os.environ:\n            raise ValueError(\n                \"Either 'api_key' must be provided or TURBOPUFFER_API_KEY environment variable must be set.\"\n            )\n        return values\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n        allowed_fields = set(cls.model_fields.keys())\n        input_fields = set(values.keys())\n        extra_fields = input_fields - allowed_fields\n        if extra_fields:\n            raise ValueError(\n                f\"Extra fields not allowed: {', '.join(extra_fields)}. \"\n                f\"Please input only the following fields: {', '.join(allowed_fields)}\"\n            )\n        return values\n\n    model_config = ConfigDict(arbitrary_types_allowed=True)\n","sourceCodeStart":21,"sourceCodeEnd":46,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/turbopuffer.py#L21-L46","documentation":"TurbopufferConfig enforces a closed field set via a `before` model_validator: only the declared Turbopuffer fields (api_key, region, collection_name, embedding_model_dims, distance_metric, batch_size, extra_params, and similar) may appear in the config dict. Any other key raises this error with the offending and allowed key lists in the message.","triggerScenarios":"Passing keys like namespace, api_key_id, or provider-level keys (e.g. 'provider' nested inside 'config'); copying a config template from another vector store; misspelling an allowed field (e.g. 'batchsize' instead of 'batch_size').","commonSituations":"TurboPuffer docs calling collections 'namespaces' and the config using that word; passing provider tunables that belong in extra_params as top-level keys; stale field names from an older mem0 version.","solutions":["Remove the extra keys named in the message; keep only the allowed fields listed","Move arbitrary Turbopuffer client tunables into extra_params={'...': ...} which exists for that purpose","Fix misspellings against the allowed list in the error text"],"exampleFix":"# before\nconfig = {\"api_key\": \"tpuf_...\", \"namespace\": \"mem0\", \"retries\": 3}\n\n# after\nconfig = {\"api_key\": \"tpuf_...\", \"collection_name\": \"mem0\", \"extra_params\": {\"retries\": 3}}","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.turbopuffer import TurbopufferConfig\nextra = set(cfg) - set(TurbopufferConfig.model_fields)\nif extra:\n    raise ConfigError(f\"move/remove unknown keys: {sorted(extra)}; tunables go in extra_params\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Route arbitrary client options through extra_params","Use the error's allowed-fields list as the source of truth when writing the config"],"tags":["pydantic","turbopuffer","vector-store","config","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}