Skip to content

Commit 21cc946

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add session.proto and session_service.proto
PiperOrigin-RevId: 740406674
1 parent f36c475 commit 21cc946

4 files changed

Lines changed: 501 additions & 0 deletions

File tree

google/cloud/aiplatform/v1beta1/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ proto_library(
142142
"schedule.proto",
143143
"schedule_service.proto",
144144
"service_networking.proto",
145+
"session.proto",
146+
"session_service.proto",
145147
"specialist_pool.proto",
146148
"specialist_pool_service.proto",
147149
"study.proto",
@@ -273,6 +275,7 @@ java_gapic_test(
273275
"com.google.cloud.aiplatform.v1beta1.PredictionServiceClientTest",
274276
"com.google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClientTest",
275277
"com.google.cloud.aiplatform.v1beta1.ReasoningEngineServiceClientTest",
278+
"com.google.cloud.aiplatform.v1beta1.SessionServiceClientTest",
276279
"com.google.cloud.aiplatform.v1beta1.ScheduleServiceClientTest",
277280
"com.google.cloud.aiplatform.v1beta1.SpecialistPoolServiceClientTest",
278281
"com.google.cloud.aiplatform.v1beta1.TensorboardServiceClientTest",

google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ apis:
3434
- name: google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService
3535
- name: google.cloud.aiplatform.v1beta1.ReasoningEngineService
3636
- name: google.cloud.aiplatform.v1beta1.ScheduleService
37+
- name: google.cloud.aiplatform.v1beta1.SessionService
3738
- name: google.cloud.aiplatform.v1beta1.SpecialistPoolService
3839
- name: google.cloud.aiplatform.v1beta1.TensorboardService
3940
- name: google.cloud.aiplatform.v1beta1.VertexRagDataService
@@ -934,6 +935,10 @@ authentication:
934935
oauth:
935936
canonical_scopes: |-
936937
https://www.googleapis.com/auth/cloud-platform
938+
- selector: 'google.cloud.aiplatform.v1beta1.SessionService.*'
939+
oauth:
940+
canonical_scopes: |-
941+
https://www.googleapis.com/auth/cloud-platform
937942
- selector: 'google.cloud.aiplatform.v1beta1.SpecialistPoolService.*'
938943
oauth:
939944
canonical_scopes: |-
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
// Copyright 2025 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.aiplatform.v1beta1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/cloud/aiplatform/v1beta1/content.proto";
22+
import "google/protobuf/struct.proto";
23+
import "google/protobuf/timestamp.proto";
24+
25+
option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
26+
option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "SessionProto";
29+
option java_package = "com.google.cloud.aiplatform.v1beta1";
30+
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
31+
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
32+
33+
// A session contains a set of actions between users and Vertex agents.
34+
message Session {
35+
option (google.api.resource) = {
36+
type: "aiplatform.googleapis.com/Session"
37+
pattern: "projects/{project}/locations/{location}/sessions/{session}"
38+
pattern: "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}"
39+
plural: "sessions"
40+
singular: "session"
41+
};
42+
43+
// Required. Identifier. The resource name of the session.
44+
// Format:
45+
// 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
46+
string name = 1 [
47+
(google.api.field_behavior) = REQUIRED,
48+
(google.api.field_behavior) = IDENTIFIER
49+
];
50+
51+
// Output only. Timestamp when the session was created.
52+
google.protobuf.Timestamp create_time = 3
53+
[(google.api.field_behavior) = OUTPUT_ONLY];
54+
55+
// Output only. Timestamp when the session was updated.
56+
google.protobuf.Timestamp update_time = 4
57+
[(google.api.field_behavior) = OUTPUT_ONLY];
58+
59+
// Optional. The display name of the session.
60+
string display_name = 5 [(google.api.field_behavior) = OPTIONAL];
61+
62+
// Optional. Session specific memory which stores key conversation points.
63+
google.protobuf.Struct session_state = 10
64+
[(google.api.field_behavior) = OPTIONAL];
65+
66+
// Required. Immutable. String id provided by the user
67+
string user_id = 12 [
68+
(google.api.field_behavior) = IMMUTABLE,
69+
(google.api.field_behavior) = REQUIRED
70+
];
71+
}
72+
73+
// An event represents a message from either the user or agent.
74+
message SessionEvent {
75+
option (google.api.resource) = {
76+
type: "aiplatform.googleapis.com/SessionEvent"
77+
pattern: "projects/{project}/locations/{location}/sessions/{session}/events/{event}"
78+
pattern: "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}"
79+
plural: "sessionEvents"
80+
singular: "sessionEvent"
81+
};
82+
83+
// Required. Identifier. The resource name of the event.
84+
// Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
85+
string name = 1 [
86+
(google.api.field_behavior) = REQUIRED,
87+
(google.api.field_behavior) = IDENTIFIER
88+
];
89+
90+
// Required. The name of the agent that sent the event, or user.
91+
string author = 3 [(google.api.field_behavior) = REQUIRED];
92+
93+
// Optional. Content of the event provided by the author.
94+
Content content = 4 [(google.api.field_behavior) = OPTIONAL];
95+
96+
// Required. The invocation id of the event, multiple events can have the same
97+
// invocation id.
98+
string invocation_id = 5 [(google.api.field_behavior) = REQUIRED];
99+
100+
// Optional. Actions executed by the agent.
101+
EventActions actions = 6 [(google.api.field_behavior) = OPTIONAL];
102+
103+
// Required. Timestamp when the event was created on client side.
104+
google.protobuf.Timestamp timestamp = 8
105+
[(google.api.field_behavior) = REQUIRED];
106+
107+
// Optional. Error code if the response is an error. Code varies by model.
108+
string error_code = 9 [(google.api.field_behavior) = OPTIONAL];
109+
110+
// Optional. Error message if the response is an error.
111+
string error_message = 10 [(google.api.field_behavior) = OPTIONAL];
112+
113+
// Optional. Metadata relating to this event.
114+
EventMetadata event_metadata = 11 [(google.api.field_behavior) = OPTIONAL];
115+
}
116+
117+
// Metadata relating to a LLM response event.
118+
message EventMetadata {
119+
// Optional. Metadata returned to client when grounding is enabled.
120+
GroundingMetadata grounding_metadata = 1
121+
[(google.api.field_behavior) = OPTIONAL];
122+
123+
// Optional. Indicates whether the text content is part of a unfinished text
124+
// stream. Only used for streaming mode and when the content is plain text.
125+
bool partial = 2 [(google.api.field_behavior) = OPTIONAL];
126+
127+
// Optional. Indicates whether the response from the model is complete.
128+
// Only used for streaming mode.
129+
bool turn_complete = 3 [(google.api.field_behavior) = OPTIONAL];
130+
131+
// Optional. Flag indicating that LLM was interrupted when generating the
132+
// content. Usually it's due to user interruption during a bidi streaming.
133+
bool interrupted = 4 [(google.api.field_behavior) = OPTIONAL];
134+
135+
// Optional. Set of ids of the long running function calls.
136+
// Agent client will know from this field about which function call is long
137+
// running. Only valid for function call event.
138+
repeated string long_running_tool_ids = 5
139+
[(google.api.field_behavior) = OPTIONAL];
140+
141+
// Optional. The branch of the event.
142+
// The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
143+
// agent_2, and agent_2 is the parent of agent_3.
144+
// Branch is used when multiple child agents shouldn't see their siblings'
145+
// conversation history.
146+
string branch = 6 [(google.api.field_behavior) = OPTIONAL];
147+
}
148+
149+
// Actions are parts of events that are executed by the agent.
150+
message EventActions {
151+
// Optional. If true, it won't call model to summarize function response.
152+
// Only used for function_response event.
153+
bool skip_summarization = 1 [(google.api.field_behavior) = OPTIONAL];
154+
155+
// Optional. Indicates that the event is updating the state with the given
156+
// delta.
157+
google.protobuf.Struct state_delta = 2
158+
[(google.api.field_behavior) = OPTIONAL];
159+
160+
// Optional. Indicates that the event is updating an artifact. key is the
161+
// filename, value is the version.
162+
map<string, int32> artifact_delta = 3
163+
[(google.api.field_behavior) = OPTIONAL];
164+
165+
// Optional. If set, the event transfers to the specified agent.
166+
bool transfer_to_agent = 5 [(google.api.field_behavior) = OPTIONAL];
167+
168+
// Optional. The agent is escalating to a higher level agent.
169+
bool escalate = 6 [(google.api.field_behavior) = OPTIONAL];
170+
171+
// Optional. Will only be set by a tool response indicating tool request euc.
172+
// Struct key is the function call id since one function call response (from
173+
// model) could correspond to multiple function calls. Struct value is the
174+
// required auth config, which can be another struct.
175+
google.protobuf.Struct requested_auth_configs = 7
176+
[(google.api.field_behavior) = OPTIONAL];
177+
}

0 commit comments

Comments
 (0)