From d1b532ca6debed9404f6dadf86364235fd87baa3 Mon Sep 17 00:00:00 2001 From: Auto Impl Date: Tue, 17 Mar 2026 13:07:54 +0000 Subject: [PATCH] feat(gooddata-sdk): [AUTO] add enable_hybrid_search param to search_ai() Expose the `enable_hybrid_search` boolean parameter in the `search_ai()` wrapper method so SDK users can opt into hybrid search (vector + keyword RRF fusion). The underlying SearchRequest API model already supports the field after the GDAI-1349 regeneration; only the wrapper signature and test call were missing. Co-Authored-By: Claude Sonnet 4.6 --- packages/gooddata-sdk/src/gooddata_sdk/compute/service.py | 5 +++++ packages/gooddata-sdk/tests/compute/test_compute_service.py | 1 + 2 files changed, 6 insertions(+) diff --git a/packages/gooddata-sdk/src/gooddata_sdk/compute/service.py b/packages/gooddata-sdk/src/gooddata_sdk/compute/service.py index 6163798b9..9bc92f690 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/compute/service.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/compute/service.py @@ -280,6 +280,7 @@ def search_ai( object_types: list[str] | None = None, relevant_score_threshold: float | None = None, title_to_descriptor_ratio: float | None = None, + enable_hybrid_search: bool | None = None, ) -> SearchResult: """ Search for metadata objects using similarity search. @@ -293,6 +294,8 @@ def search_ai( "label", "date", "dataset", "visualization" and "dashboard". Defaults to None. relevant_score_threshold (Optional[float]): minimum relevance score threshold for results. Defaults to None. title_to_descriptor_ratio (Optional[float]): ratio of title score to descriptor score. Defaults to None. + enable_hybrid_search (Optional[bool]): enable hybrid search combining vector similarity and keyword matching + using RRF fusion. Defaults to None (server default: False). Returns: SearchResult: Search results @@ -311,6 +314,8 @@ def search_ai( search_params["relevant_score_threshold"] = relevant_score_threshold if title_to_descriptor_ratio is not None: search_params["title_to_descriptor_ratio"] = title_to_descriptor_ratio + if enable_hybrid_search is not None: + search_params["enable_hybrid_search"] = enable_hybrid_search search_request = SearchRequest(question=question, **search_params) response = self._actions_api.ai_search(workspace_id, search_request, _check_return_type=False) return response diff --git a/packages/gooddata-sdk/tests/compute/test_compute_service.py b/packages/gooddata-sdk/tests/compute/test_compute_service.py index f91dfa29a..35b7f58c4 100644 --- a/packages/gooddata-sdk/tests/compute/test_compute_service.py +++ b/packages/gooddata-sdk/tests/compute/test_compute_service.py @@ -77,6 +77,7 @@ def test_search_ai_full_params(test_config): object_types=["metric", "attribute", "fact"], relevant_score_threshold=0.5, title_to_descriptor_ratio=0.7, + enable_hybrid_search=True, ) # Verify the results