|
| 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