✅ You are viewing documentation for the latest version of Compose SDK.
Version:
# Function useGetQueryRecommendations Beta
useGetQueryRecommendations(
params
):UseGetQueryRecommendationsState
A Vue composable that fetches recommended questions for a data model or perspective.
This composable includes the same code that fetches the initial suggested questions in the chatbot.
# Parameters
Parameter | Type | Description |
---|---|---|
params | MaybeRefOrWithRefs < UseGetQueryRecommendationsParams > | UseGetQueryRecommendationsParams |
# Returns
UseGetQueryRecommendationsState
The composable load state that contains the status of the execution and recommendations result (data) with recommended question text and its corresponding widgetProps
# Example
<script setup lang="ts">
import {
useGetQueryRecommendations,
type UseGetQueryRecommendationsParams,
} from '@sisense/sdk-ui-vue/ai';
const params: UseGetQueryRecommendationsParams = {
contextTitle: 'Sample Retail',
count: 3,
};
const { data: recommendations = [] } = useGetQueryRecommendations(params);
</script>
<template>
<ul>
<li v-for="r in recommendations" :key="r.nlqPrompt">
{{ r.nlqPrompt }}
</li>
</ul>
</template>