{"record":{"id":"e60d588b5ea4c214","repo":"BerriAI/litellm","slug":"vertex-ai-search-extra-body-may-not-set-target-sel","errorCode":null,"errorMessage":"Vertex AI Search extra_body may not set target-selecting fields {sorted(target_selecting)}: the data store is scoped by vector_store_id / vertex_engine_id and cannot be overridden per request.","messagePattern":"Vertex AI Search extra_body may not set target-selecting fields (.+?): the data store is scoped by vector_store_id / vertex_engine_id and cannot be overridden per request\\.","errorType":"exception","errorClass":"BadRequestError","httpStatus":400,"severity":"error","filePath":"litellm/llms/vertex_ai/vector_stores/search_api/transformation.py","lineNumber":95,"sourceCode":"    @classmethod\n    def _filter_extra_body(cls, extra_body: dict[str, Any], is_engine: bool = False) -> dict[str, Any]:\n        \"\"\"\n        Validate ``extra_body`` against the supported-field allowlist for the\n        active serving config (engine/app vs data store).\n\n        Raises ``BadRequestError`` (HTTP 400) if the caller includes a\n        target-selecting field (e.g. ``servingConfig``) or any field not\n        supported for the active mode, so the request fails loudly instead of\n        silently searching the wrong target. Engine-only fields\n        (``dataStoreSpecs``, ``numResultsPerDataStore``) are rejected in\n        data-store mode where they are meaningless.\n        \"\"\"\n        supported: Final = cls.get_supported_extra_body_fields(is_engine=is_engine)\n        filtered: Final = {key: value for key, value in extra_body.items() if value is not None}\n\n        target_selecting: Final = set(filtered) & VERTEX_SEARCH_TARGET_SELECTING_FIELDS\n        if target_selecting:\n            raise BadRequestError(\n                message=(\n                    \"Vertex AI Search extra_body may not set target-selecting fields \"\n                    f\"{sorted(target_selecting)}: the data store is scoped by \"\n                    \"vector_store_id / vertex_engine_id and cannot be overridden per request.\"\n                ),\n                model=\"vertex_ai/search_api\",\n                llm_provider=\"vertex_ai\",\n            )\n\n        unsupported: Final = set(filtered) - supported\n        if unsupported:\n            mode: Final = \"engine/app\" if is_engine else \"data store\"\n            raise BadRequestError(\n                message=(\n                    f\"Unsupported Vertex AI Search extra_body fields {sorted(unsupported)} \"\n                    f\"for {mode} mode. Supported fields: {sorted(supported)}.\"\n                ),\n                model=\"vertex_ai/search_api\",","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py#L77-L113","documentation":"Error \"Vertex AI Search extra_body may not set target-selecting fields {sorted(target_selecting)}: the data store is scoped by vector_store_id / vertex_engine_id and cannot be overridden per request.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vector_stores/search_api/transformation.py:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the target-selecting fields (e.g. data_store_id, engine_id) listed in the error from extra_body.","Set the data store scope once via vector_store_id / vertex_engine_id at configuration time instead of per request."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}