1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.aiplatform.v1beta1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/aiplatform/v1beta1/content.proto"; 24import "google/cloud/aiplatform/v1beta1/extension.proto"; 25import "google/protobuf/struct.proto"; 26 27option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 28option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 29option java_multiple_files = true; 30option java_outer_classname = "ExtensionExecutionServiceProto"; 31option java_package = "com.google.cloud.aiplatform.v1beta1"; 32option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 33option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 34 35// A service for Extension execution. 36service ExtensionExecutionService { 37 option (google.api.default_host) = "aiplatform.googleapis.com"; 38 option (google.api.oauth_scopes) = 39 "https://www.googleapis.com/auth/cloud-platform"; 40 41 // Executes the request against a given extension. 42 rpc ExecuteExtension(ExecuteExtensionRequest) 43 returns (ExecuteExtensionResponse) { 44 option (google.api.http) = { 45 post: "/v1beta1/{name=projects/*/locations/*/extensions/*}:execute" 46 body: "*" 47 }; 48 option (google.api.method_signature) = "name,operation_id"; 49 } 50 51 // Queries an extension with a default controller. 52 rpc QueryExtension(QueryExtensionRequest) returns (QueryExtensionResponse) { 53 option (google.api.http) = { 54 post: "/v1beta1/{name=projects/*/locations/*/extensions/*}:query" 55 body: "*" 56 }; 57 option (google.api.method_signature) = "name,contents"; 58 } 59} 60 61// Request message for 62// [ExtensionExecutionService.ExecuteExtension][google.cloud.aiplatform.v1beta1.ExtensionExecutionService.ExecuteExtension]. 63message ExecuteExtensionRequest { 64 // Required. Name (identifier) of the extension; 65 // Format: 66 // `projects/{project}/locations/{location}/extensions/{extension}` 67 string name = 1 [ 68 (google.api.field_behavior) = REQUIRED, 69 (google.api.resource_reference) = { 70 type: "aiplatform.googleapis.com/Extension" 71 } 72 ]; 73 74 // Required. The desired ID of the operation to be executed in this extension 75 // as defined in 76 // [ExtensionOperation.operation_id][google.cloud.aiplatform.v1beta1.ExtensionOperation.operation_id]. 77 string operation_id = 2 [(google.api.field_behavior) = REQUIRED]; 78 79 // Optional. Request parameters that will be used for executing this 80 // operation. 81 // 82 // The struct should be in a form of map with param name as the key and actual 83 // param value as the value. 84 // E.g. If this operation requires a param "name" to be set to "abc". you can 85 // set this to something like {"name": "abc"}. 86 google.protobuf.Struct operation_params = 3 87 [(google.api.field_behavior) = OPTIONAL]; 88 89 // Optional. Auth config provided at runtime to override the default value in 90 // [Extension.manifest.auth_config][]. 91 // The AuthConfig.auth_type should match the value in 92 // [Extension.manifest.auth_config][]. 93 AuthConfig runtime_auth_config = 4 [(google.api.field_behavior) = OPTIONAL]; 94} 95 96// Response message for 97// [ExtensionExecutionService.ExecuteExtension][google.cloud.aiplatform.v1beta1.ExtensionExecutionService.ExecuteExtension]. 98message ExecuteExtensionResponse { 99 // Response content from the extension. The content should be conformant to 100 // the response.content schema in the extension's manifest/OpenAPI spec. 101 string content = 2; 102} 103 104// Request message for 105// [ExtensionExecutionService.QueryExtension][google.cloud.aiplatform.v1beta1.ExtensionExecutionService.QueryExtension]. 106message QueryExtensionRequest { 107 // Required. Name (identifier) of the extension; 108 // Format: 109 // `projects/{project}/locations/{location}/extensions/{extension}` 110 string name = 1 [ 111 (google.api.field_behavior) = REQUIRED, 112 (google.api.resource_reference) = { 113 type: "aiplatform.googleapis.com/Extension" 114 } 115 ]; 116 117 // Required. The content of the current conversation with the model. 118 // 119 // For single-turn queries, this is a single instance. For multi-turn queries, 120 // this is a repeated field that contains conversation history + latest 121 // request. 122 repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; 123} 124 125// Response message for 126// [ExtensionExecutionService.QueryExtension][google.cloud.aiplatform.v1beta1.ExtensionExecutionService.QueryExtension]. 127message QueryExtensionResponse { 128 // Steps of extension or LLM interaction, can contain function call, 129 // function response, or text response. The last step contains the final 130 // response to the query. 131 repeated Content steps = 1; 132 133 // Failure message if any. 134 string failure_message = 2; 135} 136