Skip to content

Commit d1b532c

Browse files
Auto Implclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 4dc3f87 commit d1b532c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/gooddata-sdk/src/gooddata_sdk/compute/service.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def search_ai(
280280
object_types: list[str] | None = None,
281281
relevant_score_threshold: float | None = None,
282282
title_to_descriptor_ratio: float | None = None,
283+
enable_hybrid_search: bool | None = None,
283284
) -> SearchResult:
284285
"""
285286
Search for metadata objects using similarity search.
@@ -293,6 +294,8 @@ def search_ai(
293294
"label", "date", "dataset", "visualization" and "dashboard". Defaults to None.
294295
relevant_score_threshold (Optional[float]): minimum relevance score threshold for results. Defaults to None.
295296
title_to_descriptor_ratio (Optional[float]): ratio of title score to descriptor score. Defaults to None.
297+
enable_hybrid_search (Optional[bool]): enable hybrid search combining vector similarity and keyword matching
298+
using RRF fusion. Defaults to None (server default: False).
296299
297300
Returns:
298301
SearchResult: Search results
@@ -311,6 +314,8 @@ def search_ai(
311314
search_params["relevant_score_threshold"] = relevant_score_threshold
312315
if title_to_descriptor_ratio is not None:
313316
search_params["title_to_descriptor_ratio"] = title_to_descriptor_ratio
317+
if enable_hybrid_search is not None:
318+
search_params["enable_hybrid_search"] = enable_hybrid_search
314319
search_request = SearchRequest(question=question, **search_params)
315320
response = self._actions_api.ai_search(workspace_id, search_request, _check_return_type=False)
316321
return response

packages/gooddata-sdk/tests/compute/test_compute_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_search_ai_full_params(test_config):
7777
object_types=["metric", "attribute", "fact"],
7878
relevant_score_threshold=0.5,
7979
title_to_descriptor_ratio=0.7,
80+
enable_hybrid_search=True,
8081
)
8182

8283
# Verify the results

0 commit comments

Comments
 (0)