|
| 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 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.dialogflow.cx.v3beta1; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/api/client.proto"; |
| 21 | +import "google/api/field_behavior.proto"; |
| 22 | +import "google/api/resource.proto"; |
| 23 | +import "google/protobuf/empty.proto"; |
| 24 | +import "google/protobuf/field_mask.proto"; |
| 25 | + |
| 26 | +option cc_enable_arenas = true; |
| 27 | +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; |
| 28 | +option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; |
| 29 | +option java_multiple_files = true; |
| 30 | +option java_outer_classname = "GeneratorProto"; |
| 31 | +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; |
| 32 | +option objc_class_prefix = "DF"; |
| 33 | + |
| 34 | +// Service for managing |
| 35 | +// [Generators][google.cloud.dialogflow.cx.v3beta1.Generator] |
| 36 | +service Generators { |
| 37 | + option (google.api.default_host) = "dialogflow.googleapis.com"; |
| 38 | + option (google.api.oauth_scopes) = |
| 39 | + "https://www.googleapis.com/auth/cloud-platform," |
| 40 | + "https://www.googleapis.com/auth/dialogflow"; |
| 41 | + |
| 42 | + // Returns the list of all generators in the specified agent. |
| 43 | + rpc ListGenerators(ListGeneratorsRequest) returns (ListGeneratorsResponse) { |
| 44 | + option (google.api.http) = { |
| 45 | + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators" |
| 46 | + }; |
| 47 | + option (google.api.method_signature) = "parent"; |
| 48 | + } |
| 49 | + |
| 50 | + // Retrieves the specified generator. |
| 51 | + rpc GetGenerator(GetGeneratorRequest) returns (Generator) { |
| 52 | + option (google.api.http) = { |
| 53 | + get: "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" |
| 54 | + }; |
| 55 | + option (google.api.method_signature) = "name"; |
| 56 | + } |
| 57 | + |
| 58 | + // Creates a generator in the specified agent. |
| 59 | + rpc CreateGenerator(CreateGeneratorRequest) returns (Generator) { |
| 60 | + option (google.api.http) = { |
| 61 | + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/generators" |
| 62 | + body: "generator" |
| 63 | + }; |
| 64 | + option (google.api.method_signature) = "parent,generator"; |
| 65 | + } |
| 66 | + |
| 67 | + // Update the specified generator. |
| 68 | + rpc UpdateGenerator(UpdateGeneratorRequest) returns (Generator) { |
| 69 | + option (google.api.http) = { |
| 70 | + patch: "/v3beta1/{generator.name=projects/*/locations/*/agents/*/generators/*}" |
| 71 | + body: "generator" |
| 72 | + }; |
| 73 | + option (google.api.method_signature) = "generator,update_mask"; |
| 74 | + } |
| 75 | + |
| 76 | + // Deletes the specified generators. |
| 77 | + rpc DeleteGenerator(DeleteGeneratorRequest) returns (google.protobuf.Empty) { |
| 78 | + option (google.api.http) = { |
| 79 | + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/generators/*}" |
| 80 | + }; |
| 81 | + option (google.api.method_signature) = "name"; |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +// Generators contain prompt to be sent to the LLM model to generate text. The |
| 86 | +// prompt can contain parameters which will be resolved before calling the |
| 87 | +// model. It can optionally contain banned phrases to ensure the model responses |
| 88 | +// are safe. |
| 89 | +message Generator { |
| 90 | + option (google.api.resource) = { |
| 91 | + type: "dialogflow.googleapis.com/Generator" |
| 92 | + pattern: "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" |
| 93 | + }; |
| 94 | + |
| 95 | + // Represents a custom placeholder in the prompt text. |
| 96 | + message Placeholder { |
| 97 | + // Unique ID used to map custom placeholder to parameters in fulfillment. |
| 98 | + string id = 1; |
| 99 | + |
| 100 | + // Custom placeholder value in the prompt text. |
| 101 | + string name = 2; |
| 102 | + } |
| 103 | + |
| 104 | + // The unique identifier of the generator. |
| 105 | + // Must be set for the |
| 106 | + // [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator] |
| 107 | + // method. [Generators.CreateGenerate][] populates the name automatically. |
| 108 | + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent |
| 109 | + // ID>/generators/<Generator ID>`. |
| 110 | + string name = 1; |
| 111 | + |
| 112 | + // Required. The human-readable name of the generator, unique within the |
| 113 | + // agent. The prompt contains pre-defined parameters such as $conversation, |
| 114 | + // $last-user-utterance, etc. populated by Dialogflow. It can also contain |
| 115 | + // custom placeholders which will be resolved during fulfillment. |
| 116 | + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; |
| 117 | + |
| 118 | + // Required. Prompt for the LLM model. |
| 119 | + Phrase prompt_text = 3 [(google.api.field_behavior) = REQUIRED]; |
| 120 | + |
| 121 | + // Optional. List of custom placeholders in the prompt text. |
| 122 | + repeated Placeholder placeholders = 5 |
| 123 | + [(google.api.field_behavior) = OPTIONAL]; |
| 124 | +} |
| 125 | + |
| 126 | +// Text input which can be used for prompt or banned phrases. |
| 127 | +message Phrase { |
| 128 | + // Required. Text input which can be used for prompt or banned phrases. |
| 129 | + string text = 1 [(google.api.field_behavior) = REQUIRED]; |
| 130 | +} |
| 131 | + |
| 132 | +// The request message for |
| 133 | +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. |
| 134 | +message ListGeneratorsRequest { |
| 135 | + // Required. The agent to list all generators for. |
| 136 | + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. |
| 137 | + string parent = 1 [ |
| 138 | + (google.api.field_behavior) = REQUIRED, |
| 139 | + (google.api.resource_reference) = { |
| 140 | + child_type: "dialogflow.googleapis.com/Generator" |
| 141 | + } |
| 142 | + ]; |
| 143 | + |
| 144 | + // The language to list generators for. |
| 145 | + string language_code = 2; |
| 146 | + |
| 147 | + // The maximum number of items to return in a single page. By default 100 and |
| 148 | + // at most 1000. |
| 149 | + int32 page_size = 3; |
| 150 | + |
| 151 | + // The next_page_token value returned from a previous list request. |
| 152 | + string page_token = 4; |
| 153 | +} |
| 154 | + |
| 155 | +// The response message for |
| 156 | +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. |
| 157 | +message ListGeneratorsResponse { |
| 158 | + // The list of generators. There will be a maximum number of items returned |
| 159 | + // based on the page_size field in the request. |
| 160 | + repeated Generator generators = 1; |
| 161 | + |
| 162 | + // Token to retrieve the next page of results, or empty if there are no more |
| 163 | + // results in the list. |
| 164 | + string next_page_token = 2; |
| 165 | +} |
| 166 | + |
| 167 | +// The request message for |
| 168 | +// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator]. |
| 169 | +message GetGeneratorRequest { |
| 170 | + // Required. The name of the generator. |
| 171 | + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent |
| 172 | + // ID>/generators/<Generator ID>`. |
| 173 | + string name = 1 [ |
| 174 | + (google.api.field_behavior) = REQUIRED, |
| 175 | + (google.api.resource_reference) = { |
| 176 | + type: "dialogflow.googleapis.com/Generator" |
| 177 | + } |
| 178 | + ]; |
| 179 | + |
| 180 | + // The language to list generators for. |
| 181 | + string language_code = 2; |
| 182 | +} |
| 183 | + |
| 184 | +// The request message for |
| 185 | +// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator]. |
| 186 | +message CreateGeneratorRequest { |
| 187 | + // Required. The agent to create a generator for. |
| 188 | + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. |
| 189 | + string parent = 1 [ |
| 190 | + (google.api.field_behavior) = REQUIRED, |
| 191 | + (google.api.resource_reference) = { |
| 192 | + child_type: "dialogflow.googleapis.com/Generator" |
| 193 | + } |
| 194 | + ]; |
| 195 | + |
| 196 | + // Required. The generator to create. |
| 197 | + Generator generator = 2 [(google.api.field_behavior) = REQUIRED]; |
| 198 | + |
| 199 | + // The language to create generators for the following fields: |
| 200 | + // * `Generator.prompt_text.text` |
| 201 | + // If not specified, the agent's default language is used. |
| 202 | + string language_code = 3; |
| 203 | +} |
| 204 | + |
| 205 | +// The request message for |
| 206 | +// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator]. |
| 207 | +message UpdateGeneratorRequest { |
| 208 | + // Required. The generator to update. |
| 209 | + Generator generator = 1 [(google.api.field_behavior) = REQUIRED]; |
| 210 | + |
| 211 | + // The language to list generators for. |
| 212 | + string language_code = 2; |
| 213 | + |
| 214 | + // The mask to control which fields get updated. If the mask is not present, |
| 215 | + // all fields will be updated. |
| 216 | + google.protobuf.FieldMask update_mask = 3; |
| 217 | +} |
| 218 | + |
| 219 | +// The request message for |
| 220 | +// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator]. |
| 221 | +message DeleteGeneratorRequest { |
| 222 | + // Required. The name of the generator to delete. |
| 223 | + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent |
| 224 | + // ID>/generators/<Generator ID>`. |
| 225 | + string name = 1 [ |
| 226 | + (google.api.field_behavior) = REQUIRED, |
| 227 | + (google.api.resource_reference) = { |
| 228 | + type: "dialogflow.googleapis.com/Generator" |
| 229 | + } |
| 230 | + ]; |
| 231 | + |
| 232 | + // This field has no effect for generators not being used. |
| 233 | + // For generators that are used by pages/flows/transition route groups: |
| 234 | + // |
| 235 | + // * If `force` is set to false, an error will be returned with message |
| 236 | + // indicating the referenced resources. |
| 237 | + // * If `force` is set to true, Dialogflow will remove the generator, as well |
| 238 | + // as any references to the generator (i.e. |
| 239 | + // [Generator][Fulfillment.generator]) in fulfillments. |
| 240 | + bool force = 2; |
| 241 | +} |
0 commit comments