REST Resource: projects.locations.dataAgents

资源:DataAgent

描述 DataAgent 对象的消息。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "labels": {
    string: string,
    ...
  },
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "purgeTime": string,

  // Union field type can be only one of the following:
  "dataAnalyticsAgent": {
    object (DataAnalyticsAgent)
  }
  // End of list of possible types for union field type.
  "kmsKey": string
}
字段
name

string

可选。标识符。DataAgent 的唯一资源名称。格式:projects/{project}/locations/{location}/dataAgents/{dataAgentId} {dataAgent} 是资源 ID,长度不得超过 63 个字符,并且必须符合 https://google.aip.dev/122#resource-id-segments 中所述的格式

示例:projects/1234567890/locations/global/dataAgents/my-agent

建议在创建代理期间跳过设置此字段,因为系统会自动推理此字段,并使用 {parent}/dataAgents/{dataAgentId} 覆盖此字段。

displayName

string

可选。简单易记的显示名称。

  • 长度必须介于 1 到 256 个字符之间。
description

string

可选。代理的说明。

  • 长度必须介于 1 到 1024 个字符之间。
labels

map (key: string, value: string)

可选。可帮助用户过滤相关代理的标签。例如,“sales”“business”“etl”等。请注意,标签仅用于过滤,不用于政策。如需详细了解标签用法,请参阅标签文档

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

createTime

string (Timestamp format)

仅限输出。创建数据代理的时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

updateTime

string (Timestamp format)

仅限输出。上次更新数据代理的时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

deleteTime

string (Timestamp format)

仅限输出。[仅限输出] 将数据代理软删除的时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

purgeTime

string (Timestamp format)

仅限输出。相应数据代理被视为过期时的时间戳(世界协调时间 [UTC])。无论输入中发送的是什么内容,输出中始终都会提供此时间戳

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

联合字段 type。代理的类型。可以是以下各项之一:* 数据分析代理。* 数据工程代理 type 只能是下列其中一项:
dataAnalyticsAgent

object (DataAnalyticsAgent)

数据分析代理。

kmsKey

string

可选。用于加密 DataAgent 资源的客户管理的加密密钥 (CMEK)。Cloud KMS CryptoKey 必须与 DataAgent 位于同一位置。格式应为 projects/*/locations/*/keyRings/*/cryptoKeys/*

DataAnalyticsAgent

描述 DataAnalyticsAgent 对象的消息。

JSON 表示法
{
  "stagingContext": {
    object (Context)
  },
  "publishedContext": {
    object (Context)
  },
  "lastPublishedContext": {
    object (Context)
  }
}
字段
stagingContext

object (Context)

可选。代理的暂存上下文。此上下文用于在发布之前测试和验证更改。

publishedContext

object (Context)

可选。代理的已发布上下文。此上下文由 Chat API 在生产环境中使用。

lastPublishedContext

object (Context)

仅限输出。代理的上次发布上下文。这是仅限输出的字段,在已发布的内容更新时由系统进行填充。它用于将代理恢复到之前的状态。

上下文

要应用于此对话的上下文集合

JSON 表示法
{
  "systemInstruction": string,
  "datasourceReferences": {
    object (DatasourceReferences)
  },
  "options": {
    object (ConversationOptions)
  },
  "exampleQueries": [
    {
      object (ExampleQuery)
    }
  ],
  "lookerGoldenQueries": [
    {
      object (LookerGoldenQuery)
    }
  ],
  "glossaryTerms": [
    {
      object (GlossaryTerm)
    }
  ],
  "schemaRelationships": [
    {
      object (SchemaRelationship)
    }
  ],
  "userFunctions": {
    object (UserFunctions)
  }
}
字段
systemInstruction

string

可选。数据所有者为代理创建领域知识的基本入口点。

原因:业务术语(例如 YTD revenue is calculated as…、Retirement Age is 65 in the USA 等)和系统指令(例如 answer like a Pirate)可以帮助模型了解用户问题的业务上下文。

datasourceReferences

object (DatasourceReferences)

必需。可用于回答问题的数据源。

options

object (ConversationOptions)

可选。适用于对话的其他选项。

exampleQueries[]

object (ExampleQuery)

可选。示例查询列表,可提供相关的常用 SQL 查询示例及其相应的自然语言查询(可选)。目前仅用于 BigQuery 数据源和数据库(alloydb、cloudsql、spanner)数据源。

lookerGoldenQueries[]

object (LookerGoldenQuery)

可选。黄金查询列表,可提供相关的常用 Looker 查询示例及其相应的自然语言查询(可选)。仅支持 Looker 数据源。

glossaryTerms[]

object (GlossaryTerm)

可选。术语定义(目前仅限用户自行创建)不支持数据库(AlloyDB、Cloud SQL、Spanner)数据源。

schemaRelationships[]

object (SchemaRelationship)

可选。表架构之间的关系,包括引用列和被引用列。

userFunctions

object (UserFunctions)

可选。要包含在上下文中的一组用户函数。

DatasourceReferences

对数据源的引用的集合。

JSON 表示法
{

  // Union field references can be only one of the following:
  "bq": {
    object (BigQueryTableReferences)
  },
  "studio": {
    object (StudioDatasourceReferences)
  },
  "looker": {
    object (LookerExploreReferences)
  },
  "alloydb": {
    object (AlloyDbReference)
  },
  "spannerReference": {
    object (SpannerReference)
  },
  "cloudSqlReference": {
    object (CloudSqlReference)
  }
  // End of list of possible types for union field references.
}
字段
联合字段 references。要使用的数据源。references 只能是下列其中一项:
bq

object (BigQueryTableReferences)

对 BigQuery 表的引用。

studio

object (StudioDatasourceReferences)

对 Looker Studio 数据源的引用。

looker

object (LookerExploreReferences)

对 Looker 探索的引用。

alloydb

object (AlloyDbReference)

对 AlloyDB 数据库的引用。仅支持 QueryData 方法。

spannerReference

object (SpannerReference)

对 Spanner 数据库的引用。仅支持 QueryData 方法。

cloudSqlReference

object (CloudSqlReference)

对 CloudSql 数据库的引用。仅支持 QueryData 方法。

BigQueryTableReferences

表示对 BigQuery 表和属性图的引用的消息。必须填充 tableReferencespropertyGraphReferencessearchScope 中的至少一个。

JSON 表示法
{
  "tableReferences": [
    {
      object (BigQueryTableReference)
    }
  ],
  "propertyGraphReferences": [
    {
      object (BigQueryPropertyGraphReference)
    }
  ]
}
字段
tableReferences[]

object (BigQueryTableReference)

可选。对 BigQuery 表的引用。

propertyGraphReferences[]

object (BigQueryPropertyGraphReference)

可选。预览版功能。对 BigQuery 属性图的引用。注意:数据源必须仅使用表格或属性图,不能同时使用两者。使用属性图时,最多支持一个图引用。

BigQueryTableReference

表示对单个 BigQuery 表的引用的消息。

JSON 表示法
{
  "projectId": string,
  "datasetId": string,
  "tableId": string,
  "schema": {
    object (Schema)
  }
}
字段
projectId

string

必需。表所属的项目。

datasetId

string

必需。表所属的数据集。

tableId

string

必需。表 ID。

schema

object (Schema)

可选。数据源的架构。

架构

数据源或 QueryResult 实例的架构。

JSON 表示法
{
  "fields": [
    {
      object (Field)
    }
  ],
  "description": string,
  "synonyms": [
    string
  ],
  "tags": [
    string
  ],
  "displayName": string,
  "filters": [
    {
      object (DataFilter)
    }
  ]
}
字段
fields[]

object (Field)

可选。架构中的字段。

description

string

可选。表内容和用途的文本说明。例如:“Contains information about customer orders in our e-commerce store.”目前仅用于 BigQuery 数据源。

synonyms[]

string

可选。可用于引用表的备用名称或同义词的列表。例如:["sales", "orders", "purchases"]。目前仅用于 BigQuery 数据源。

tags[]

string

可选。与表关联的标记或关键字的列表(用于分类)。例如:["transaction", "revenue", "customer_data"]。目前仅用于 BigQuery 数据源。

displayName

string

可选。表显示名称(与 cloud/data_analytics/anarres/data/looker/proto/model_explore.proto 中的标签相同),不是必需的,目前只有 Looker 具有此字段。

filters[]

object (DataFilter)

可选。针对数据源底层数据的过滤条件。目前仅用于 Looker 数据源。

字段

架构中的字段。

JSON 表示法
{
  "name": string,
  "type": string,
  "description": string,
  "mode": string,
  "synonyms": [
    string
  ],
  "tags": [
    string
  ],
  "displayName": string,
  "subfields": [
    {
      object (Field)
    }
  ],
  "category": string,
  "valueFormat": string
}
字段
name

string

可选。字段的名称。

type

string

可选。字段的类型。

description

string

可选。字段的简要说明。

mode

string

可选。字段的模式(例如 NULLABLE、REPEATED)。

synonyms[]

string

可选。可用于引用此字段的备用名称或同义词的列表。例如:["id", "customerid", "cust_id"]。目前仅用于 BigQuery 数据源。

tags[]

string

可选。与字段关联的标记或关键字的列表(用于分类)。例如:["identifier", "customer", "pii"]。目前仅用于 BigQuery 数据源。

displayName

string

可选。字段显示名称(与标签相同)

subfields[]

object (Field)

可选。嵌套架构结构的递归属性。

category

string

可选。字段类别,不是必需的,目前仅用于 Looker。

valueFormat

string

可选。仅限 Looker。字段的值格式。参考:https://cloud.google.com/looker/docs/reference/param-field-value-format

DataFilter

针对数据源底层数据的过滤条件。过滤条件语法文档:https://cloud.google.com/looker/docs/filter-expressions

JSON 表示法
{
  "field": string,
  "value": string,
  "type": enum (DataFilterType)
}
字段
field

string

可选。要过滤的字段。 例如:["event_date", "customer_id", "product_category"]

value

string

可选。如果未在查询中替换此过滤条件,则是用于此过滤条件的默认值。例如:["after 2024-01-01", "123", "-fashion"]

type

enum (DataFilterType)

可选。数据源上存在的过滤条件的类型,例如 ALWAYS_FILTER。

DataFilterType

数据源上存在的过滤条件的类型,例如 ALWAYS_FILTER。

枚举
DATA_FILTER_TYPE_UNSPECIFIED 未指定过滤条件类型。
ALWAYS_FILTER 用户配置的过滤条件,对探索发出的任何查询始终默认应用此过滤条件。目前仅用于 Looker 数据源。

BigQueryPropertyGraphReference

表示对单个 BigQuery 属性图的引用的消息。

JSON 表示法
{
  "projectId": string,
  "datasetId": string,
  "propertyGraphId": string
}
字段
projectId

string

必需。属性图表所属的项目。

datasetId

string

必需。属性图表所属的数据集。

propertyGraphId

string

必需。属性图表 ID。

StudioDatasourceReferences

表示对 Looker Studio 数据源的引用的消息。

JSON 表示法
{
  "studioReferences": [
    {
      object (StudioDatasourceReference)
    }
  ]
}
字段
studioReferences[]

object (StudioDatasourceReference)

可选。对 Studio 数据源的引用。

StudioDatasourceReference

表示对单个 Looker Studio数据源的引用的消息。

JSON 表示法
{
  "datasourceId": string
}
字段
datasourceId

string

必需。数据源的 ID。

LookerExploreReferences

表示对 Looker 探索的引用的消息。

JSON 表示法
{
  "exploreReferences": [
    {
      object (LookerExploreReference)
    }
  ],
  "credentials": {
    object (Credentials)
  }
}
字段
exploreReferences[]

object (LookerExploreReference)

必需。对 Looker 探索的引用。

credentials
(deprecated)

object (Credentials)

可选。已弃用:请在 ChatRequest 中使用凭据。调用 Looker API 时要使用的凭证。

目前支持基于 OAuth 令牌和 API 密钥的凭证,如使用 SDK 进行身份验证中所述。

LookerExploreReference

表示对单个 Looker 探索的引用的消息。

JSON 表示法
{
  "lookmlModel": string,
  "explore": string,
  "schema": {
    object (Schema)
  },

  // Union field instance can be only one of the following:
  "lookerInstanceUri": string,
  "privateLookerInstanceInfo": {
    object (PrivateLookerInstanceInfo)
  }
  // End of list of possible types for union field instance.
}
字段
lookmlModel

string

必需。Looker 模型,如主要 LookML 结构中所述。LookML 模型的名称。

explore

string

必需。Looker 探索,如主要 LookML 结构中所述。LookML 探索的名称。

schema

object (Schema)

可选。数据源的架构。

联合字段 instance。Looker 探索的实例。instance 只能是下列其中一项:
lookerInstanceUri

string

必需。Looker 实例的基础网址。

privateLookerInstanceInfo

object (PrivateLookerInstanceInfo)

专用 Looker 实例信息。

PrivateLookerInstanceInfo

表示专用 Looker 实例信息的消息(在 Looker 实例位于专用网络后面时需要)。

JSON 表示法
{
  "lookerInstanceId": string,
  "serviceDirectoryName": string
}
字段
lookerInstanceId

string

Looker 实例 ID。

serviceDirectoryName

string

Looker 实例的服务目录名称。

凭据

表示不同形式的凭证规范。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "oauth": {
    object (OAuthCredentials)
  }
  // End of list of possible types for union field kind.
}
字段
联合字段 kind。凭证的种类。kind 只能是下列其中一项:
oauth

object (OAuthCredentials)

OAuth 凭证。

OAuthCredentials

表示 OAuth 凭证。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "secret": {
    object (SecretBased)
  },
  "token": {
    object (TokenBased)
  }
  // End of list of possible types for union field kind.
}
字段
联合字段 kind。OAuth 凭证的种类。kind 只能是下列其中一项:
secret

object (SecretBased)

基于 Secret 的 OAuth 凭证。

token

object (TokenBased)

基于令牌的 OAuth 凭证。

SecretBased

包含访问令牌的 Secret 的名称。表示基于 Secret 的 OAuth 凭证。

JSON 表示法
{
  "clientId": string,
  "clientSecret": string
}
字段
clientId

string

必需。OAuth 客户端 ID。

clientSecret

string

必需。OAuth 客户端密钥。

TokenBased

如需详细了解 Looker 访问令牌,请访问以下网址:https://developers.looker.com/api/advanced-usage/looker-api-oauth

JSON 表示法
{
  "accessToken": string
}
字段
accessToken

string

必需。包含访问令牌的 Secret 的名称。

AlloyDbReference

表示对 AlloyDB 数据库和代理上下文的引用的消息。仅支持 QueryData 方法。

JSON 表示法
{
  "databaseReference": {
    object (AlloyDbDatabaseReference)
  },
  "agentContextReference": {
    object (AgentContextReference)
  }
}
字段
databaseReference

object (AlloyDbDatabaseReference)

必需。支持指定要包含的数据库和表的单数 proto。

agentContextReference

object (AgentContextReference)

可选。用于从代理上下文检索数据的参数。

AlloyDbDatabaseReference

表示对单个 AlloyDB 数据库的引用的消息。

JSON 表示法
{
  "projectId": string,
  "region": string,
  "clusterId": string,
  "instanceId": string,
  "databaseId": string,
  "tableIds": [
    string
  ],
  "databaseTableReferences": [
    {
      object (DatabaseTableReference)
    }
  ]
}
字段
projectId

string

必需。实例所属的项目。

region

string

必需。实例的区域。

clusterId

string

必需。集群 ID。

instanceId

string

必需。实例 ID。

databaseId

string

必需。数据库 ID。

tableIds[]

string

可选。表 ID。如果未设置,则表示所有表。

databaseTableReferences[]

object (DatabaseTableReference)

可选。对数据库中表的引用。每个引用都指定一个表,并且可以选择性地包含表的架构,以便为查询提供上下文。

DatabaseTableReference

表示表(包括其架构)的消息。

JSON 表示法
{
  "tableId": string,
  "schema": {
    object (Schema)
  }
}
字段
tableId

string

必需。数据库中定义的表的名称。

注意:表命名的确切规则(包括有效字符、长度限制和大小写敏感度)由具体的数据库系统决定。

要求:- 完全一致:提供的名称必须与数据库中存储的名称完全一致。- 大小写区分:遵循特定数据库系统的大小写区分规则以及表的创建方式。例如,“Orders”和“orders”可能是不同的表名。- 特殊字符/关键字:如果表名称包含空格、特殊字符或是数据库预留关键字,请提供存储的字面名称。请勿添加任何特定于数据库的标识符引用字符(例如“、`、[])。

示例: - 简单名称:“orders”“UserActivity” - 区分大小写的名称:“MyTable” - 包含空格的名称:“Order Details” - 包含其他特殊字符的名称:“user/data”“order-items” - 属于关键字的名称:“Group”“Order”

权限:调用者的凭据必须具有访问表架构和数据所需的数据库权限。

schema

object (Schema)

可选。表的架构。

AgentContextReference

表示对代理上下文的引用的消息。

JSON 表示法
{
  "contextSetId": string
}
字段
contextSetId

string

必需。要检索的上下文集 ID。

SpannerReference

表示对 Spanner 数据库和代理上下文的引用的消息。仅支持 QueryData 方法。

JSON 表示法
{
  "databaseReference": {
    object (SpannerDatabaseReference)
  },
  "agentContextReference": {
    object (AgentContextReference)
  }
}
字段
databaseReference

object (SpannerDatabaseReference)

必需。支持指定要包含的数据库和表的单数 proto。

agentContextReference

object (AgentContextReference)

可选。用于从代理上下文检索数据的参数。

SpannerDatabaseReference

表示对单个 Spanner 数据库的引用的消息。

JSON 表示法
{
  "engine": enum (Engine),
  "projectId": string,
  "instanceId": string,
  "databaseId": string,
  "tableIds": [
    string
  ],
  "databaseTableReferences": [
    {
      object (DatabaseTableReference)
    }
  ],
  "priority": string,
  "requestTag": string
}
字段
engine

enum (Engine)

必需。Spanner 实例的引擎。

projectId

string

必需。实例所属的项目。

instanceId

string

必需。实例 ID。

databaseId

string

必需。数据库 ID。

tableIds[]

string

可选。表 ID。如果未设置,则表示所有表。

databaseTableReferences[]

object (DatabaseTableReference)

可选。对数据库中表的引用。每个引用都指定一个表,并且可以选择性地包含表的架构,以便为查询提供上下文。

priority

string

可选。针对 Spanner 的查询的优先级。应该是 Cloud Spanner 支持的值,例如:低、中、高。系统会忽略不受支持的值。如需查看完整列表,请参阅 https://docs.cloud.google.com/spanner/docs/reference/rest/v1/RequestOptions#Priority

requestTag

string

要附加到所有 Spanner 查询的标记。用于识别和监控 GDA 服务发送给 Spanner 的查询。

引擎

数据库引擎。

枚举
ENGINE_UNSPECIFIED 未指定引擎。
GOOGLE_SQL Google SQL
POSTGRESQL PostgreSQL

CloudSqlReference

表示对 CloudSQL 数据库和代理上下文的引用的消息。仅支持 QueryData 方法。

JSON 表示法
{
  "databaseReference": {
    object (CloudSqlDatabaseReference)
  },
  "agentContextReference": {
    object (AgentContextReference)
  }
}
字段
databaseReference

object (CloudSqlDatabaseReference)

必需。支持指定要包含的数据库和表的单数 proto。

agentContextReference

object (AgentContextReference)

可选。用于从代理上下文检索数据的参数。

CloudSqlDatabaseReference

表示对单个 CloudSQL 数据库的引用的消息。

JSON 表示法
{
  "engine": enum (Engine),
  "projectId": string,
  "region": string,
  "instanceId": string,
  "databaseId": string,
  "tableIds": [
    string
  ],
  "databaseTableReferences": [
    {
      object (DatabaseTableReference)
    }
  ]
}
字段
engine

enum (Engine)

必需。Cloud SQL 实例的引擎。

projectId

string

必需。实例所属的项目。

region

string

必需。实例的区域。

instanceId

string

必需。实例 ID。

databaseId

string

必需。数据库 ID。

tableIds[]

string

可选。表 ID。如果未设置,则表示所有表。

databaseTableReferences[]

object (DatabaseTableReference)

可选。对数据库中表的引用。每个引用都指定一个表,并且可以选择性地包含表的架构,以便为查询提供上下文。

引擎

数据库引擎。

枚举
ENGINE_UNSPECIFIED 未指定引擎。
POSTGRESQL PostgreSQL
MYSQL MySQL

ConversationOptions

适用于对话的选项。

JSON 表示法
{
  "chart": {
    object (ChartOptions)
  },
  "analysis": {
    object (AnalysisOptions)
  },
  "datasource": {
    object (DatasourceOptions)
  },
  "model": enum (Model)
}
字段
chart

object (ChartOptions)

可选。适用于图表生成的选项。

analysis

object (AnalysisOptions)

可选。适用于分析的选项。

datasource

object (DatasourceOptions)

可选。数据源的选项。

model

enum (Model)

可选。用于代理循环的模型。

ChartOptions

适用于图表生成的选项。

JSON 表示法
{
  "image": {
    object (ImageOptions)
  }
}
字段
image

object (ImageOptions)

可选。指定后,代理将使用提供的格式呈现生成的图表。默认为无图片。

ImageOptions

用于呈现生成的图表的图片的选项。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "noImage": {
    object (NoImage)
  },
  "svg": {
    object (SvgOptions)
  }
  // End of list of possible types for union field kind.
}
字段
联合字段 kind。要呈现的图片的种类。kind 只能是下列其中一项:
noImage

object (NoImage)

没有图片。

svg

object (SvgOptions)

SVG 格式。

NoImage

此类型没有字段。

没有图片。

SvgOptions

此类型没有字段。

SVG 选项。

AnalysisOptions

适用于分析的选项。

JSON 表示法
{
  "python": {
    object (Python)
  }
}
字段
python

object (Python)

可选。适用于 Python 分析的选项。

Python

适用于 Python 分析的选项。

JSON 表示法
{
  "enabled": boolean
}
字段
enabled

boolean

可选。是否启用 Python 分析。默认值为 false。

DatasourceOptions

数据源配置的选项。

JSON 表示法
{
  "bigQueryMaxBilledBytes": string
}
字段
bigQueryMaxBilledBytes

string (Int64Value format)

可选。此选项仅适用于需要 BigQuery 查询的数据源。限制每个 BigQuery 查询作业的收费字节数。如果查询的收费字节数超出此限制,则查询会失败(不会产生费用)。如果未指定,则表示不应用限制。

模型

代理/对话允许使用的模型。

枚举
MODEL_UNSPECIFIED 未指定模型。可以在聊天请求中设置模型,也可以使用默认模型。
LATEST_GA_MODEL 使用最新的非预览版模型。这可能会限制某些请求级设置。

ExampleQuery

相关的常用 SQL 查询示例及其相应的自然语言查询(可选)。目前仅用于 BigQuery 数据源。

JSON 表示法
{
  "naturalLanguageQuestion": string,
  "parameters": [
    {
      object (QueryParameter)
    }
  ],

  // Union field query can be only one of the following:
  "sqlQuery": string
  // End of list of possible types for union field query.
}
字段
naturalLanguageQuestion

string

可选。用户可能会提出的自然语言问题。例如:“How many orders were placed last month?”

parameters[]

object (QueryParameter)

可选。查询参数列表。示例:参数化 SQL 查询“SELECT * FROM my_table WHERE id = @id”可以与任何 id 值匹配。

联合字段 query。为回答自然语言查询而应生成的 SQL 或 Looker 查询。query 只能是下列其中一项:
sqlQuery

string

可选。为回答自然语言查询而应生成的 SQL 查询。例如:“SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'”

QueryParameter

查询参数消息表示可用于对 SQL 查询进行参数化的参数。

JSON 表示法
{
  "name": string,
  "description": string,
  "dataType": string
}
字段
name

string

必需。SQL 查询中参数引用的名称。

description

string

可选。参数的说明,可供 LLM 用于从用户问题中提取参数值。

dataType

string

必需。参数的数据类型,例如“STRING”“INT64”“DATE”等。如需了解有效值,请参阅 BigQuery 文档。此值将用于填充 google.cloud.bigquery.v2.QueryParameterType.type。

LookerGoldenQuery

Looker 的黄金查询,包括自然语言问题和相应的 Looker 查询。与 ExampleQuery 类似。

JSON 表示法
{
  "naturalLanguageQuestions": [
    string
  ],
  "lookerQuery": {
    object (LookerQuery)
  }
}
字段
naturalLanguageQuestions[]

string

可选。用户可能会提出的自然语言问题。例如:“How many orders were placed last month?”

lookerQuery

object (LookerQuery)

可选。与自然语言问题对应的 Looker 查询。

LookerQuery

Looker 查询对象 Looker API 文档

JSON 表示法
{
  "model": string,
  "explore": string,
  "fields": [
    string
  ],
  "filters": [
    {
      object (Filter)
    }
  ],
  "sorts": [
    string
  ],
  "limit": string,
  "queryId": string,
  "clientId": string
}
字段
model

string

必需。用于生成查询的 LookML 模型。

explore

string

必需。用于生成查询的 LookML 探索。

fields[]

string

可选。要从探索中检索的字段。

filters[]

object (Filter)

可选。要应用于探索的过滤条件。

sorts[]

string

可选。要应用于探索的排序。

limit

string

可选。查询中的限制。

queryId

string

可选。Looker 中查询资源的主要标识符,用于 API 操作。映射到 Looker API Query 资源中的 id(或 slug)。

clientId

string

可选。查询的简短字母数字标识符,用于分享链接和探索网址(例如,在 qid 参数中)。映射到 Looker API Query 资源中的 clientId

过滤

Looker 查询过滤条件。

JSON 表示法
{
  "field": string,
  "value": string
}
字段
field

string

必需。要过滤的字段。

value

string

可选。要过滤的字段的值。可选,以便我们可以将默认值保留为空字符串,这对于获取有效且可用的 Looker 探索网址非常重要。

GlossaryTerm

特定领域中某个术语的定义。

JSON 表示法
{
  "displayName": string,
  "description": string,
  "labels": [
    string
  ]
}
字段
displayName

string

必需。所定义术语的简单易记的显示名称。例如:“CTR”“转化率”“待处理”

description

string

必需。相应术语的说明或含义。例如:“点击率”“完成目标操作的用户所占的百分比”“等待处理的订单”。

labels[]

string

可选。与此术语相关联的一系列通用标签。例如:["点击率", "点击", "等待中"]

SchemaRelationship

两个表之间的关系,包括引用列和被引用列。这是从 Dataplex Dataset Insights 中检索到的派生上下文

JSON 表示法
{
  "leftSchemaPaths": {
    object (SchemaPaths)
  },
  "rightSchemaPaths": {
    object (SchemaPaths)
  },
  "sources": [
    enum (Source)
  ],
  "confidenceScore": number
}
字段
leftSchemaPaths

object (SchemaPaths)

第一个表中用于联接的字段的有序列表。此列表的大小必须与 rightSchemaPaths 相同。此列表中索引 i 处的每个字段都必须与 rightSchemaPaths 列表中相同索引处的字段相对应。

rightSchemaPaths

object (SchemaPaths)

第二个表中用于联接的字段的有序列表。此列表的大小必须与 leftSchemaPaths 相同。此列表中索引 i 处的每个字段都必须与 leftSchemaPaths 列表中相同索引处的字段相对应。

sources[]

enum (Source)

可选。生成架构关系边的来源。

confidenceScore

number

可选。建议关系的置信度分数。手动添加的边具有最高的置信度分数。

SchemaPaths

表示表架构中的一组有序路径。

JSON 表示法
{
  "tableFqn": string,
  "paths": [
    string
  ]
}
字段
tableFqn

string

表的服务限定格式完整资源名称。示例:bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID

paths[]

string

表架构中的路径的有序列表。

来源

生成了架构关系边的来源。

枚举
SOURCE_UNSPECIFIED 未指定架构关系来源。
BIGQUERY_JOB_HISTORY 架构关系的来源是 BigQuery 作业历史记录。
LLM_SUGGESTED 架构关系的来源是 LLM 建议。
BIGQUERY_TABLE_CONSTRAINTS 架构关系的来源是 BigQuery 表约束。

UserFunctions

要包含在上下文中的一组用户函数。

JSON 表示法
{
  "bqRoutines": [
    {
      object (BigQueryRoutine)
    }
  ]
}
字段
bqRoutines[]

object (BigQueryRoutine)

要包含在上下文中的 BigQuery 例程的列表。

BigQueryRoutine

对 BigQuery 例程的引用。

JSON 表示法
{
  "routineReference": {
    object (BigQueryRoutineReference)
  },
  "description": string
}
字段
routineReference

object (BigQueryRoutineReference)

对 BigQuery 例程的引用。

description

string

用户对说明的替换或添加,用于告知代理何时使用 UDF。

BigQueryRoutineReference

对 BigQuery 例程的引用。

JSON 表示法
{
  "projectId": string,
  "datasetId": string,
  "routineId": string
}
字段
projectId

string

例程的项目 ID。

datasetId

string

例程的数据集 ID。

routineId

string

例程的例程 ID。

方法

create

在给定的项目和位置中创建新 DataAgent。

createSync

在给定的项目和位置中同步创建新 DataAgent。

delete

删除单个 DataAgent。

deleteSync

同步删除单个 DataAgent。

get

获取单个 DataAgent 的详细信息。

getIamPolicy

获取 DataAgent 的 IAM 政策

list

列出给定项目和位置中的 DataAgent。

listAccessible

列出给定项目和位置中调用方可访问的 DataAgent。

patch

更新单个 DataAgent 的参数。

setIamPolicy

为 DataAgent 设置 IAM 政策。

updateSync

同步更新单个 DataAgent 的参数。