virtualDbxAgent.query runs the agent.
HTTP request
POST https://databaseinsights.googleapis.com/v1beta/{parent=projects/*/locations/*}/virtualDbxAgent:query
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
|
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "userQuery": string, "sessionId": string, "projectId": string, "productType": string, "engineType": string, "location": string, "databaseChatContext": { object ( |
| Fields | |
|---|---|
userQuery |
Required. The user query to be used for the agent. |
sessionId |
Required. The session id of the user query. This is used to identify the user query and the agent response. |
projectId |
Optional. The project id of the database. |
productType |
Optional. The product type of the database. This is a string representation of the product type |
engineType |
Optional. The engine type of the database. This is a string representation of the engine type. |
location |
Optional. The location of the database resource |
databaseChatContext |
Optional. The database chat context to be used for database chat tools. |
additionalContext |
Optional. The additional context to be used for the agent. An object containing a list of |
agentOptions |
Optional. The options for processing the request on the agent. |
Response body
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "response": string, "visualizations": [ { object ( |
| Fields | |
|---|---|
response |
The agent's response to the user query. |
visualizations[] |
A list of visualizations generated by the agent. |
sduiRequests[] |
Output only. The SDUI requests for UI widgets. The number of elements is limited to 100. |
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 permission on the parent resource:
databaseinsights.virtualDbxAgent.query
For more information, see the IAM documentation.
DatabaseChatContext
| JSON representation |
|---|
{
"taskCompletionRequest": {
object ( |
| Fields | |
|---|---|
taskCompletionRequest |
The task completion request to be used for the database chat. |
TaskCompletionRequest
Input for task completion.
| JSON representation |
|---|
{ "messageId": string, "topic": string, "contents": [ { object ( |
| Fields | |
|---|---|
messageId |
Optional. An ID for this TaskCompletionRequest, used for persistence and for correlating it with the TaskCompletionResponse received from the Agent (the response carries the id of the TaskCompletionRequests it consumed).
To update a previously persisted message, set the 'topic' field and the 'messageId' field to the same value, while changing the contents. Only the last request to the Agent in the Topic can be updated. Updating the request will cause all its responses to be recreated. |
topic |
Optional. The topic to file this message under. Format: projects/*/locations/*/topics/{topic_id} Setting this field implies an intent to persist messages. The entire request fails if this field is set but the user doesn't have the IAM permissions to persist messages. The value of this field is ignored if the 'instance' resource associated with the API call does not have storage option set. |
contents[] |
Optional. Content of the task completion/chat input. This field is used to replace the |
instance |
Required. The full name of the Instance resource for this generation request. Format: |
input |
Optional. Represents the raw input for inference. It will be modified as part of prompt engineering and other transforms before it is consumed by the LLM. Deprecated. Use |
experienceContext |
Duet product context -- required |
inputDataContext |
Optional. Additional user content not captured in the |
clientContext |
Optional. Client context (e.g. IDE name, version, etc) |
backendResourcesContext |
Optional. The GCP resources that the code generation process needs to reference |
TaskCompletionInput
Natural language messages making up the task completion conversation.
| JSON representation |
|---|
{
"messages": [
{
object ( |
| Fields | |
|---|---|
messages[] |
Optional. Last few messages of the conversation. The most recent message is the last element in the list. |
preamble |
Optional. Preamble for the task completion conversation. |
TaskCompletionMessage
Represents a single message.
| JSON representation |
|---|
{ "content": string, "author": string } |
| Fields | |
|---|---|
content |
Optional. Text content of the task completion/chat message. |
author |
Optional. Author tag for the turn. |
TaskCompletionContent
Content of the task completion/chat input.
| JSON representation |
|---|
{
"parts": [
{
object ( |
| Fields | |
|---|---|
parts[] |
Required. The parts of the content. |
role |
Required. Either "user" or "model". |
Part
A part of the content.
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field data. The data of the part. data can be only one of the following: |
|
text |
Optional. Text content. |
inlineData |
Optional. Inline blob content. |
Blob
Content blob.
| JSON representation |
|---|
{ "mimeType": string, "data": string } |
| Fields | |
|---|---|
mimeType |
Required. The MIME type of the blob. |
data |
Required. The raw bytes of the blob. A base64-encoded string. |
ExperienceContext
The specific Duet product and flow a request belongs to. E.g. Appsheet code generation (“/appsheet/generate”).
| JSON representation |
|---|
{ "agent": string, "task": string, "experience": string } |
| Fields | |
|---|---|
agent |
Optional. The Backend Agent to route this request to (if known). |
task |
Optional. The backend Task(s) this request maps to (if known). |
experience |
Required. The Duet experience that this request belongs to. |
InputDataContext
Intended to hold customer content over and above what is present in the input field.
| JSON representation |
|---|
{ "additionalContext": { "@type": string, field1: ..., ... } } |
| Fields | |
|---|---|
additionalContext |
Optional. Represents additional customer content over the An object containing fields of an arbitrary type. An additional field |
ClientContext
Represents context about the UI client. Must NOT contain customer content.
| JSON representation |
|---|
{ "additionalContext": { "@type": string, field1: ..., ... }, "name": string, "version": string } |
| Fields | |
|---|---|
additionalContext |
Optional. Represents GCP product-specific UI/client context. An object containing fields of an arbitrary type. An additional field |
name |
Optional. Name of the Duet plugin/UI running in the client space |
version |
Optional. Duet plugin/UI version |
BackendResourcesContext
Represents ids of resources that the operation needs to reference or target. E.g. for BigQuery SQL generation, this could reference the Dataset or Table names (go/backend-resources-context-eg).
| JSON representation |
|---|
{ "fullResourceNames": [ string ], "additionalContext": { "@type": string, field1: ..., ... } } |
| Fields | |
|---|---|
fullResourceNames[] |
The full resource names (https://cloud.google.com/apis/design/resourceNames) of the GCP resources that are referenced or relevant to the Duet query. For example, a BigQuery SQL generation in the context of a particular BigQuery table would set this to: |
additionalContext |
Optional. Represents GCP product-specific backend resources context. An object containing fields of an arbitrary type. An additional field |
AgentOptions
Options for processing the request on the agent.
| JSON representation |
|---|
{ "visualizationDisabled": boolean } |
| Fields | |
|---|---|
visualizationDisabled |
Optional. If true, visualizations are disabled in the agent response. |
Visualization
Represents a visualization generated by the agent.
| JSON representation |
|---|
{ "summary": string, "visualizationType": enum ( |
| Fields | |
|---|---|
summary |
A summary or description of the visualization. |
visualizationType |
The type of the visualization. |
Union field data. The data for the visualization. data can be only one of the following: |
|
promqlQuery |
The PromQL query string for a PROMQL_QUERY type visualization. See: https://prometheus.io/docs/prometheus/latest/querying/basics/ |
VisualizationType
The type of the visualization. New values may be added in the future.
| Enums | |
|---|---|
VISUALIZATION_TYPE_UNSPECIFIED |
The default value. This value is unused. |
PROMQL_QUERY |
The visualization is a PromQL query. |
SduiRequest
Client-side request type for GetSdui. See go/cloud-sdui for more details.
| JSON representation |
|---|
{ "componentId": string, "sduiService": string, "payload": { object }, "description": string } |
| Fields | |
|---|---|
componentId |
Required unique identifier for the SDUI component. |
sduiService |
The name of the SduiService to send the request to. |
payload |
Payload to the SDUI component. |
description |
The description of the SDUI component. To be used for LLM context. |