Method: projects.locations.authorizedViewSets.authorizedViews.generativeInsights

Natural language based Insights which powers the next generation of dashboards in Insights. Next generation of authorizedViews.queryMetrics.

HTTP request

POST https://{endpoint}/v1/{location=projects/*/locations/*/authorizedViewSets/*/authorizedViews/*}:generativeInsights

Where {endpoint} is one of the supported service endpoints.

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
location

string

Required. The location of the data. "projects/{project}/locations/{location}"

Request body

The request body contains data with the following structure:

JSON representation
{
  "naturalLanguageQuery": string,
  "chart": string,
  "filter": string,
  "comparisonFilter": string,
  "sqlQuery": string,
  "sqlComparisonKey": string,
  "sessionId": string,
  "revisionId": string,
  "userProvidedChartSpec": {
    object
  },
  "timeZone": string
}
Fields
naturalLanguageQuery

string

The natural language query specified by the user. If this field is specified, sqlQuery will be ignored.

chart

string

The full name of the chart resource this request corresponds to. Format: projects/{project}/locations/{location}/dashboards/{dashboard}/charts/{chart}

filter

string

Filter for the data that can be specified in addition to the natural language query. Users are encouraged to use this field to populate time-windows.

comparisonFilter

string

Optional. Filter for the data that can be specified in addition to the natural language query. This filter is specifically used for charts where comparisons are possible. For example, "compare to last month" or "compare to previous quarter".

sqlQuery

string

Optional. The SQL query specified by the user. This query must be in BigQuery SQL dialect. The filter field will also be ignored, as it is assumed that any filtering is already included in the SQL query.

sqlComparisonKey

string

Optional. For charts with comparison, this key will determine the metric that will be compared between the current and another dataset.

sessionId

string

Optional. The session id of the conversation. If the session id is not specified, backend will generate a random session id. If the session id is specified, will associate user-provided userQuery with the provided session id.

revisionId

string

Optional. The revision id that maps to the state of the chart state revision. When specified, the backend will reload the chart with the sql and visual spec from that revision.

userProvidedChartSpec

object (Struct format)

Optional. The user provided chart spec for the chart. This will be used to override the visual spec generated by the LLM.

timeZone

string

Optional. The time zone name from the IANA Time Zone Database (for example, "America/Los_Angeles") used to group daily time-series results. If empty, or if the name is well-formed but not known to the server, UTC is used. Malformed values are rejected with INVALID_ARGUMENT.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permissions on the location resource:

  • contactcenterinsights.authorizedConversations.list
  • contactcenterinsights.conversations.list

For more information, see the IAM documentation.