✅ You are viewing documentation for the latest version of Compose SDK.
Version:
# Function useGetNlgInsights
useGetNlgInsights(
params
):UseGetNlgInsightsState
A Vue composable that fetches an analysis of the provided query using natural language generation (NLG).
Specifying a query is similar to providing parameters to a useExecuteQuery
composable, using dimensions, measures, and filters.
# Parameters
Parameter | Type | Description |
---|---|---|
params | MaybeRefOrWithRefs < UseGetNlgInsightsParams > | UseGetNlgInsightsParams |
# Returns
The composable load state that contains the status of the execution and a text summary result (data)
# Example
<script setup lang="ts">
import { useGetNlgInsights, type GetNlgInsightsProps } from '@sisense/sdk-ui-vue/ai';
import { measureFactory } from '@sisense/sdk-data';
import * as DM from '../assets/sample-retail-model';
const props: GetNlgInsightsProps = {
dataSource: DM.DataSource.title,
dimensions: [DM.DimProducts.CategoryName],
measures: [measureFactory.sum(DM.DimProducts.Price)],
};
const { data: nlgInsights } = useGetNlgInsights(props);
</script>
<template>
{{ nlgInsights }}
</template>