{"record":{"id":"eef4ff5ca938c735","repo":"BerriAI/litellm","slug":"vector-store-id-is-required-when-vertex-engine-id","errorCode":null,"errorMessage":"vector_store_id is required when vertex_engine_id is not set","messagePattern":"vector_store_id is required when vertex_engine_id is not set","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vector_stores/search_api/transformation.py","lineNumber":187,"sourceCode":"\n        vertex_location: Final = self.get_vertex_ai_location(litellm_params)\n        vertex_project: Final = self.get_vertex_ai_project(litellm_params)\n        collection_id: Final = litellm_params.get(\"vertex_collection_id\") or \"default_collection\"\n        encoded_collection_id: Final = encode_url_path_segment(collection_id, field_name=\"vertex_collection_id\")\n        base: Final = (\n            f\"https://discoveryengine.googleapis.com/v1/\"\n            f\"projects/{vertex_project}/locations/{vertex_location}/\"\n            f\"collections/{encoded_collection_id}\"\n        )\n\n        engine_id: Final = litellm_params.get(\"vertex_engine_id\")\n        if engine_id:\n            encoded_engine_id: Final = encode_url_path_segment(engine_id, field_name=\"vertex_engine_id\")\n            return f\"{base}/engines/{encoded_engine_id}/servingConfigs/default_serving_config\"\n\n        datastore_id: Final = litellm_params.get(\"vector_store_id\")\n        if not datastore_id:\n            raise ValueError(\"vector_store_id is required when vertex_engine_id is not set\")\n        encoded_datastore_id: Final = encode_url_path_segment(datastore_id, field_name=\"vector_store_id\")\n        return f\"{base}/dataStores/{encoded_datastore_id}/servingConfigs/default_config\"\n\n    def transform_search_vector_store_request(\n        self,\n        vector_store_id: str,\n        query: str | list[str],\n        vector_store_search_optional_params: VectorStoreSearchOptionalRequestParams,\n        api_base: str,\n        litellm_logging_obj: LiteLLMLoggingObj,\n        litellm_params: dict,\n        extra_body: dict[str, Any] | None = None,\n    ) -> tuple[str, dict[str, Any]]:\n        \"\"\"\n        Transform a search request for the Vertex AI Search (Discovery Engine) API.\n\n        Per-request params pass through to the engine: max_num_results maps to\n        pageSize, and extra_body fields on the supported allowlist","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py#L169-L205","documentation":"Raised while building the Vertex AI Search (discoveryengine) URL: neither vertex_engine_id nor vector_store_id was supplied, so there is no data-store/engine path segment to encode. The request builder cannot construct a valid endpoint without one of them.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vector_stores/search_api/transformation.py:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass vector_store_id (the Vertex AI Search data store ID) in the request or configuration.","Alternatively set vertex_engine_id if you intend to search an engine instead of a single data store."],"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-14T05:17:10.506Z"}