@@ -22,10 +22,13 @@ import "google/api/field_behavior.proto";
2222import "google/api/resource.proto" ;
2323import "google/cloud/geminidataanalytics/v1alpha/datasource.proto" ;
2424
25+ option csharp_namespace = "Google.Cloud.GeminiDataAnalytics.V1Alpha" ;
2526option go_package = "cloud.google.com/go/geminidataanalytics/apiv1alpha/geminidataanalyticspb;geminidataanalyticspb" ;
2627option java_multiple_files = true ;
2728option java_outer_classname = "ContextRetrievalServiceProto" ;
2829option java_package = "com.google.cloud.geminidataanalytics.v1alpha" ;
30+ option php_namespace = "Google\\Cloud\\GeminiDataAnalytics\\V1alpha" ;
31+ option ruby_package = "Google::Cloud::GeminiDataAnalytics::V1alpha" ;
2932
3033// Service to ask a natural language question with a provided project,
3134// returns BigQuery tables that are relevant to the question within the project
@@ -47,14 +50,25 @@ service ContextRetrievalService {
4750 };
4851 }
4952
53+ // Retrieves BigQuery table contextual data for provided table references.
54+ // Contextual data includes table schema information as well as sample
55+ // values.
56+ rpc RetrieveBigQueryTableContexts (RetrieveBigQueryTableContextsRequest )
57+ returns (RetrieveBigQueryTableContextsResponse ) {
58+ option (google.api.http ) = {
59+ post : "/v1alpha/{parent=projects/*/locations/*}/retrieval:retrieveBigQueryTableContexts"
60+ body : "*"
61+ };
62+ }
63+
5064 // Retrieves BigQuery table contextual data from recently accessed tables.
5165 // Contextual data includes table schema information as well as sample
5266 // values.
5367 rpc RetrieveBigQueryTableContextsFromRecentTables (
5468 RetrieveBigQueryTableContextsFromRecentTablesRequest )
5569 returns (RetrieveBigQueryTableContextsFromRecentTablesResponse ) {
5670 option (google.api.http ) = {
57- post : "/v1alpha/{parent=projects/*/locations/*}:retrieveBigQueryTableContextsFromRecentTables"
71+ post : "/v1alpha/{parent=projects/*/locations/*}/retrieval :retrieveBigQueryTableContextsFromRecentTables"
5872 body : "*"
5973 };
6074 }
@@ -70,6 +84,16 @@ service ContextRetrievalService {
7084 };
7185 }
7286
87+ // Retrieves BigQuery table schema with suggested NL-SQL examples.
88+ rpc RetrieveBigQueryTableSuggestedExamples (
89+ RetrieveBigQueryTableSuggestedExamplesRequest )
90+ returns (RetrieveBigQueryTableSuggestedExamplesResponse ) {
91+ option (google.api.http ) = {
92+ post : "/v1alpha/{parent=projects/*/locations/*}/retrieval:retrieveBigQueryTableSuggestedExamples"
93+ body : "*"
94+ };
95+ }
96+
7397 // Retrieves BigQuery table references from recently accessed tables.
7498 rpc RetrieveBigQueryRecentRelevantTables (
7599 RetrieveBigQueryRecentRelevantTablesRequest )
@@ -83,11 +107,12 @@ service ContextRetrievalService {
83107
84108// Request for retrieving BigQuery table contextual data via direct lookup.
85109message RetrieveBigQueryTableContextRequest {
110+ // Required.
86111 string project = 5
87112 [deprecated = true , (google.api.field_behavior ) = REQUIRED ];
88113
89114 // Required. Parent value for RetrieveBigQueryTableContextRequest.
90- // Pattern: projects/{project}/locations/{location}
115+ // Pattern: ` projects/{project}/locations/{location}`
91116 // For location, use "global" for now. Regional location value will be
92117 // supported in the future.
93118 string parent = 6 [(google.api.field_behavior ) = REQUIRED ];
@@ -106,7 +131,7 @@ message RetrieveBigQueryTableContextResponse {
106131 message Candidate {
107132 // The fully qualified resource name of the candidate in its source system,
108133 // if applicable. E.g. for BigQuery tables, the format is:
109- // // bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
134+ // ` bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}`
110135 string linked_resource = 1 ;
111136
112137 // Content in string format.
@@ -120,13 +145,35 @@ message RetrieveBigQueryTableContextResponse {
120145 repeated TableCandidate table_candidates = 2 ;
121146}
122147
148+ // Request for retrieving BigQuery table contextual data via direct lookup.
149+ message RetrieveBigQueryTableContextsRequest {
150+ // Required. Parent value for RetrieveBigQueryTableContextRequest.
151+ // Pattern: `projects/{project}/locations/{location}`
152+ // For location, use "global" for now. Regional location value will be
153+ // supported in the future.
154+ string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
155+
156+ // Optional. User query in natural language.
157+ string query = 2 [(google.api.field_behavior ) = OPTIONAL ];
158+
159+ // Optional. A list of direct lookup parameters.
160+ repeated DirectLookup direct_lookups = 3
161+ [(google.api.field_behavior ) = OPTIONAL ];
162+ }
163+
164+ // Response for retrieving BigQuery table contextual data via direct lookup.
165+ message RetrieveBigQueryTableContextsResponse {
166+ // List of retrieved candidates with their bundled metadata.
167+ repeated TableCandidate table_candidates = 1 ;
168+ }
169+
123170// Request for retrieving BigQuery table contextual data from recently accessed
124171// tables. Response is sorted by semantic similarity to the query.
125172message RetrieveBigQueryTableContextsFromRecentTablesRequest {
126173 // Required. Parent value for
127174 // RetrieveBigQueryTableContextsFromRecentTablesRequest. Pattern:
128- // projects/{project}/locations/{location} For location, use "global" for now.
129- // Regional location value will be supported in the future.
175+ // ` projects/{project}/locations/{location}` For location, use "global" for
176+ // now. Regional location value will be supported in the future.
130177 string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
131178
132179 // Optional. User query in natural language.
@@ -145,8 +192,8 @@ message RetrieveBigQueryTableContextsFromRecentTablesResponse {
145192message RetrieveBigQueryTableSuggestedDescriptionsRequest {
146193 // Required. Parent value for
147194 // RetrieveBigQueryTableSuggestedDescriptionsRequest. Pattern:
148- // projects/{project}/locations/{location} For location, use "global" for now.
149- // Regional location value will be supported in the future.
195+ // ` projects/{project}/locations/{location}` For location, use "global" for
196+ // now. Regional location value will be supported in the future.
150197 string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
151198
152199 // Optional. A list of direct lookup parameters.
@@ -161,11 +208,42 @@ message RetrieveBigQueryTableSuggestedDescriptionsResponse {
161208 repeated TableCandidate table_candidates = 1 ;
162209}
163210
211+ // Request for retrieving BigQuery table schema with suggested NL-SQL examples.
212+ message RetrieveBigQueryTableSuggestedExamplesRequest {
213+ // Required. Parent value for RetrieveBigQueryTableSuggestedExamplesRequest.
214+ // Pattern: `projects/{project}/locations/{location}`
215+ // For location, use "global" for now. Regional location value will be
216+ // supported in the future.
217+ string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
218+
219+ // Optional. A list of direct lookup parameters.
220+ repeated DirectLookup direct_lookup = 2
221+ [(google.api.field_behavior ) = OPTIONAL ];
222+ }
223+
224+ // Request for retrieving BigQuery table schema with suggested NL-SQL examples.
225+ message RetrieveBigQueryTableSuggestedExamplesResponse {
226+ // A suggested BigQuery NL-SQL example for the given table.
227+ message ExampleSuggestion {
228+ // The natural language query.
229+ string nl_query = 1 ;
230+
231+ // The SQL answer to the query.
232+ string sql = 2 ;
233+
234+ // The linked table resources for the suggested example.
235+ repeated string linked_bigquery_tables = 3 ;
236+ }
237+
238+ // List of suggested examples.
239+ repeated ExampleSuggestion example_suggestions = 2 ;
240+ }
241+
164242// Request for retrieving BigQuery table references from recently accessed
165243// tables. Response is sorted by semantic similarity to the query.
166244message RetrieveBigQueryRecentRelevantTablesRequest {
167245 // Required. Parent value for RetrieveBigQueryRecentTablesRequest.
168- // Pattern: projects/{project}/locations/{location}
246+ // Pattern: ` projects/{project}/locations/{location}`
169247 // For location, use "global" for now. Regional location value will be
170248 // supported in the future.
171249 string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
@@ -207,7 +285,7 @@ message TableCandidate {
207285
208286 // The fully qualified resource name of the candidate in its source system,
209287 // if applicable. E.g. for BigQuery tables, the format is:
210- // // bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}.
288+ // ` bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` .
211289 string linked_resource = 1 ;
212290
213291 // In-context-learning string. For example, could be in DDL format.
0 commit comments