-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [dialogflow-cx] added Generator API (#4837)
* feat: add agent answer feedback capability feat: add fields for supporting barge-in in StreamingDetectIntent API feat: add end_user_metadata to QueryParameters feat: add boost & bury and filter ES controls PiperOrigin-RevId: 583522403 Source-Link: googleapis/googleapis@86c7ca6 Source-Link: googleapis/googleapis-gen@42f2c6e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6IjQyZjJjNmU5NzlhMWQyYTZmYWVkZDc3MmUyM2Q0OWU2ZWYwMTk0NzAifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add agent answer feedback capability feat: add fields for supporting barge-in in StreamingDetectIntent API feat: add end_user_metadata to QueryParameters feat: add boost & bury and filter ES controls PiperOrigin-RevId: 583523426 Source-Link: googleapis/googleapis@c73d0da Source-Link: googleapis/googleapis-gen@1b5ed29 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6IjFiNWVkMjk0OThiMzRlMTAxNmUxZjY5ZWNiMjgwODE2OGJkMzRkMTUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added Generator API docs: updated doc for speech model PiperOrigin-RevId: 586288282 Source-Link: googleapis/googleapis@17d36c4 Source-Link: googleapis/googleapis-gen@e2fb5ba Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6ImUyZmI1YmFiZmVjOTJmNzVmMTdmMzFmOTBiNjViYTVmZjNkNjkwOTUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added Generator API docs: updated doc for speech mode PiperOrigin-RevId: 586469693 Source-Link: googleapis/googleapis@e8148d6 Source-Link: googleapis/googleapis-gen@85136bd Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: sofisl <[email protected]>
- Loading branch information
1 parent
061e9a8
commit 34ddf57
Showing
144 changed files
with
75,697 additions
and
37,905 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
240 changes: 240 additions & 0 deletions
240
packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generator.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,240 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.cloud.dialogflow.cx.v3; | ||
|
||
import "google/api/annotations.proto"; | ||
import "google/api/client.proto"; | ||
import "google/api/field_behavior.proto"; | ||
import "google/api/resource.proto"; | ||
import "google/protobuf/empty.proto"; | ||
import "google/protobuf/field_mask.proto"; | ||
|
||
option cc_enable_arenas = true; | ||
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; | ||
option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "GeneratorProto"; | ||
option java_package = "com.google.cloud.dialogflow.cx.v3"; | ||
option objc_class_prefix = "DF"; | ||
|
||
// Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator] | ||
service Generators { | ||
option (google.api.default_host) = "dialogflow.googleapis.com"; | ||
option (google.api.oauth_scopes) = | ||
"https://www.googleapis.com/auth/cloud-platform," | ||
"https://www.googleapis.com/auth/dialogflow"; | ||
|
||
// Returns the list of all generators in the specified agent. | ||
rpc ListGenerators(ListGeneratorsRequest) returns (ListGeneratorsResponse) { | ||
option (google.api.http) = { | ||
get: "/v3/{parent=projects/*/locations/*/agents/*}/generators" | ||
}; | ||
option (google.api.method_signature) = "parent"; | ||
} | ||
|
||
// Retrieves the specified generator. | ||
rpc GetGenerator(GetGeneratorRequest) returns (Generator) { | ||
option (google.api.http) = { | ||
get: "/v3/{name=projects/*/locations/*/agents/*/generators/*}" | ||
}; | ||
option (google.api.method_signature) = "name"; | ||
} | ||
|
||
// Creates a generator in the specified agent. | ||
rpc CreateGenerator(CreateGeneratorRequest) returns (Generator) { | ||
option (google.api.http) = { | ||
post: "/v3/{parent=projects/*/locations/*/agents/*}/generators" | ||
body: "generator" | ||
}; | ||
option (google.api.method_signature) = "parent,generator"; | ||
} | ||
|
||
// Update the specified generator. | ||
rpc UpdateGenerator(UpdateGeneratorRequest) returns (Generator) { | ||
option (google.api.http) = { | ||
patch: "/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}" | ||
body: "generator" | ||
}; | ||
option (google.api.method_signature) = "generator,update_mask"; | ||
} | ||
|
||
// Deletes the specified generators. | ||
rpc DeleteGenerator(DeleteGeneratorRequest) returns (google.protobuf.Empty) { | ||
option (google.api.http) = { | ||
delete: "/v3/{name=projects/*/locations/*/agents/*/generators/*}" | ||
}; | ||
option (google.api.method_signature) = "name"; | ||
} | ||
} | ||
|
||
// Generators contain prompt to be sent to the LLM model to generate text. The | ||
// prompt can contain parameters which will be resolved before calling the | ||
// model. It can optionally contain banned phrases to ensure the model responses | ||
// are safe. | ||
message Generator { | ||
option (google.api.resource) = { | ||
type: "dialogflow.googleapis.com/Generator" | ||
pattern: "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}" | ||
}; | ||
|
||
// Represents a custom placeholder in the prompt text. | ||
message Placeholder { | ||
// Unique ID used to map custom placeholder to parameters in fulfillment. | ||
string id = 1; | ||
|
||
// Custom placeholder value in the prompt text. | ||
string name = 2; | ||
} | ||
|
||
// The unique identifier of the generator. | ||
// Must be set for the | ||
// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator] | ||
// method. [Generators.CreateGenerate][] populates the name automatically. | ||
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent | ||
// ID>/generators/<Generator ID>`. | ||
string name = 1; | ||
|
||
// Required. The human-readable name of the generator, unique within the | ||
// agent. The prompt contains pre-defined parameters such as $conversation, | ||
// $last-user-utterance, etc. populated by Dialogflow. It can also contain | ||
// custom placeholders which will be resolved during fulfillment. | ||
string display_name = 2 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// Required. Prompt for the LLM model. | ||
Phrase prompt_text = 3 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// Optional. List of custom placeholders in the prompt text. | ||
repeated Placeholder placeholders = 5 | ||
[(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// Text input which can be used for prompt or banned phrases. | ||
message Phrase { | ||
// Required. Text input which can be used for prompt or banned phrases. | ||
string text = 1 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// The request message for | ||
// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators]. | ||
message ListGeneratorsRequest { | ||
// Required. The agent to list all generators for. | ||
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. | ||
string parent = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
child_type: "dialogflow.googleapis.com/Generator" | ||
} | ||
]; | ||
|
||
// The language to list generators for. | ||
string language_code = 2; | ||
|
||
// The maximum number of items to return in a single page. By default 100 and | ||
// at most 1000. | ||
int32 page_size = 3; | ||
|
||
// The next_page_token value returned from a previous list request. | ||
string page_token = 4; | ||
} | ||
|
||
// The response message for | ||
// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators]. | ||
message ListGeneratorsResponse { | ||
// The list of generators. There will be a maximum number of items returned | ||
// based on the page_size field in the request. | ||
repeated Generator generators = 1; | ||
|
||
// Token to retrieve the next page of results, or empty if there are no more | ||
// results in the list. | ||
string next_page_token = 2; | ||
} | ||
|
||
// The request message for | ||
// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3.Generators.GetGenerator]. | ||
message GetGeneratorRequest { | ||
// Required. The name of the generator. | ||
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent | ||
// ID>/generators/<Generator ID>`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
type: "dialogflow.googleapis.com/Generator" | ||
} | ||
]; | ||
|
||
// The language to list generators for. | ||
string language_code = 2; | ||
} | ||
|
||
// The request message for | ||
// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3.Generators.CreateGenerator]. | ||
message CreateGeneratorRequest { | ||
// Required. The agent to create a generator for. | ||
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. | ||
string parent = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
child_type: "dialogflow.googleapis.com/Generator" | ||
} | ||
]; | ||
|
||
// Required. The generator to create. | ||
Generator generator = 2 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// The language to create generators for the following fields: | ||
// * `Generator.prompt_text.text` | ||
// If not specified, the agent's default language is used. | ||
string language_code = 3; | ||
} | ||
|
||
// The request message for | ||
// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator]. | ||
message UpdateGeneratorRequest { | ||
// Required. The generator to update. | ||
Generator generator = 1 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// The language to list generators for. | ||
string language_code = 2; | ||
|
||
// The mask to control which fields get updated. If the mask is not present, | ||
// all fields will be updated. | ||
google.protobuf.FieldMask update_mask = 3; | ||
} | ||
|
||
// The request message for | ||
// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3.Generators.DeleteGenerator]. | ||
message DeleteGeneratorRequest { | ||
// Required. The name of the generator to delete. | ||
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent | ||
// ID>/generators/<Generator ID>`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
type: "dialogflow.googleapis.com/Generator" | ||
} | ||
]; | ||
|
||
// This field has no effect for generators not being used. | ||
// For generators that are used by pages/flows/transition route groups: | ||
// | ||
// * If `force` is set to false, an error will be returned with message | ||
// indicating the referenced resources. | ||
// * If `force` is set to true, Dialogflow will remove the generator, as well | ||
// as any references to the generator (i.e. | ||
// [Generator][Fulfillment.generator]) in fulfillments. | ||
bool force = 2; | ||
} |
Oops, something went wrong.