Skip to content

Commit 2223580

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding a new SchemaRelationship message to define relationships between table schema
feat: Adding a new TextType PROGRESS to provide informational messages about an agent's progress for supporting more granular Agent RAG tools feat: Adding struct_schema to Datasource to support flexible schemas, particularly for Looker datasources feat: Adding client_managed_resource_context to allow clients to manage their own conversation and agent resources feat: Adding a DeleteConversation RPC to allow for the deletion of conversations feat: Adding a GlossaryTerm message to allow users to provide definitions for domain-specific terms feat: Adding an ExampleQueries message to surface derived and authored example queries feat: Adding DatasourceOptions to provide configuration options for datasources feat: Adding support for LookerQuery within the DataQuery message for retrieving data from Looker explores PiperOrigin-RevId: 829449036
1 parent 9fcfbea commit 2223580

File tree

7 files changed

+221
-13
lines changed

7 files changed

+221
-13
lines changed

google/cloud/geminidataanalytics/v1beta/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ proto_library(
4646
"@com_google_protobuf//:field_mask_proto",
4747
"@com_google_protobuf//:struct_proto",
4848
"@com_google_protobuf//:timestamp_proto",
49+
"@com_google_protobuf//:wrappers_proto",
4950
],
5051
)
5152

@@ -353,6 +354,7 @@ load(
353354

354355
csharp_proto_library(
355356
name = "geminidataanalytics_csharp_proto",
357+
extra_opts = [],
356358
deps = [":geminidataanalytics_proto"],
357359
)
358360

google/cloud/geminidataanalytics/v1beta/context.proto

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package google.cloud.geminidataanalytics.v1beta;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/cloud/geminidataanalytics/v1beta/datasource.proto";
21+
import "google/protobuf/wrappers.proto";
2122

2223
option csharp_namespace = "Google.Cloud.GeminiDataAnalytics.V1Beta";
2324
option go_package = "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb;geminidataanalyticspb";
@@ -29,6 +30,56 @@ option ruby_package = "Google::Cloud::GeminiDataAnalytics::V1beta";
2930

3031
// A collection of context to apply to this conversation
3132
message Context {
33+
// The relationship between two tables, including referencing and referenced
34+
// columns. This is a derived context retrieved from Dataplex Dataset
35+
// Insights.
36+
message SchemaRelationship {
37+
// Represents an ordered set of paths within the table schema.
38+
message SchemaPaths {
39+
// The service-qualified full resource name of the table
40+
// Ex:
41+
// bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
42+
string table_fqn = 1;
43+
44+
// The ordered list of paths within the table schema.
45+
repeated string paths = 2;
46+
}
47+
48+
// Source which generated the schema relation edge.
49+
enum Source {
50+
// The source of the schema relationship is unspecified.
51+
SOURCE_UNSPECIFIED = 0;
52+
53+
// The source of the schema relationship is BigQuery job history.
54+
BIGQUERY_JOB_HISTORY = 1;
55+
56+
// The source of the schema relationship is LLM suggested.
57+
LLM_SUGGESTED = 2;
58+
59+
// The source of the schema relationship is BigQuery table constraints.
60+
BIGQUERY_TABLE_CONSTRAINTS = 3;
61+
}
62+
63+
// An ordered list of fields for the join from the first table.
64+
// The size of this list must be the same as `right_schema_paths`.
65+
// Each field at index i in this list must correspond to a field at the same
66+
// index in the `right_schema_paths` list.
67+
SchemaPaths left_schema_paths = 1;
68+
69+
// An ordered list of fields for the join from the second table.
70+
// The size of this list must be the same as `left_schema_paths`.
71+
// Each field at index i in this list must correspond to a field at the same
72+
// index in the `left_schema_paths` list.
73+
SchemaPaths right_schema_paths = 2;
74+
75+
// Sources which generated the schema relation edge.
76+
repeated Source sources = 3;
77+
78+
// A confidence score for the suggested relationship.
79+
// Manually added edges have the highest confidence score.
80+
float confidence_score = 4;
81+
}
82+
3283
// Optional. The basic entry point for data owners creating domain knowledge
3384
// for Agent.
3485
//
@@ -46,13 +97,23 @@ message Context {
4697

4798
// Optional. A list of example queries, providing examples of relevant and
4899
// commonly used SQL queries and their corresponding natural language queries
49-
// optionally present.
100+
// optionally present. Currently only used for BigQuery data sources.
50101
repeated ExampleQuery example_queries = 5
51102
[(google.api.field_behavior) = OPTIONAL];
103+
104+
// Optional. Term definitions (currently, only user authored)
105+
repeated GlossaryTerm glossary_terms = 8
106+
[(google.api.field_behavior) = OPTIONAL];
107+
108+
// Optional. Relationships between table schema, including referencing and
109+
// referenced columns.
110+
repeated SchemaRelationship schema_relationships = 9
111+
[(google.api.field_behavior) = OPTIONAL];
52112
}
53113

54114
// Example of relevant and commonly used SQL query and its corresponding natural
55-
// language queries optionally present.
115+
// language queries optionally present. Currently only used for BigQuery data
116+
// sources.
56117
message ExampleQuery {
57118
// The SQL or Looker query that should be generated to answer the natural
58119
// language query.
@@ -68,13 +129,42 @@ message ExampleQuery {
68129
string natural_language_question = 1 [(google.api.field_behavior) = OPTIONAL];
69130
}
70131

132+
// Definition of a term within a specific domain.
133+
message GlossaryTerm {
134+
// Required. User friendly display name of the glossary term being defined.
135+
// For example: "CTR", "conversion rate", "pending"
136+
string display_name = 1 [(google.api.field_behavior) = REQUIRED];
137+
138+
// Required. The description or meaning of the term.
139+
// For example: "Click-through rate", "The percentage of users who complete a
140+
// desired action", "An order that is waiting to be processed."
141+
string description = 2 [(google.api.field_behavior) = REQUIRED];
142+
143+
// Optional. A list of general purpose labels associated to this term.
144+
// For example: ["click rate", "clickthrough", "waiting"]
145+
repeated string labels = 3 [(google.api.field_behavior) = OPTIONAL];
146+
}
147+
71148
// Options for the conversation.
72149
message ConversationOptions {
73150
// Optional. Options for chart generation.
74151
ChartOptions chart = 1 [(google.api.field_behavior) = OPTIONAL];
75152

76153
// Optional. Options for analysis.
77154
AnalysisOptions analysis = 2 [(google.api.field_behavior) = OPTIONAL];
155+
156+
// Optional. Options for datasources.
157+
DatasourceOptions datasource = 3 [(google.api.field_behavior) = OPTIONAL];
158+
}
159+
160+
// Options for datasources configurations.
161+
message DatasourceOptions {
162+
// Optional. This option applies to datasources that require BigQuery queries
163+
// only. Limits the bytes billed for each BQ query job. Queries that will have
164+
// bytes billed beyond this limit will fail (without incurring a charge).
165+
// If unspecified, no limit will be applied.
166+
google.protobuf.Int64Value big_query_max_billed_bytes = 1
167+
[(google.api.field_behavior) = OPTIONAL];
78168
}
79169

80170
// Options for chart generation.

google/cloud/geminidataanalytics/v1beta/conversation.proto

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ message Conversation {
4545
// https://google.aip.dev/122#resource-id-segments
4646
//
4747
// Example:
48-
// `projects/1234567890/locations/us-central1/conversations/my-conversation`.
48+
// `projects/1234567890/locations/global/conversations/my-conversation`.
4949
//
5050
// It is recommended to skip setting this field during conversation creation
5151
// as it will be inferred automatically and overwritten with the
@@ -139,7 +139,7 @@ message ListConversationsRequest {
139139

140140
// Optional. Returned conversations will match criteria specified within the
141141
// filter. ListConversations allows filtering by:
142-
// * agent_id
142+
// * agents
143143
// * labels
144144
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
145145
}
@@ -152,3 +152,16 @@ message ListConversationsResponse {
152152
// A token identifying a page of results the server should return.
153153
string next_page_token = 2;
154154
}
155+
156+
// Request for deleting a conversation based on parent and conversation id.
157+
message DeleteConversationRequest {
158+
// Required. Name of the resource.
159+
// Format:
160+
// `projects/{project}/locations/{location}/conversations/{conversation}`
161+
string name = 1 [
162+
(google.api.field_behavior) = REQUIRED,
163+
(google.api.resource_reference) = {
164+
type: "geminidataanalytics.googleapis.com/Conversation"
165+
}
166+
];
167+
}

google/cloud/geminidataanalytics/v1beta/data_agent.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ message DataAgent {
5353
// must match the format described in
5454
// https://google.aip.dev/122#resource-id-segments
5555
//
56-
// Example: `projects/1234567890/locations/us-central1/dataAgents/my-agent`.
56+
// Example: `projects/1234567890/locations/global/dataAgents/my-agent`.
5757
//
5858
// It is recommended to skip setting this field during agent creation as it
5959
// will be inferred automatically and overwritten with the

google/cloud/geminidataanalytics/v1beta/data_chat_service.proto

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import "google/cloud/geminidataanalytics/v1beta/context.proto";
2424
import "google/cloud/geminidataanalytics/v1beta/conversation.proto";
2525
import "google/cloud/geminidataanalytics/v1beta/credentials.proto";
2626
import "google/cloud/geminidataanalytics/v1beta/datasource.proto";
27+
import "google/protobuf/empty.proto";
2728
import "google/protobuf/struct.proto";
2829
import "google/protobuf/timestamp.proto";
2930

@@ -63,6 +64,15 @@ service DataChatService {
6364
"parent,conversation,conversation_id";
6465
}
6566

67+
// Deletes a conversation.
68+
rpc DeleteConversation(DeleteConversationRequest)
69+
returns (google.protobuf.Empty) {
70+
option (google.api.http) = {
71+
delete: "/v1beta/{name=projects/*/locations/*/conversations/*}"
72+
};
73+
option (google.api.method_signature) = "name";
74+
}
75+
6676
// Gets details of a single conversation by using conversation id and parent.
6777
rpc GetConversation(GetConversationRequest) returns (Conversation) {
6878
option (google.api.http) = {
@@ -159,6 +169,13 @@ message ChatRequest {
159169
// statelessly, without managed conversation persistence.
160170
DataAgentContext data_agent_context = 104
161171
[(google.api.field_behavior) = OPTIONAL];
172+
173+
// Optional. Context with client managed resources.
174+
// Some clients may not use GDA managed resources including
175+
// conversations and agents, instead they create and manage their own
176+
// conversations and agents resources.
177+
ClientManagedResourceContext client_managed_resource_context = 105
178+
[(google.api.field_behavior) = OPTIONAL];
162179
}
163180

164181
// Optional. The Google Cloud project to be used for quota and billing.
@@ -233,6 +250,22 @@ message ConversationReference {
233250
[(google.api.field_behavior) = REQUIRED];
234251
}
235252

253+
// Context with client managed resources.
254+
// Some clients may not use GDA managed resources including
255+
// conversations and agents, instead they create and manage their own
256+
// conversations and agents resources.
257+
message ClientManagedResourceContext {
258+
// Required. Context for the chat request. Use this to chat without GDA API
259+
// managed conversation and agent persistence by passing all context inline.
260+
Context inline_context = 1 [(google.api.field_behavior) = REQUIRED];
261+
262+
// Optional. The client managed conversation id.
263+
string conversation_id = 2 [(google.api.field_behavior) = OPTIONAL];
264+
265+
// Optional. The client managed agent id.
266+
string agent_id = 3 [(google.api.field_behavior) = OPTIONAL];
267+
}
268+
236269
// A message from an interaction between the user and the system.
237270
message Message {
238271
// The kind of message.
@@ -286,6 +319,10 @@ message SystemMessage {
286319

287320
// An error message.
288321
ErrorMessage error = 6;
322+
323+
// Optional. A message containing example queries.
324+
ExampleQueries example_queries = 13
325+
[(google.api.field_behavior) = OPTIONAL];
289326
}
290327

291328
// Identifies the group that the event belongs to. Similar events are deemed
@@ -296,8 +333,30 @@ message SystemMessage {
296333

297334
// A multi-part text message.
298335
message TextMessage {
336+
// The type of the text message.
337+
enum TextType {
338+
// The default text type.
339+
TEXT_TYPE_UNSPECIFIED = 0;
340+
341+
// The text is a final response to the user question.
342+
FINAL_RESPONSE = 1;
343+
344+
// The text is a thinking plan generated by the thinking tool.
345+
THOUGHT = 2;
346+
347+
// The text is an informational message about the agent's progress, such as
348+
// a tool being invoked. This is distinct from the agent's internal thought
349+
// process (`THOUGHT`) and the final answer to the user
350+
// (`FINAL_RESPONSE`). These messages provide insight into the agent's
351+
// actions.
352+
PROGRESS = 3;
353+
}
354+
299355
// Optional. The parts of the message.
300356
repeated string parts = 1 [(google.api.field_behavior) = OPTIONAL];
357+
358+
// Optional. The type of the text message.
359+
TextType text_type = 2 [(google.api.field_behavior) = OPTIONAL];
301360
}
302361

303362
// A message produced during schema resolution.
@@ -340,7 +399,8 @@ message DataMessage {
340399
DataResult result = 3;
341400

342401
// Looker Query generated by the system to retrieve data.
343-
LookerQuery generated_looker_query = 4;
402+
// DEPRECATED: generated looker query is now under DataQuery.looker.
403+
LookerQuery generated_looker_query = 4 [deprecated = true];
344404

345405
// A BigQuery job executed by the system to retrieve data.
346406
BigQueryJob big_query_job = 5;
@@ -381,6 +441,12 @@ message LookerQuery {
381441

382442
// A query for retrieving data.
383443
message DataQuery {
444+
// The type of query to execute.
445+
oneof query_type {
446+
// Optional. A query for retrieving data from a Looker explore.
447+
LookerQuery looker = 4 [(google.api.field_behavior) = OPTIONAL];
448+
}
449+
384450
// Optional. A natural language question to answer.
385451
string question = 1 [(google.api.field_behavior) = OPTIONAL];
386452

@@ -543,12 +609,35 @@ message ChartResult {
543609
Blob image = 3 [(google.api.field_behavior) = OPTIONAL];
544610
}
545611

546-
// An error message.
612+
// An error message from a tool call.
613+
// This message is used to represent an error that occurred while an agent was
614+
// trying to use a tool. It's important to note that not all errors are
615+
// terminal. Many are recoverable, and the agent may use the information from
616+
// this error message to self-correct and retry the tool call or try a
617+
// different approach.
618+
//
619+
// For example, if a data query fails, the agent might receive an
620+
// `ErrorMessage`, analyze it, and then generate a corrected query.
621+
//
622+
// Clients should be cautious about interpreting this message as a definitive
623+
// failure. It can be part of the agent's normal, iterative process of
624+
// completing a task. Surfacing these errors directly to end-users without
625+
// context (e.g., as a "hard failure") may be misleading.
547626
message ErrorMessage {
548627
// Output only. The text of the error.
549628
string text = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
550629
}
551630

631+
// A message containing derived and authored example queries.
632+
message ExampleQueries {
633+
// Optional. A list of derived and authored example queries, providing
634+
// examples of relevant and commonly used SQL queries and their corresponding
635+
// natural language queries optionally present. Currently only used for
636+
// BigQuery data sources.
637+
repeated ExampleQuery example_queries = 1
638+
[(google.api.field_behavior) = OPTIONAL];
639+
}
640+
552641
// A blob of data with a MIME type.
553642
message Blob {
554643
// Required. The IANA standard MIME type of the message data.

0 commit comments

Comments
 (0)