compute.
search_ai
search_ai( workspace_id: str, question: str, deep_search: Optional[bool] = None, limit: Optional[int] = None, object_types: Optional[list[str]] = None, relevant_score_threshold: Optional[float] = None, title_to_descriptor_ratio: Optional[float] = None, ) -> SearchResult:
Search for metadata objects using similarity search.
Default values for optional parameters are documented in the AI Search endpoint of the GoodData API.
Parameters
name | type | description |
---|---|---|
workspace_id | str | The ID of the GoodData Workspace. |
question | str | The question to ask the AI. |
deep_search | Optional[bool] | turn on deep search - if true, content of complex objects will be searched as well |
limit | Optional[int] | maximum number of results to return. Defaults to None. |
object_types | Optional[list[str]] | list of object types to search for. Enum items: "attribute", "metric", "fact", "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. |
Returns
type | description | |
---|---|---|
search_result | SearchResult | SearchResult: Search results |
Example
host = "https://www.example.com"
token = "<your_personal_access_token>"
sdk = GoodDataSdk.create(host, token)
chat_result = sdk.compute.ai_chat(workspace_id, "Display the revenue by product")
print(chat_result)