|
| 1 | +// Copyright 2026 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.geminidataanalytics.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/api/resource.proto"; |
| 21 | +import "google/cloud/geminidataanalytics/v1/datasource.proto"; |
| 22 | +import "google/protobuf/wrappers.proto"; |
| 23 | + |
| 24 | +option csharp_namespace = "Google.Cloud.GeminiDataAnalytics.V1"; |
| 25 | +option go_package = "cloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "ContextProto"; |
| 28 | +option java_package = "com.google.cloud.geminidataanalytics.v1"; |
| 29 | +option php_namespace = "Google\\Cloud\\GeminiDataAnalytics\\V1"; |
| 30 | +option ruby_package = "Google::Cloud::GeminiDataAnalytics::V1"; |
| 31 | + |
| 32 | +// A collection of context to apply to this conversation |
| 33 | +message Context { |
| 34 | + // The relationship between two tables, including referencing and referenced |
| 35 | + // columns. This is a derived context retrieved from Dataplex Dataset |
| 36 | + // Insights. |
| 37 | + message SchemaRelationship { |
| 38 | + // Represents an ordered set of paths within the table schema. |
| 39 | + message SchemaPaths { |
| 40 | + // The service-qualified full resource name of the table |
| 41 | + // Ex: |
| 42 | + // bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID |
| 43 | + string table_fqn = 1; |
| 44 | + |
| 45 | + // The ordered list of paths within the table schema. |
| 46 | + repeated string paths = 2; |
| 47 | + } |
| 48 | + |
| 49 | + // Source which generated the schema relation edge. |
| 50 | + enum Source { |
| 51 | + // The source of the schema relationship is unspecified. |
| 52 | + SOURCE_UNSPECIFIED = 0; |
| 53 | + |
| 54 | + // The source of the schema relationship is BigQuery job history. |
| 55 | + BIGQUERY_JOB_HISTORY = 1; |
| 56 | + |
| 57 | + // The source of the schema relationship is LLM suggested. |
| 58 | + LLM_SUGGESTED = 2; |
| 59 | + |
| 60 | + // The source of the schema relationship is BigQuery table constraints. |
| 61 | + BIGQUERY_TABLE_CONSTRAINTS = 3; |
| 62 | + } |
| 63 | + |
| 64 | + // An ordered list of fields for the join from the first table. |
| 65 | + // The size of this list must be the same as `right_schema_paths`. |
| 66 | + // Each field at index i in this list must correspond to a field at the same |
| 67 | + // index in the `right_schema_paths` list. |
| 68 | + SchemaPaths left_schema_paths = 1; |
| 69 | + |
| 70 | + // An ordered list of fields for the join from the second table. |
| 71 | + // The size of this list must be the same as `left_schema_paths`. |
| 72 | + // Each field at index i in this list must correspond to a field at the same |
| 73 | + // index in the `left_schema_paths` list. |
| 74 | + SchemaPaths right_schema_paths = 2; |
| 75 | + |
| 76 | + // Optional. Sources which generated the schema relation edge. |
| 77 | + repeated Source sources = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 78 | + |
| 79 | + // Optional. A confidence score for the suggested relationship. |
| 80 | + // Manually added edges have the highest confidence score. |
| 81 | + float confidence_score = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 82 | + } |
| 83 | + |
| 84 | + // Optional. The basic entry point for data owners creating domain knowledge |
| 85 | + // for Agent. |
| 86 | + // |
| 87 | + // Why: Business jargon (e.g., YTD revenue is calculated as…, Retirement Age |
| 88 | + // is 65 in the USA, etc) and system instructions (e.g., answer like a Pirate) |
| 89 | + // can help the model understand the business context around a user question. |
| 90 | + string system_instruction = 1 [(google.api.field_behavior) = OPTIONAL]; |
| 91 | + |
| 92 | + // Required. Data sources that are available for answering the question. |
| 93 | + DatasourceReferences datasource_references = 7 |
| 94 | + [(google.api.field_behavior) = REQUIRED]; |
| 95 | + |
| 96 | + // Optional. Additional options for the conversation. |
| 97 | + ConversationOptions options = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 98 | + |
| 99 | + // Optional. A list of example queries, providing examples of relevant and |
| 100 | + // commonly used SQL queries and their corresponding natural language queries |
| 101 | + // optionally present. Currently only used for BigQuery data sources and |
| 102 | + // databases (alloydb, cloudsql, spanner) data sources. |
| 103 | + repeated ExampleQuery example_queries = 5 |
| 104 | + [(google.api.field_behavior) = OPTIONAL]; |
| 105 | + |
| 106 | + // Optional. A list of golden queries, providing examples of relevant and |
| 107 | + // commonly used Looker queries and their corresponding natural language |
| 108 | + // queries optionally present. Only supported for Looker data sources. |
| 109 | + repeated LookerGoldenQuery looker_golden_queries = 11 |
| 110 | + [(google.api.field_behavior) = OPTIONAL]; |
| 111 | + |
| 112 | + // Optional. Term definitions (currently, only user authored) |
| 113 | + // Not supported for databases (alloydb, cloudsql, spanner) data sources. |
| 114 | + repeated GlossaryTerm glossary_terms = 8 |
| 115 | + [(google.api.field_behavior) = OPTIONAL]; |
| 116 | + |
| 117 | + // Optional. Relationships between table schema, including referencing and |
| 118 | + // referenced columns. |
| 119 | + repeated SchemaRelationship schema_relationships = 9 |
| 120 | + [(google.api.field_behavior) = OPTIONAL]; |
| 121 | + |
| 122 | + // Optional. A collection of user functions to be included in context. |
| 123 | + UserFunctions user_functions = 10 [(google.api.field_behavior) = OPTIONAL]; |
| 124 | +} |
| 125 | + |
| 126 | +// A collection of user functions to be included in context. |
| 127 | +message UserFunctions { |
| 128 | + // A list of BigQuery routines to include in the context. |
| 129 | + repeated BigQueryRoutine bq_routines = 1; |
| 130 | +} |
| 131 | + |
| 132 | +// A reference to a BigQuery routine. |
| 133 | +message BigQueryRoutine { |
| 134 | + // The reference to the BigQuery routine. |
| 135 | + BigQueryRoutineReference routine_reference = 1; |
| 136 | + |
| 137 | + // User override or addition to description, to tell the agent when to use the |
| 138 | + // UDF. |
| 139 | + string description = 2; |
| 140 | +} |
| 141 | + |
| 142 | +// A reference to a BigQuery routine. |
| 143 | +message BigQueryRoutineReference { |
| 144 | + // The project ID of the routine. |
| 145 | + string project_id = 1; |
| 146 | + |
| 147 | + // The dataset ID of the routine. |
| 148 | + string dataset_id = 2; |
| 149 | + |
| 150 | + // The routine ID of the routine. |
| 151 | + string routine_id = 3; |
| 152 | + |
| 153 | + // Optional. The location to restrict BigQuery operations to. |
| 154 | + // |
| 155 | + // If unspecified, this value defaults to the location of the endpoint. |
| 156 | + // |
| 157 | + // Examples: "us-central1", "europe-west1". |
| 158 | + optional string boundary_location_id = 4 [ |
| 159 | + (google.api.field_behavior) = OPTIONAL, |
| 160 | + (google.api.resource_reference) = { |
| 161 | + type: "locations.googleapis.com/Location" |
| 162 | + } |
| 163 | + ]; |
| 164 | +} |
| 165 | + |
| 166 | +// Example of relevant and commonly used SQL query and its corresponding natural |
| 167 | +// language queries optionally present. Currently only used for BigQuery data |
| 168 | +// sources. |
| 169 | +message ExampleQuery { |
| 170 | + // The SQL or Looker query that should be generated to answer the natural |
| 171 | + // language query. |
| 172 | + oneof query { |
| 173 | + // Optional. The SQL query that should be generated to answer the natural |
| 174 | + // language question. For example: "SELECT COUNT(*) FROM orders WHERE |
| 175 | + // order_date BETWEEN '2024-01-01' AND '2024-01-31'" |
| 176 | + string sql_query = 101 [(google.api.field_behavior) = OPTIONAL]; |
| 177 | + } |
| 178 | + |
| 179 | + // Optional. A natural language question that a user might ask. |
| 180 | + // For example: "How many orders were placed last month?" |
| 181 | + string natural_language_question = 1 [(google.api.field_behavior) = OPTIONAL]; |
| 182 | +} |
| 183 | + |
| 184 | +// A matched query message represents the agent having matched one of the |
| 185 | +// example queries supplied in context as being applicable to the current |
| 186 | +// question. It will also contain additional info during the matching process. |
| 187 | +message MatchedQuery { |
| 188 | + // The query that was matched based on an example query. |
| 189 | + ExampleQuery example_query = 1; |
| 190 | + |
| 191 | + // The extracted values for the query parameters. |
| 192 | + repeated QueryParameterValues query_parameter_values = 2; |
| 193 | +} |
| 194 | + |
| 195 | +// A query parameter values message represents the values for the query |
| 196 | +// parameters that were extracted from the user question by LLM, based on the |
| 197 | +// example query. |
| 198 | +message QueryParameterValues { |
| 199 | + // Required. The name of the parameter. |
| 200 | + string name = 1 [(google.api.field_behavior) = REQUIRED]; |
| 201 | + |
| 202 | + // Required. The value of the parameter. |
| 203 | + string value = 2 [(google.api.field_behavior) = REQUIRED]; |
| 204 | +} |
| 205 | + |
| 206 | +// A golden query for Looker, including natural language questions and a |
| 207 | +// corresponding Looker Query. Analogous to ExampleQuery. |
| 208 | +message LookerGoldenQuery { |
| 209 | + // Optional. Natural language questions that a user might ask. |
| 210 | + // For example: "How many orders were placed last month?" |
| 211 | + repeated string natural_language_questions = 4 |
| 212 | + [(google.api.field_behavior) = OPTIONAL]; |
| 213 | + |
| 214 | + // Optional. The Looker Query corresponding to the natural language questions. |
| 215 | + LookerQuery looker_query = 5 [(google.api.field_behavior) = OPTIONAL]; |
| 216 | +} |
| 217 | + |
| 218 | +// Looker Query Object |
| 219 | +// [Looker API |
| 220 | +// documentation](https://cloud.google.com/looker/docs/reference/looker-api/latest/methods/Query/run_inline_query). |
| 221 | +message LookerQuery { |
| 222 | + // A Looker query filter. |
| 223 | + message Filter { |
| 224 | + // Required. The field to filter on. |
| 225 | + string field = 1 [(google.api.field_behavior) = REQUIRED]; |
| 226 | + |
| 227 | + // Optional. The value for the field to filter on. |
| 228 | + // Optional so we can preserve the default value as an empty |
| 229 | + // string, important to get a valid and working Looker Explore url. |
| 230 | + optional string value = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 231 | + } |
| 232 | + |
| 233 | + // Required. The LookML model used to generate the query. |
| 234 | + string model = 1 [(google.api.field_behavior) = REQUIRED]; |
| 235 | + |
| 236 | + // Required. The LookML explore used to generate the query. |
| 237 | + string explore = 2 [(google.api.field_behavior) = REQUIRED]; |
| 238 | + |
| 239 | + // Optional. The fields to retrieve from the explore. |
| 240 | + repeated string fields = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 241 | + |
| 242 | + // Optional. The filters to apply to the explore. |
| 243 | + repeated Filter filters = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 244 | + |
| 245 | + // Optional. The sorts to apply to the explore. |
| 246 | + repeated string sorts = 5 [(google.api.field_behavior) = OPTIONAL]; |
| 247 | + |
| 248 | + // Optional. Limit in the query. |
| 249 | + optional string limit = 6 [(google.api.field_behavior) = OPTIONAL]; |
| 250 | +} |
| 251 | + |
| 252 | +// Definition of a term within a specific domain. |
| 253 | +message GlossaryTerm { |
| 254 | + // Required. User friendly display name of the glossary term being defined. |
| 255 | + // For example: "CTR", "conversion rate", "pending" |
| 256 | + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; |
| 257 | + |
| 258 | + // Required. The description or meaning of the term. |
| 259 | + // For example: "Click-through rate", "The percentage of users who complete a |
| 260 | + // desired action", "An order that is waiting to be processed." |
| 261 | + string description = 2 [(google.api.field_behavior) = REQUIRED]; |
| 262 | + |
| 263 | + // Optional. A list of general purpose labels associated to this term. |
| 264 | + // For example: ["click rate", "clickthrough", "waiting"] |
| 265 | + repeated string labels = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 266 | +} |
| 267 | + |
| 268 | +// Options for the conversation. |
| 269 | +message ConversationOptions { |
| 270 | + // Optional. Options for analysis. |
| 271 | + AnalysisOptions analysis = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 272 | + |
| 273 | + // Optional. Options for datasources. |
| 274 | + DatasourceOptions datasource = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 275 | +} |
| 276 | + |
| 277 | +// Options for datasources configurations. |
| 278 | +message DatasourceOptions { |
| 279 | + // Optional. This option applies to datasources that require BigQuery queries |
| 280 | + // only. Limits the bytes billed for each BQ query job. Queries that will have |
| 281 | + // bytes billed beyond this limit will fail (without incurring a charge). |
| 282 | + // If unspecified, no limit will be applied. |
| 283 | + google.protobuf.Int64Value big_query_max_billed_bytes = 1 |
| 284 | + [(google.api.field_behavior) = OPTIONAL]; |
| 285 | +} |
| 286 | + |
| 287 | +// Options for analysis. |
| 288 | +message AnalysisOptions { |
| 289 | + // Options for Python analysis. |
| 290 | + message Python { |
| 291 | + // Optional. Whether to enable Python analysis. |
| 292 | + // Defaults to false. |
| 293 | + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; |
| 294 | + } |
| 295 | + |
| 296 | + // Optional. Options for Python analysis. |
| 297 | + Python python = 1 [(google.api.field_behavior) = OPTIONAL]; |
| 298 | +} |
| 299 | + |
| 300 | +// Source attributions for content. |
| 301 | +message Citation { |
| 302 | + // Output only. List of the sources being cited. |
| 303 | + repeated CitationSource sources = 1 |
| 304 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 305 | + |
| 306 | + // Output only. List of the anchors of the citations. |
| 307 | + repeated CitationAnchor anchors = 2 |
| 308 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 309 | +} |
| 310 | + |
| 311 | +// The source of the citation. |
| 312 | +message CitationSource { |
| 313 | + // The source of the citation, which can be one of the supported types. |
| 314 | + oneof source_type { |
| 315 | + // Output only. The uri used as the source, such as a web grounding URL. |
| 316 | + string uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 317 | + |
| 318 | + // Output only. The example query used as the source. |
| 319 | + ExampleQuery example_query = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 320 | + |
| 321 | + // Output only. The glossary term used as the source. |
| 322 | + GlossaryTerm glossary_term = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 323 | + } |
| 324 | + |
| 325 | + // Output only. Unique identifier of the source. This ID is service-generated |
| 326 | + // and is unique within the scope of a single `Citation` message. |
| 327 | + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 328 | + |
| 329 | + // Output only. The title of the source. |
| 330 | + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 331 | +} |
| 332 | + |
| 333 | +// The anchor of the citation. |
| 334 | +message CitationAnchor { |
| 335 | + // Citation anchor within a TextMessage. |
| 336 | + message TextMessageCitationAnchor { |
| 337 | + // Output only. The 0-based index of the part within the TextMessage.parts |
| 338 | + // field. |
| 339 | + int32 part_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 340 | + |
| 341 | + // Output only. The offset, measured in UTF-8 bytes, within the part string |
| 342 | + // where the citation begins (inclusive). Example: For the text "Hello, |
| 343 | + // world" where "world" is cited, the start offset bytes (inclusive) is 7 |
| 344 | + // and the end offset bytes (exclusive) is 12. |
| 345 | + int32 start_offset_bytes = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 346 | + |
| 347 | + // Output only. The offset, measured in UTF-8 bytes, within the part string |
| 348 | + // where the citation ends (exclusive). Example: For the text "Hello, world" |
| 349 | + // where "world" is cited, the start offset bytes (inclusive) is 7 and the |
| 350 | + // end offset bytes (exclusive) is 12. |
| 351 | + int32 end_offset_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 352 | + |
| 353 | + // Output only. The ids of the sources that are cited. |
| 354 | + repeated string source_ids = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 355 | + } |
| 356 | + |
| 357 | + // The anchor of the citation, which can be one of the supported types. |
| 358 | + oneof anchor_type { |
| 359 | + // Output only. Only set if the citation is for a TextMessage. |
| 360 | + TextMessageCitationAnchor text_message_anchor = 1 |
| 361 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 362 | + } |
| 363 | +} |
0 commit comments