Classes
AnnotatedString
Describes string annotation from both semantic and formatting perspectives. Example:
User Query:
top countries by population in Africa
0 4 14 17 28 31 37
Table Data:
- "country" - dimension
- "population" - metric
- "Africa" - value in the "continent" column
text_formatted = "top countries by population in Africa"
html_formatted =
"top <b>countries</b> by <b>population</b> in <i>Africa</i>"
markups = [
{DIMENSION, 4, 12}, // 'countries'
{METRIC, 17, 26}, // 'population'
{FILTER, 31, 36} // 'Africa'
]
Note that html formattings for 'DIMENSION' and 'METRIC' are the same, while semantic markups are different.
AnnotatedString.Types
Container for nested types declared in the AnnotatedString message type.
AnnotatedString.Types.SemanticMarkup
Semantic markup denotes a substring (by index and length) with markup information.
AutoSuggestionService
This stateless API provides automatic suggestions for natural language queries for the data sources in the provided project and location.
The service provides a resourceless operation suggestQueries
that can be
called to get a list of suggestions for a given incomplete query and scope
(or list of scopes) under which the query is to be interpreted.
There are two types of suggestions, ENTITY for single entity suggestions and TEMPLATE for full sentences. By default, both types are returned.
Example Request:
GetSuggestions({
parent: "locations/us/projects/my-project"
scopes:
"//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table"
query: "top it"
})
The service will retrieve information based on the given scope(s) and give suggestions based on that (e.g. "top item" for "top it" if "item" is a known dimension for the provided scope).
suggestions {
suggestion_info {
annotated_suggestion {
text_formatted: "top item by sum of usd_revenue_net"
markups {
type: DIMENSION
start_char_index: 4
length: 4
}
markups {
type: METRIC
start_char_index: 19
length: 15
}
}
query_matches {
start_char_index: 0
length: 6
}
}
suggestion_type: TEMPLATE
ranking_score: 0.9
}
suggestions {
suggestion_info {
annotated_suggestion {
text_formatted: "item"
markups {
type: DIMENSION
start_char_index: 4
length: 2
}
}
query_matches {
start_char_index: 0
length: 6
}
}
suggestion_type: ENTITY
ranking_score: 0.8
}
AutoSuggestionService.AutoSuggestionServiceBase
Base class for server-side implementations of AutoSuggestionService
AutoSuggestionService.AutoSuggestionServiceClient
Client for AutoSuggestionService
AutoSuggestionServiceClient
AutoSuggestionService client wrapper, for convenient use.
AutoSuggestionServiceClientBuilder
Builder class for AutoSuggestionServiceClient to provide simple configuration of credentials, endpoint etc.
AutoSuggestionServiceClientImpl
AutoSuggestionService client wrapper implementation, for convenient use.
AutoSuggestionServiceSettings
Settings for AutoSuggestionServiceClient instances.
BigQueryJob
BigQuery job information. This can be used to query the BigQuery API and retrieve the current job's status (using jobs.get).
CreateQuestionRequest
Request to create a question resource.
DataQuery
Representation of the data query for the backend.
This is provided for informational purposes only. Clients should not use
it to send it to the backend directly, but rather use the execute
RPC
to trigger the execution. Using the execute
RPC is needed in order to
track the state of a question and report on it correctly to the data
administrators.
DebugFlags
Configuriation of debug flags.
ExecuteQuestionRequest
Request to execute an interpretation.
ExecutionInfo
Information about the backend status (such as BigQuery) of the execution.
ExecutionInfo.Types
Container for nested types declared in the ExecutionInfo message type.
GetQuestionRequest
A request to get a previously created question.
GetUserFeedbackRequest
Request to get user feedback.
HumanReadable
Human readable interpretation.
InterpretError
Details on the failure to interpret the question.
InterpretError.Types
Container for nested types declared in the InterpretError message type.
InterpretError.Types.InterpretAmbiguityDetails
Details about a query that was too ambiguous. Currently, the message has no fields and its presence signals that there was ambiguity.
InterpretError.Types.InterpretErrorDetails
Details on interpretation failure.
InterpretError.Types.InterpretIncompleteQueryDetails
Details about an incomplete query.
InterpretError.Types.InterpretUnsupportedDetails
Details about unsupported parts in a query.
Interpretation
An interpretation of a natural language query.
InterpretationStructure
Information about the interpretation structure that helps to understand and visualize the response.
InterpretationStructure.Types
Container for nested types declared in the InterpretationStructure message type.
InterpretationStructure.Types.ColumnInfo
Information about a column.
Question
The question resource represents a natural language query, its settings, understanding generated by the system, and answer retrieval status. A question cannot be modified.
QuestionName
Resource name for the Question
resource.
QuestionService
Service to interpret natural language queries.
The service allows to create Question
resources that are interpreted and
are filled with one or more interpretations if the question could be
interpreted. Once a Question
resource is created and has at least one
interpretation, an interpretation can be chosen for execution, which
triggers a query to the backend (for BigQuery, it will create a job).
Upon successful execution of that interpretation, backend specific
information will be returned so that the client can retrieve the results
from the backend.
The Question
resources are named projects/*/locations/*/questions/*
.
The Question
resource has a singletion sub-resource UserFeedback
named
projects/*/locations/*/questions/*/userFeedback
, which allows access to
user feedback.
QuestionService.QuestionServiceBase
Base class for server-side implementations of QuestionService
QuestionService.QuestionServiceClient
Client for QuestionService
QuestionServiceClient
QuestionService client wrapper, for convenient use.
QuestionServiceClientBuilder
Builder class for QuestionServiceClient to provide simple configuration of credentials, endpoint etc.
QuestionServiceClientImpl
QuestionService client wrapper implementation, for convenient use.
QuestionServiceSettings
Settings for QuestionServiceClient instances.
SuggestQueriesRequest
Request for query suggestions.
SuggestQueriesResponse
Response to SuggestQueries.
Suggestion
A suggestion for a query with a ranking score.
SuggestionInfo
Detailed information about the suggestion.
SuggestionInfo.Types
Container for nested types declared in the SuggestionInfo message type.
SuggestionInfo.Types.MatchInfo
MatchInfo describes which part of suggestion matched with data in user typed query. This can be used to highlight matching parts in the UI. This is different from the annotations provided in annotated_suggestion. The annotated_suggestion provides information about the semantic meaning, while this provides information about how it relates to the input.
Example:
user query: top products
annotated_suggestion {
text_formatted = "top product_group"
html_formatted = "top <b>product_group</b>"
markups {
{type: TEXT, start_char_index: 0, length: 3}
{type: DIMENSION, start_char_index: 4, length: 13}
}
}
query_matches {
{ start_char_index: 0, length: 3 }
{ start_char_index: 4, length: 7}
}
UpdateUserFeedbackRequest
Request to updates user feedback.
UserFeedback
Feedback provided by a user.
UserFeedback.Types
Container for nested types declared in the UserFeedback message type.
UserFeedbackName
Resource name for the UserFeedback
resource.
Enums
AnnotatedString.Types.SemanticMarkupType
Semantic markup types.
ExecutionInfo.Types.JobExecutionState
Enum of possible job execution statuses.
InterpretEntity
Query entities of an interpretation.
InterpretError.Types.InterpretErrorCode
The interpret error code provides an error category why the interpretation failed.
InterpretationStructure.Types.VisualizationType
Enumeration of visualzation types to use for query response data.
QuestionName.ResourceNameType
The possible contents of QuestionName.
SuggestionType
The type of suggestion.
UserFeedback.Types.UserFeedbackRating
Enumeration of feedback ratings.
UserFeedbackName.ResourceNameType
The possible contents of UserFeedbackName.