diff --git a/google/cloud/dialogflow/cx/v3beta1/BUILD.bazel b/google/cloud/dialogflow/cx/v3beta1/BUILD.bazel new file mode 100644 index 00000000..feb73418 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/BUILD.bazel @@ -0,0 +1,419 @@ +# This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel + +# Most of the manual changes to this file will be overwritten. +# It's **only** allowed to change the following rule attribute values: +# - names of *_gapic_assembly_* rules +# - certain parameters of *_gapic_library rules, including but not limited to: +# * extra_protoc_parameters +# * extra_protoc_file_parameters +# The complete list of preserved parameters can be found in the source code. + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +############################################################################## +# Common +############################################################################## +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") + +proto_library( + name = "cx_proto", + srcs = [ + "agent.proto", + "audio_config.proto", + "entity_type.proto", + "environment.proto", + "flow.proto", + "fulfillment.proto", + "gcs.proto", + "intent.proto", + "ivr.proto", + "page.proto", + "response_message.proto", + "session.proto", + "session_entity_type.proto", + "transition_route_group.proto", + "version.proto", + "webhook.proto", + ], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + "//google/longrunning:operations_proto", + "//google/rpc:status_proto", + "//google/type:latlng_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:struct_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +proto_library_with_info( + name = "cx_proto_with_info", + deps = [ + ":cx_proto", + "//google/cloud:common_resources_proto", + ], +) + +############################################################################## +# Java +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "java_gapic_assembly_gradle_pkg", + "java_gapic_library", + "java_gapic_test", + "java_grpc_library", + "java_proto_library", +) + +java_proto_library( + name = "cx_java_proto", + deps = [":cx_proto"], +) + +java_grpc_library( + name = "cx_java_grpc", + srcs = [":cx_proto"], + deps = [":cx_java_proto"], +) + +java_gapic_library( + name = "cx_java_gapic", + src = ":cx_proto_with_info", + gapic_yaml = "dialogflow_gapic.yaml", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + test_deps = [ + ":cx_java_grpc", + ], + deps = [ + ":cx_java_proto", + ], +) + +java_gapic_test( + name = "cx_java_gapic_test_suite", + test_classes = [ + "com.google.cloud.dialogflow.cx.v3beta1.AgentsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.FlowsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.IntentsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.PagesClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.SessionsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.VersionsClientTest", + "com.google.cloud.dialogflow.cx.v3beta1.WebhooksClientTest", + ], + runtime_deps = [":cx_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-dialogflow-cx-v3beta1-java", + deps = [ + ":cx_java_gapic", + ":cx_java_grpc", + ":cx_java_proto", + ":cx_proto", + ], +) + +############################################################################## +# Go +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "go_gapic_assembly_pkg", + "go_gapic_library", + "go_proto_library", + "go_test", +) + +go_proto_library( + name = "cx_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], + importpath = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1", + protos = [":cx_proto"], + deps = [ + "//google/api:annotations_go_proto", + "//google/longrunning:longrunning_go_proto", + "//google/rpc:status_go_proto", + "//google/type:latlng_go_proto", + ], +) + +go_gapic_library( + name = "cx_go_gapic", + srcs = [":cx_proto_with_info"], + grpc_service_config = "dialogflow_grpc_service_config.json", + importpath = "cloud.google.com/go/dialogflow/cx/apiv3beta1;cx", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [ + ":cx_go_proto", + "//google/longrunning:longrunning_go_gapic", + "//google/longrunning:longrunning_go_proto", + "@com_google_cloud_go//longrunning:go_default_library", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", + "@io_bazel_rules_go//proto/wkt:struct_go_proto", + ], +) + +go_test( + name = "cx_go_gapic_test", + srcs = [":cx_go_gapic_srcjar_test"], + embed = [":cx_go_gapic"], + importpath = "cloud.google.com/go/dialogflow/cx/apiv3beta1", +) + +# Open Source Packages +go_gapic_assembly_pkg( + name = "gapi-cloud-dialogflow-cx-v3beta1-go", + deps = [ + ":cx_go_gapic", + ":cx_go_gapic_srcjar-test.srcjar", + ":cx_go_proto", + ], +) + +############################################################################## +# Python +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "moved_proto_library", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_grpc_library", + "py_proto_library", +) + +moved_proto_library( + name = "cx_moved_proto", + srcs = [":cx_proto"], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + "//google/longrunning:operations_proto", + "//google/rpc:status_proto", + "//google/type:latlng_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:struct_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +py_proto_library( + name = "cx_py_proto", + plugin = "@protoc_docs_plugin//:docs_plugin", + deps = [":cx_moved_proto"], +) + +py_grpc_library( + name = "cx_py_grpc", + srcs = [":cx_moved_proto"], + deps = [":cx_py_proto"], +) + +py_gapic_library( + name = "cx_py_gapic", + src = ":cx_proto_with_info", + gapic_yaml = "dialogflow_gapic.yaml", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [ + ":cx_py_grpc", + ":cx_py_proto", + ], +) + +# Open Source Packages +py_gapic_assembly_pkg( + name = "dialogflow-cx-v3beta1-py", + deps = [ + ":cx_py_gapic", + ":cx_py_grpc", + ":cx_py_proto", + ], +) + +############################################################################## +# PHP +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "php_gapic_assembly_pkg", + "php_gapic_library", + "php_grpc_library", + "php_proto_library", +) + +php_proto_library( + name = "cx_php_proto", + deps = [":cx_proto"], +) + +php_grpc_library( + name = "cx_php_grpc", + srcs = [":cx_proto"], + deps = [":cx_php_proto"], +) + +php_gapic_library( + name = "cx_php_gapic", + src = ":cx_proto_with_info", + gapic_yaml = "dialogflow_gapic.yaml", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [ + ":cx_php_grpc", + ":cx_php_proto", + ], +) + +# Open Source Packages +php_gapic_assembly_pkg( + name = "google-cloud-dialogflow-cx-v3beta1-php", + deps = [ + ":cx_php_gapic", + ":cx_php_grpc", + ":cx_php_proto", + ], +) + +############################################################################## +# Node.js +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + +nodejs_gapic_library( + name = "cx_nodejs_gapic", + src = ":cx_proto_with_info", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [], +) + +nodejs_gapic_assembly_pkg( + name = "dialogflow-cx-v3beta1-nodejs", + deps = [ + ":cx_nodejs_gapic", + ":cx_proto", + ], +) + +############################################################################## +# Ruby +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_gapic_assembly_pkg", + "ruby_gapic_library", + "ruby_grpc_library", + "ruby_proto_library", +) + +ruby_proto_library( + name = "cx_ruby_proto", + deps = [":cx_proto"], +) + +ruby_grpc_library( + name = "cx_ruby_grpc", + srcs = [":cx_proto"], + deps = [":cx_ruby_proto"], +) + +ruby_gapic_library( + name = "cx_ruby_gapic", + src = ":cx_proto_with_info", + gapic_yaml = "dialogflow_gapic.yaml", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [ + ":cx_ruby_grpc", + ":cx_ruby_proto", + ], +) + +# Open Source Packages +ruby_gapic_assembly_pkg( + name = "google-cloud-dialogflow-cx-v3beta1-ruby", + deps = [ + ":cx_ruby_gapic", + ":cx_ruby_grpc", + ":cx_ruby_proto", + ], +) + +############################################################################## +# C# +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "csharp_gapic_assembly_pkg", + "csharp_gapic_library", + "csharp_grpc_library", + "csharp_proto_library", +) + +csharp_proto_library( + name = "cx_csharp_proto", + deps = [":cx_proto"], +) + +csharp_grpc_library( + name = "cx_csharp_grpc", + srcs = [":cx_proto"], + deps = [":cx_csharp_proto"], +) + +csharp_gapic_library( + name = "cx_csharp_gapic", + src = ":cx_proto_with_info", + gapic_yaml = "dialogflow_gapic.yaml", + grpc_service_config = "dialogflow_grpc_service_config.json", + package = "google.cloud.dialogflow.cx.v3beta1", + service_yaml = "dialogflow_v3beta1.yaml", + deps = [ + ":cx_csharp_grpc", + ":cx_csharp_proto", + ], +) + +# Open Source Packages +csharp_gapic_assembly_pkg( + name = "google-cloud-dialogflow-cx-v3beta1-csharp", + deps = [ + ":cx_csharp_gapic", + ":cx_csharp_grpc", + ":cx_csharp_proto", + ], +) + +############################################################################## +# C++ +############################################################################## +# Put your C++ rules here diff --git a/google/cloud/dialogflow/cx/v3beta1/agent.proto b/google/cloud/dialogflow/cx/v3beta1/agent.proto new file mode 100644 index 00000000..e2510668 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/agent.proto @@ -0,0 +1,318 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. +service Agents { + 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 agents in the specified location. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an agent in the specified location. + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v3beta1/{agent.name=projects/*/locations/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified agent to a ZIP file. + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportAgentResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Restores the specified agent from a ZIP file. + // + // Note that all existing intents, intent routes, entity types, pages and + // webhooks in the agent will be deleted. + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to speech recognition. +message SpeechToTextSettings { + // Whether to use speech adaptation for speech recognition. + bool enable_speech_adaptation = 1; +} + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add [Intents][google.cloud.dialogflow.cx.v3beta1.Intent], +// [Entity Types][google.cloud.dialogflow.cx.v3beta1.EntityType], [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], +// [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], and so on to manage the conversation flows.. +message Agent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" + }; + + // The unique identifier of the agent. + // Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent] + // populates the name automatically. + // Format: `projects//locations//agents/`. + string name = 1; + + // Required. The human-readable name of the agent, unique within the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. The default language of the agent as a language tag. + // See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) + // for a list of the currently supported language codes. + // This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. + string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The time zone of the agent from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. + string time_zone = 5 [(google.api.field_behavior) = REQUIRED]; + + // The description of the agent. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 6; + + // The URI of the agent's avatar. Avatars are used throughout the Dialogflow + // console and in the self-hosted [Web + // Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + // integration. + string avatar_uri = 7; + + // Speech recognition related settings. + SpeechToTextSettings speech_to_text_settings = 13; + + // Immutable. Name of the start flow in this agent. A start flow will be automatically + // created when the agent is created, and can only be deleted by deleting the + // agent. + // Format: `projects//locations//agents//flows/`. + string start_flow = 16 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Indicates if stackdriver logging is enabled for the agent. + bool enable_stackdriver_logging = 18; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 20; +} + +// The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsRequest { + // Required. The location to list all agents for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 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 [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent]. +message GetAgentRequest { + // Required. The name of the agent. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]. +message CreateAgentRequest { + // Required. The location to create a agent for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to create. + Agent agent = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent]. +message DeleteAgentRequest { + // Required. The name of the agent to delete. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentRequest { + // Required. The name of the agent to export. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + // export the agent to. The format of this URI must be + // `gs:///`. + // If left unspecified, the serialized agent is returned inline. + string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentResponse { + // The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest]. + string agent_uri = 1; + + // Uncompressed raw byte content for agent. + bytes agent_content = 2; + } +} + +// The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Required. The name of the agent to restore into. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to restore. + oneof agent { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to restore agent from. The format of this URI must be + // `gs:///`. + string agent_uri = 2; + + // Uncompressed raw byte content for agent. + bytes agent_content = 3; + } +} diff --git a/google/cloud/dialogflow/cx/v3beta1/audio_config.proto b/google/cloud/dialogflow/cx/v3beta1/audio_config.proto new file mode 100644 index 00000000..c0043a52 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/audio_config.proto @@ -0,0 +1,305 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "AudioConfigProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the +// [Cloud Speech API +// documentation](https://cloud.google.com/speech-to-text/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; +} + +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; + + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; +} + +// Instructs the speech recognizer on how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Sample rate (in Hertz) of the audio content sent in the query. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics) for + // more details. + int32 sample_rate_hertz = 2; + + // Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in + // [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech + // words, e.g. start and end time offsets. If false or unspecified, Speech + // doesn't return any word-level information. + bool enable_word_info = 13; + + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // See [the Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; + + // Optional. Which Speech model to select for the given request. Select the + // model best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the InputAudioConfig. + // If enhanced speech model is enabled for the agent and an enhanced + // version of the specified model for the language does not exist, then the + // speech is recognized using the standard version of the specified model. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + // for more details. + string model = 7; + + // Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. + SpeechModelVariant model_variant = 10; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // Note: This setting is relevant only for streaming methods. + bool single_utterance = 8; +} + +// Variant of the specified [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. +// +// See the [Cloud Speech +// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) +// for which models have different variants. For example, the "phone_call" model +// has both a standard and an enhanced variant. When you use an enhanced model, +// you will generally receive higher quality results than for a standard model. +enum SpeechModelVariant { + // No model variant specified. In this case Dialogflow defaults to + // USE_BEST_AVAILABLE. + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + + // Use the best available variant of the [Speech + // model][InputAudioConfig.model] that the caller is eligible for. + // + // Please see the [Dialogflow + // docs](https://cloud.google.com/dialogflow/docs/data-logging) for + // how to make your project eligible for enhanced models. + USE_BEST_AVAILABLE = 1; + + // Use standard model variant even if an enhanced model is available. See the + // [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // for details about enhanced models. + USE_STANDARD = 2; + + // Use an enhanced model variant: + // + // * If an enhanced variant does not exist for the given + // [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and request language, Dialogflow falls + // back to the standard variant. + // + // The [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // describes which models have enhanced variants. + // + // * If the API caller isn't eligible for enhanced models, Dialogflow returns + // an error. Please see the [Dialogflow + // docs](https://cloud.google.com/dialogflow/docs/data-logging) + // for how to make your project eligible. + USE_ENHANCED = 3; +} + +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and + // [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender]. + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + +// Configuration of how speech should be synthesized. +message SynthesizeSpeechConfig { + // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + // native speed supported by the specific voice. 2.0 is twice as fast, and + // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + // other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 1; + + // Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + // semitones from the original pitch. -20 means decrease 20 semitones from the + // original pitch. + double pitch = 2; + + // Optional. Volume gain (in dB) of the normal native volume supported by the + // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3; + + // Optional. An identifier which selects 'audio effects' profiles that are + // applied on (post synthesized) text to speech. Effects are applied on top of + // each other in the order they are given. + repeated string effects_profile_id = 5; + + // Optional. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 4; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender, which means that the client doesn't care which + // gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + SSML_VOICE_GENDER_MALE = 1; + + // A female voice. + SSML_VOICE_GENDER_FEMALE = 2; + + // A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3; +} + +// Instructs the speech synthesizer how to generate the output audio content. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Optional. Configuration of how speech should be synthesized. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + +// Audio encoding of the output audio format in Text-To-Speech. +enum OutputAudioEncoding { + // Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + + // MP3 audio at 32kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2; + + // MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + OUTPUT_AUDIO_ENCODING_MULAW = 5; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/dialogflow_gapic.yaml b/google/cloud/dialogflow/cx/v3beta1/dialogflow_gapic.yaml new file mode 100644 index 00000000..37694739 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/dialogflow_gapic.yaml @@ -0,0 +1,20 @@ +type: com.google.api.codegen.ConfigProto +config_schema_version: 2.0.0 +# The settings of generated code in a specific language. +language_settings: + java: + package_name: com.google.cloud.dialogflow.cx.v3beta1 + release_level: BETA + python: + package_name: google.cloud.dialogflowcx_v3beta1.gapic + go: + package_name: cloud.google.com/go/cloud/dialogflow/cx/apiv3beta1 + csharp: + package_name: Google.Cloud.Dialogflow.Cx.V3Beta1 + ruby: + package_name: Google::Cloud::Dialogflow::Cx::V3beta1 + php: + package_name: Google\Cloud\Dialogflow\Cx\V3beta1 + nodejs: + package_name: dialogflowcx.v3beta1 + domain_layer_location: google-cloud diff --git a/google/cloud/dialogflow/cx/v3beta1/dialogflow_grpc_service_config.json b/google/cloud/dialogflow/cx/v3beta1/dialogflow_grpc_service_config.json new file mode 100644 index 00000000..2b574a08 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/dialogflow_grpc_service_config.json @@ -0,0 +1,82 @@ +{ + "methodConfig": [ + { + "name": [ + { + "service": "google.cloud.dialogflow.cx.v3beta1.Agents" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.EntityTypes" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Environments" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Flows" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Fulfillments" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Intents" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Pages" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Sessions" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Versions" + }, + { + "service": "google.cloud.dialogflow.cx.v3beta1.Webhooks" + } + ], + "timeout": "60s", + "retryPolicy": { + "initialBackoff": "0.100s", + "maxBackoff": "60s", + "backoffMultiplier": 1.3, + "retryableStatusCodes": [ + "UNAVAILABLE" + ] + } + }, + { + "name": [ + { + "service": "google.cloud.dialogflow.cx.v3beta1.Sessions", + "method": "DetectIntent" + } + ], + "timeout": "220s", + "retryPolicy": { + "initialBackoff": "0.100s", + "maxBackoff": "60s", + "backoffMultiplier": 1.3, + "retryableStatusCodes": [ + "UNAVAILABLE" + ] + } + }, + { + "name": [ + { + "service": "google.cloud.dialogflow.cx.v3beta1.Sessions", + "method": "StreamingDetectIntent" + } + ], + "timeout": "220s" + } + ] +} diff --git a/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml b/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml new file mode 100644 index 00000000..42a8c13d --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml @@ -0,0 +1,139 @@ +type: google.api.Service +config_version: 3 +name: dialogflow.googleapis.com +title: Dialogflow API + +apis: +- name: google.cloud.dialogflow.cx.v3beta1.Agents +- name: google.cloud.dialogflow.cx.v3beta1.EntityTypes +- name: google.cloud.dialogflow.cx.v3beta1.Environments +- name: google.cloud.dialogflow.cx.v3beta1.Flows +- name: google.cloud.dialogflow.cx.v3beta1.Intents +- name: google.cloud.dialogflow.cx.v3beta1.Pages +- name: google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes +- name: google.cloud.dialogflow.cx.v3beta1.Sessions +- name: google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups +- name: google.cloud.dialogflow.cx.v3beta1.Versions +- name: google.cloud.dialogflow.cx.v3beta1.Webhooks + +types: +- name: google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata +- name: google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse +- name: google.cloud.dialogflow.cx.v3beta1.WebhookRequest +- name: google.cloud.dialogflow.cx.v3beta1.WebhookResponse + +documentation: + summary: |- + Builds conversational interfaces (for example, chatbots, and voice-powered + apps and devices). + overview: |- + Dialogflow is + a natural language understanding platform that makes it easy + to design and integrate a conversational user interface into your mobile + app, web application, device, bot, interactive voice response system, and + so on. Using Dialogflow, you can provide new and engaging ways for + users to interact with your product. + + Dialogflow can analyze multiple types of input from your customers, + including text or audio inputs (like from a phone or voice recording). + It can also respond to your customers in a couple of ways, either through + text or with synthetic speech. + + For more information, see the + [Dialogflow documentation](https://cloud.google.com/dialogflow/docs). + +backend: + rules: + - selector: 'google.cloud.dialogflow.cx.v3beta1.Agents.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.EntityTypes.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Environments.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Flows.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Intents.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Pages.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.*' + deadline: 60.0 + - selector: google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent + deadline: 220.0 + - selector: google.cloud.dialogflow.cx.v3beta1.Sessions.FulfillIntent + deadline: 60.0 + - selector: google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent + deadline: 60.0 + - selector: google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent + deadline: 220.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Versions.*' + deadline: 60.0 + - selector: 'google.cloud.dialogflow.cx.v3beta1.Webhooks.*' + deadline: 60.0 + - selector: 'google.longrunning.Operations.*' + deadline: 60.0 + +authentication: + rules: + - selector: 'google.cloud.dialogflow.cx.v3beta1.Agents.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.EntityTypes.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Environments.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Flows.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Intents.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Pages.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Sessions.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Versions.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.cloud.dialogflow.cx.v3beta1.Webhooks.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow + - selector: 'google.longrunning.Operations.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform, + https://www.googleapis.com/auth/dialogflow diff --git a/google/cloud/dialogflow/cx/v3beta1/entity_type.proto b/google/cloud/dialogflow/cx/v3beta1/entity_type.proto new file mode 100644 index 00000000..f12cd70f --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/entity_type.proto @@ -0,0 +1,342 @@ +// Copyright 2020 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.v3beta1; + +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.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. +service EntityTypes { + 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 entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an entity type in the specified agent. + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + } + + // Updates the specified entity type. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v3beta1/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes the specified entity type. + rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Custom** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A custom +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] type. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message EntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }; + + // An **entity entry** for an associated entity type. + // Next Id = 8 + message Entity { + // Required. The primary value associated with this entity entry. + // For example, if the entity type is *vegetable*, the value could be + // *scallions*. + // + // For `KIND_MAP` entity types: + // + // * A canonical value to be used in place of synonyms. + // + // For `KIND_LIST` entity types: + // + // * A string that can contain references to other entity types (with or + // without aliases). + string value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A collection of value synonyms. For example, if the entity type + // is *vegetable*, and `value` is *scallions*, a synonym could be *green + // onions*. + // + // For `KIND_LIST` entity types: + // + // * This collection must contain exactly one synonym equal to `value`. + repeated string synonyms = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // An excluded entity phrase that should not be matched. + message ExcludedPhrase { + // Required. The word or phrase to be excluded. + string value = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + + // Regexp entity types allow to specify regular expressions in entries + // values. + KIND_REGEXP = 3; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // The unique identifier of the entity type. + // Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1; + + // Required. The human-readable name of the entity type, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates the kind of entity type. + Kind kind = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the entity type can be automatically expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // The collection of entity entries associated with the entity type. + repeated Entity entities = 5; + + // Collection of exceptional words and phrases that shouldn't be matched. + // For example, if you have a size entity type with entry `giant`(an + // adjective), you might consider adding `giants`(a noun) as an exclusion. + // If the kind of entity type is `KIND_MAP`, then the phrases specified by + // entities and excluded phrases should be mutually exclusive. + repeated ExcludedPhrase excluded_phrases = 6; + + // Enables fuzzy entity extraction during classification. + bool enable_fuzzy_extraction = 7; +} + +// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to list entity types for. The following fields are language + // dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + 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 [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of entity types. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated EntityType entity_types = 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 [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to retrieve the entity type for. The following fields are + // language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity type to create. + EntityType entity_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/environment.proto b/google/cloud/dialogflow/cx/v3beta1/environment.proto new file mode 100644 index 00000000..a5c444c3 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/environment.proto @@ -0,0 +1,262 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. +service Environments { + 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 environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3beta1/{environment.name=projects/*/locations/*/agents/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) returns (LookupEnvironmentHistoryResponse) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents an environment for an agent. You can create multiple versions +// of your agent and publish them to separate environments. When you edit an +// agent, you are editing the draft agent. At any point, you can save the draft +// agent as an agent version, which is an immutable snapshot of your agent. When +// you save the draft agent, it is published to the default environment. When +// you create agent versions, you can publish them to custom environments. You +// can create a variety of custom environments for testing, development, +// production, etc. +message Environment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }; + + // Configuration for the version. + message VersionConfig { + // Required. Format: projects//locations//agents//flows//versions/. + string version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + } + + // The name of the environment. + // Format: `projects//locations//agents//environments/`. + string name = 1; + + // Required. The human-readable name of the environment (unique in an agent). Limit of + // 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the environment. The maximum length is + // 500 characters. If exceeded, the request is rejected. + string description = 3; + + // Required. A list of configurations for flow versions. You should include version + // configs for all flows that are reachable from [`Start + // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be + // returned. + repeated VersionConfig version_configs = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Update time of this environment. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsResponse { + // The list of environments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Environment environments = 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 [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment]. +message GetEnvironmentRequest { + // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment]. +message CreateEnvironmentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The environment to create. + Environment environment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment]. +message UpdateEnvironmentRequest { + // Required. The environment to update. + Environment environment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment]. +message DeleteEnvironmentRequest { + // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryRequest { + // Required. Resource name of the environment to look up the history for. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryResponse { + // Represents a list of snapshots for an environment. Time of the snapshots is + // stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time]. + repeated Environment environments = 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; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/flow.proto b/google/cloud/dialogflow/cx/v3beta1/flow.proto new file mode 100644 index 00000000..6541a9d9 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/flow.proto @@ -0,0 +1,367 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "FlowProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. +service Flows { + 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"; + + // Creates a flow in the specified agent. + rpc CreateFlow(CreateFlowRequest) returns (Flow) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + body: "flow" + }; + option (google.api.method_signature) = "parent,flow"; + } + + // Deletes a specified flow. + rpc DeleteFlow(DeleteFlowRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all flows in the specified agent. + rpc ListFlows(ListFlowsRequest) returns (ListFlowsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified flow. + rpc GetFlow(GetFlowRequest) returns (Flow) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified flow. + rpc UpdateFlow(UpdateFlowRequest) returns (Flow) { + option (google.api.http) = { + patch: "/v3beta1/{flow.name=projects/*/locations/*/agents/*/flows/*}" + body: "flow" + }; + option (google.api.method_signature) = "flow,update_mask"; + } + + // Trains the specified flow. Note that only the flow in 'draft' environment + // is trained. + rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:train" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to NLU. +message NluSettings { + // NLU model type. + enum ModelType { + // Not specified. `MODEL_TYPE_STANDARD` will be used. + MODEL_TYPE_UNSPECIFIED = 0; + + // Use standard NLU model. + MODEL_TYPE_STANDARD = 1; + + // Use custom NLU model. + MODEL_TYPE_CUSTOM = 2; + + // Use advanced NLU model. + MODEL_TYPE_ADVANCED = 3; + } + + // NLU model training mode. + enum ModelTrainingMode { + // Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. + MODEL_TRAINING_MODE_UNSPECIFIED = 0; + + // NLU model training is automatically triggered when a flow gets modified. + // User can also manually trigger model training in this mode. + MODEL_TRAINING_MODE_AUTOMATIC = 1; + + // User needs to manually trigger NLU model training. Best for large flows + // whose models take long time to train. + MODEL_TRAINING_MODE_MANUAL = 2; + } + + // Indicates the type of NLU model. + ModelType model_type = 1; + + // To filter out false positive results and still get variety in matched + // natural language inputs for your agent, you can tune the machine learning + // classification threshold. If the returned score value is less than the + // threshold value, then a no-match event will be triggered. The score values + // range from 0.0 (completely uncertain) to 1.0 (completely certain). If set + // to 0.0, the default of 0.3 is used. + float classification_threshold = 3; + + // Indicates NLU model training mode. + ModelTrainingMode model_training_mode = 4; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 5 [deprecated = true]; +} + +// Flows represents the conversation flows when you build your chatbot agent. +// +// A flow consists of many pages connected by the transition routes. +// Conversations always start with the built-in Start Flow (with an all-0 ID). +// Transition routes can direct the conversation session from the current flow +// (parent flow) to another flow (sub flow). When the sub flow is finished, +// Dialogflow will bring the session back to the parent flow, where the sub flow +// is started. +// +// Usually, when a transition route is followed by a matched intent, the intent +// will be "consumed". This means the intent won't activate more transition +// routes. However, when the followed transition route moves the conversation +// session into a different flow, the matched intent can be carried over and to +// be consumed in the target flow. +message Flow { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Flow" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }; + + // The unique identifier of the flow. + // Format: `projects//locations//agents//flows/`. + string name = 1; + + // Required. The human-readable name of the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the flow. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // A flow's transition routes serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // routes][Page.transition_routes] and can support use cases such as the user + // saying "help" or "can I talk to a human?", which can be handled in a common + // way regardless of the current page. Transition routes defined in the page + // have higher priority than those defined in the flow. + // + // TransitionRoutes are evalauted in the following order: + // + // * TransitionRoutes with intent specified.. + // * TransitionRoutes with only condition specified. + // + // TransitionRoutes with intent specified are inherited by pages in the flow. + repeated TransitionRoute transition_routes = 4; + + // A flow's event handlers serve two purposes: + // + // * They are responsible for handling events (e.g. no match, + // webhook errors) in the flow. + // * They are inherited by every page's [event + // handlers][Page.event_handlers], which can be used to handle common events + // regardless of the current page. Event handlers defined in the page + // have higher priority than those defined in the flow. + // + // Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are + // evaluated on a first-match basis. The first one that matches the event + // get executed, with the rest being ignored. + repeated EventHandler event_handlers = 10; + + // NLU related settings of the flow. + NluSettings nlu_settings = 11; +} + +// The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow]. +message CreateFlowRequest { + // Required. The agent to create a flow for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to create. + Flow flow = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow]. +message DeleteFlowRequest { + // Required. The name of the flow to delete. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // This field has no effect for flows with no incoming transitions. + // For flows with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the flow, as well as + // any transitions to the flow. + bool force = 2; +} + +// The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsRequest { + // Required. The agent containing the flows. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list flows for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsResponse { + // The list of flows. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Flow flows = 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 response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow]. +message GetFlowRequest { + // Required. The name of the flow to get. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The language to retrieve the flow for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow]. +message UpdateFlowRequest { + // Required. The flow to update. + Flow flow = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. If `update_mask` is not + // specified, an error will be returned. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow]. +message TrainFlowRequest { + // Required. The flow to train. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto b/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto new file mode 100644 index 00000000..7a8e5af3 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto @@ -0,0 +1,107 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "FulfillmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// A fulfillment can do one or more of the following actions at the same time: +// +// * Generate rich message responses. +// * Set parameter values. +// * Call the webhook. +// +// Fulfillments can be called at various stages in the [Page][google.cloud.dialogflow.cx.v3beta1.Page] or +// [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when a [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest] drives a +// session to enter a new page, the page's entry fulfillment can add a static +// response to the [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the returning [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse], +// call the webhook (for example, to load user data from a database), or both. +message Fulfillment { + // Setting a parameter value. + message SetParameterAction { + // Display name of the parameter. + string parameter = 1; + + // The new value of the parameter. A null value clears the parameter. + google.protobuf.Value value = 2; + } + + // A list of cascading if-else conditions. Cases are mutually exclusive. + // The first one with a matching condition is selected, all the rest ignored. + message ConditionalCases { + // Each case has a Boolean condition. When it is evaluated to be True, the + // corresponding messages will be selected and evaluated recursively. + message Case { + // The list of messages or conditional cases to activate for this case. + message CaseContent { + // Either a message is returned or additional cases to be evaluated. + oneof cases_or_message { + // Returned message. + ResponseMessage message = 1; + + // Additional cases to be evaluated. + ConditionalCases additional_cases = 2; + } + } + + // The condition to activate and select this case. Empty means the + // condition is always true. The condition is evaluated against [form + // parameters][Form.parameters] or [session + // parameters][SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // A list of case content. + repeated CaseContent case_content = 2; + } + + // A list of cascading if-else conditions. + repeated Case cases = 1; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // The webhook to call. + // Format: `projects//locations//agents//webhooks/`. + string webhook = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + }]; + + // The tag used by the webhook to identify which fulfillment is being called. + // This field is required if `webhook` is specified. + string tag = 3; + + // Set parameter values before executing the webhook. + repeated SetParameterAction set_parameter_actions = 4; + + // Conditional cases for this fulfillment. + repeated ConditionalCases conditional_cases = 5; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/gcs.proto b/google/cloud/dialogflow/cx/v3beta1/gcs.proto new file mode 100644 index 00000000..c2bb4517 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/gcs.proto @@ -0,0 +1,28 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "GcsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; diff --git a/google/cloud/dialogflow/cx/v3beta1/intent.proto b/google/cloud/dialogflow/cx/v3beta1/intent.proto new file mode 100644 index 00000000..d93e9448 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/intent.proto @@ -0,0 +1,337 @@ +// Copyright 2020 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.v3beta1; + +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.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. +service Intents { + 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 intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an intent in the specified agent. + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + body: "intent" + }; + option (google.api.method_signature) = "parent,intent"; + } + + // Updates the specified intent. + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v3beta1/{intent.name=projects/*/locations/*/agents/*/intents/*}" + body: "intent" + }; + option (google.api.method_signature) = "intent,update_mask"; + } + + // Deletes the specified intent. + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// An intent represents a user's intent to interact with a conversational agent. +// +// You can provide information for the Dialogflow API to use to match user input +// to an intent by adding training phrases (i.e., examples of user input) to +// your intent. +message Intent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Intent" + pattern: "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }; + + // Represents an example that the agent is trained on to identify the intent. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text for this part. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the + // training phrase. This field is required for annotated parts of the + // training phrase. + string parameter_id = 2; + } + + // Output only. The unique identifier of the training phrase. + string id = 1; + + // Required. The ordered list of training phrase parts. + // The parts are concatenated in order to form the training phrase. + // + // Note: The API does not automatically annotate training phrases like the + // Dialogflow Console does. + // + // Note: Do not forget to include whitespace at part boundaries, so the + // training phrase is well formatted when the parts are concatenated. + // + // If the training phrase does not need to be annotated with parameters, + // you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set. + // + // If you want to annotate the training phrase, you must create multiple + // parts, where the fields of each part are populated in one of two ways: + // + // - `Part.text` is set to a part of the phrase that has no parameters. + // - `Part.text` is set to a part of the phrase that you want to annotate, + // and the `parameter_id` field is set. + repeated Part parts = 2 [(google.api.field_behavior) = REQUIRED]; + + // Indicates how many times this example was added to the intent. + int32 repeat_count = 3; + } + + // Represents an intent parameter. + message Parameter { + // Required. The unique identifier of the parameter. This field + // is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their + // [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part]. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entity type of the parameter. + // Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` for developer entity types. + string entity_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 3; + } + + // The unique identifier of the intent. + // Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent] + // populates the name automatically. + // Format: `projects//locations//agents//intents/`. + string name = 1; + + // Required. The human-readable name of the intent, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The collection of training phrases the agent is trained on to identify the + // intent. + repeated TrainingPhrase training_phrases = 3; + + // The collection of parameters associated with the intent. + repeated Parameter parameters = 4; + + // The priority of this intent. Higher numbers represent higher + // priorities. + // + // - If the supplied value is unspecified or 0, the service + // translates the value to 500,000, which corresponds to the + // `Normal` priority in the console. + // - If the supplied value is negative, the intent is ignored + // in runtime detect intent requests. + int32 priority = 5; + + // Indicates whether this is a fallback intent. Currently only default + // fallback intent is allowed in the agent, which is added upon agent + // creation. + // Adding training phrases to fallback intent is useful in the case of + // requests that are mistakenly matched, since training phrases assigned to + // fallback intents act as negative examples that triggers no-match event. + bool is_fallback = 6; +} + +// The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to list intents for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The resource view to apply to the returned intent. + IntentView intent_view = 5; + + // 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 [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsResponse { + // The list of intents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Intent intents = 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 [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to retrieve the intent for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create an intent for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intent to create. + Intent intent = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + Intent intent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + 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 [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response. +enum IntentView { + // Not specified. Treated as INTENT_VIEW_FULL. + INTENT_VIEW_UNSPECIFIED = 0; + + // Training phrases field is not populated in the response. + INTENT_VIEW_PARTIAL = 1; + + // All fields are populated. + INTENT_VIEW_FULL = 2; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/ivr.proto b/google/cloud/dialogflow/cx/v3beta1/ivr.proto new file mode 100644 index 00000000..86a97737 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/ivr.proto @@ -0,0 +1,28 @@ +// Copyright 2020 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.v3beta1; + +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "InteractiveVoiceResponseProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; diff --git a/google/cloud/dialogflow/cx/v3beta1/page.proto b/google/cloud/dialogflow/cx/v3beta1/page.proto new file mode 100644 index 00000000..c63b1617 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/page.proto @@ -0,0 +1,506 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "PageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. +service Pages { + 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 pages in the specified flow. + rpc ListPages(ListPagesRequest) returns (ListPagesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified page. + rpc GetPage(GetPageRequest) returns (Page) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a page in the specified flow. + rpc CreatePage(CreatePageRequest) returns (Page) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + body: "page" + }; + option (google.api.method_signature) = "parent,page"; + } + + // Updates the specified page. + rpc UpdatePage(UpdatePageRequest) returns (Page) { + option (google.api.http) = { + patch: "/v3beta1/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}" + body: "page" + }; + option (google.api.method_signature) = "page,update_mask"; + } + + // Deletes the specified page. + rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A Dialogflow CX conversation (session) can be described and visualized as a +// state machine. The states of a CX session are represented by pages. +// +// For each flow, you define many pages, where your combined pages can handle a +// complete conversation on the topics the flow is designed for. At any given +// moment, exactly one page is the current page, the current page is considered +// active, and the flow associated with that page is considered active. Every +// flow has a special start page. When a flow initially becomes active, the +// start page page becomes the current page. For each conversational turn, the +// current page will either stay the same or transition to another page. +// +// You configure each page to collect information from the end-user that is +// relevant for the conversational state represented by the page. +// +// For more information, see the +// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). +message Page { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Page" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }; + + // The unique identifier of the page. + // Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage] + // populates the name automatically. + // Format: `projects//locations//agents//flows//pages/`. + string name = 1; + + // Required. The human-readable name of the page, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the session is entering the page. + Fulfillment entry_fulfillment = 7; + + // The form associated with the page, used for collecting parameters + // relevant to the page. + Form form = 4; + + // Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated + // with the page. Transition route groups must be unique within a page. + // + // * If multiple transition routes within a page scope refer to the same + // intent, then the precedence order is: page's transition route -> page's + // transition route group -> flow's transition routes. + // + // * If multiple transition route groups within a page contain the same + // intent, then the first group in the ordered list takes precedence. + // + // Format:`projects//locations//agents//flows//transitionRouteGroups/`. + repeated string transition_route_groups = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // A list of transitions for the transition rules of this page. + // They route the conversation to another page in the same flow, or another + // flow. + // + // When we are in a certain page, the TransitionRoutes are evalauted in the + // following order: + // + // * TransitionRoutes defined in the page with intent specified. + // * TransitionRoutes defined in the + // [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups]. + // * TransitionRoutes defined in flow with intent specified. + // * TransitionRoutes defined in the page with only condition specified. + repeated TransitionRoute transition_routes = 9; + + // Handlers associated with the page to handle events such as webhook errors, + // no match or no input. + repeated EventHandler event_handlers = 10; +} + +// A form is a data model that groups related parameters that can be collected +// from the user. The process in which the agent prompts the user and collects +// parameter values from the user is called form filling. A form can be added to +// a [page][google.cloud.dialogflow.cx.v3beta1.Page]. When form filling is done, the filled parameters will be +// written to the [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. +message Form { + // Represents a form parameter. + message Parameter { + // Configuration for how the filling of a parameter should be handled. + message FillBehavior { + // Required. The fulfillment to provide the initial prompt that the agent + // can present to the user in order to fill the parameter. + Fulfillment initial_prompt_fulfillment = 3 [(google.api.field_behavior) = REQUIRED]; + + // The handlers for parameter-level events, used to provide reprompt for + // the parameter or transition to a different page/flow. The supported + // events are: + // * `sys.no-match-`, where N can be from 1 to 6 + // * `sys.no-match-default` + // * `sys.no-input-`, where N can be from 1 to 6 + // * `sys.no-input-default` + // * `sys.invalid-parameter` + // + // `initial_prompt_fulfillment` provides the first prompt for the + // parameter. + // + // If the user's response does not fill the parameter, a + // no-match/no-input event will be triggered, and the fulfillment + // associated with the `sys.no-match-1`/`sys.no-input-1` handler (if + // defined) will be called to provide a prompt. The + // `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to + // the next no-match/no-input event, and so on. + // + // A `sys.no-match-default` or `sys.no-input-default` handler will be used + // to handle all following no-match/no-input events after all numbered + // no-match/no-input handlers for the parameter are consumed. + // + // A `sys.invalid-parameter` handler can be defined to handle the case + // where the parameter values have been `invalidated` by webhook. For + // example, if the user's response fill the parameter, however the + // parameter was invalidated by webhook, the fulfillment associated with + // the `sys.invalid-parameter` handler (if defined) will be called to + // provide a prompt. + // + // If the event handler for the corresponding event can't be found on the + // parameter, `initial_prompt_fulfillment` will be re-prompted. + repeated EventHandler reprompt_event_handlers = 5; + } + + // Required. The human-readable name of the parameter, unique within the + // form. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the parameter is required. Optional parameters will not + // trigger prompts; however, they are filled if the user specifies them. + // Required parameters must be filled before form filling concludes. + bool required = 2; + + // Required. The entity type of the parameter. + // Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` for developer entity types. + string entity_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 4; + + // Required. Defines fill behavior for the parameter. + FillBehavior fill_behavior = 7 [(google.api.field_behavior) = REQUIRED]; + + // The default value of an optional parameter. If the parameter is required, + // the default value will be ignored. + google.protobuf.Value default_value = 9; + } + + // Parameters to collect from the user. + repeated Parameter parameters = 1; +} + +// An event handler specifies an [event][google.cloud.dialogflow.cx.v3beta1.EventHandler.event] that can be handled +// during a session. When the specified event happens, the following actions are +// taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.EventHandler.trigger_fulfillment] associated with +// the event, it will be called. +// * If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_page] associated +// with the event, the session will transition into the specified page. +// * If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_flow] associated +// with the event, the session will transition into the specified flow. +message EventHandler { + // Output only. The unique identifier of this event handler. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the event to handle. + string event = 4 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the event occurs. + // Handling webhook errors with a fulfillment enabled with webhook could + // cause infinite loop. It is invalid to specify such fulfillment for a + // handler handling webhooks. + Fulfillment trigger_fulfillment = 5; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// A transition route specifies a [intent][google.cloud.dialogflow.cx.v3beta1.Intent] that can be matched and/or a +// data condition that can be evaluated during a session. When a specified +// transition is matched, the following actions are taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.trigger_fulfillment] associated with +// the transition, it will be called. +// * If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_page] associated +// with the transition, the session will transition into the specified page. +// * If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_flow] associated +// with the transition, the session will transition into the specified flow. +message TransitionRoute { + // Output only. The unique identifier of this transition route. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent]. + // Format: `projects//locations//agents//intents/`. + // Indicates that the transition can only happen when the given intent is + // matched. + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or + // [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string condition = 2; + + // The fulfillment to call when the condition is satisfied. At least one of + // `trigger_fulfillment` and `target` must be specified. When both are + // defined, `trigger_fulfillment` is executed first. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesRequest { + // Required. The flow to list all pages for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to list pages for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + 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 [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesResponse { + // The list of pages. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Page pages = 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 [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage]. +message GetPageRequest { + // Required. The name of the page. + // Format: `projects//locations//agents//flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to retrieve the page for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]. +message CreatePageRequest { + // Required. The flow to create a page for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // Required. The page to create. + Page page = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage]. +message UpdatePageRequest { + // Required. The page to update. + Page page = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + 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 [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage]. +message DeletePageRequest { + // Required. The name of the page to delete. + // Format: `projects//locations//agents//Flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + } + ]; + + // This field has no effect for pages with no incoming transitions. + // For pages with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the page, as well as + // any transitions to the page. + bool force = 2; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/google/cloud/dialogflow/cx/v3beta1/response_message.proto new file mode 100644 index 00000000..2822d612 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -0,0 +1,223 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "ResponseMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Represents a response message that can be returned by a conversational agent. +// +// Response messages are also used for output audio synthesis. The approach is +// as follows: +// +// * If at least one OutputAudioText response is present, then all +// OutputAudioText responses are linearly concatenated, and the result is used +// for output audio synthesis. +// * If the OutputAudioText responses are a mixture of text and SSML, then the +// concatenated result is treated as SSML; otherwise, the result is treated as +// either text or SSML as appropriate. The agent designer should ideally use +// either text or SSML consistently throughout the bot design. +// * Otherwise, all Text responses are linearly concatenated, and the result is +// used for output audio synthesis. +// +// This approach allows for more sophisticated user experience scenarios, where +// the text displayed to the user may differ from what is heard. +message ResponseMessage { + // The text response message. + message Text { + // Required. A collection of text responses. + repeated string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether the playback of this message can be interrupted by the end + // user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2; + } + + // Indicates that the conversation should be handed off to a human agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message HumanAgentHandoff { + option deprecated = true; + + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation should be handed off to a live agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation succeeded, i.e., the bot handled the issue + // that the customer talked to it about. + // + // Dialogflow only uses this to determine which conversations should be + // counted as successful and doesn't process the metadata in this message in + // any way. Note that Dialogflow also considers conversations that get to the + // conversation end page as successful even if they don't return + // [ConversationSuccess][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess]. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates that the conversation succeeded. + // * In a webhook response when you determine that you handled the customer + // issue. + message ConversationSuccess { + // Custom metadata. Dialogflow doesn't impose any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Specifies an audio clip to be played by the client as part of the response. + message PlayAudio { + // Required. URI of the audio clip. Dialogflow does not impose any validation on this + // value. It is specific to the client that reads it. + string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether the playback of this message can be interrupted by the end + // user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2; + } + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + message OutputAudioText { + // The source, which is either plain text or SSML. + oneof source { + // The raw text to be synthesized. + string text = 1; + + // The SSML text to be synthesized. For more information, see + // [SSML](/speech/text-to-speech/docs/ssml). + string ssml = 2; + } + } + + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction { + + } + + // Represents an audio message that is composed of both segments + // synthesized from the Dialogflow agent prompts and ones hosted externally + // at the specified URIs. + // The external URIs are specified via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message MixedAudio { + // Represents one segment of audio. + message Segment { + // Content of the segment. + oneof content { + // Raw audio synthesized from the Dialogflow agent's response using + // the output config specified in the request. + bytes audio = 1; + + // Client-specific URI that points to an audio clip accessible to the + // client. Dialogflow does not impose any validation on it. + string uri = 2; + } + + // Whether the playback of this segment can be interrupted by the end + // user's speech and the client should then start the next Dialogflow + // request. + bool allow_playback_interruption = 3; + } + + // Segments this audio response is composed of. + repeated Segment segments = 1; + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Hands off conversation to a human agent. + HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + + // Indicates that the conversation succeeded. + ConversationSuccess conversation_success = 9; + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + OutputAudioText output_audio_text = 8; + + // Hands off conversation to a human agent. + LiveAgentHandoff live_agent_handoff = 10; + + // Output only. A signal that indicates the interaction with the Dialogflow agent has + // ended. + // This message is generated by Dialogflow only when the conversation + // reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be + // defined by the user. + // It's guaranteed that there is at most one such message in each response. + EndInteraction end_interaction = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Signal that the client should play an audio clip hosted at a + // client-specific URI. Dialogflow uses this to construct + // [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself + // does not try to read or process the URI in any way. + PlayAudio play_audio = 12; + + // Output only. An audio response message composed of both the synthesized Dialogflow + // agent responses and responses defined via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + MixedAudio mixed_audio = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/google/cloud/dialogflow/cx/v3beta1/session.proto b/google/cloud/dialogflow/cx/v3beta1/session.proto new file mode 100644 index 00000000..5853a8cc --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -0,0 +1,645 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3beta1/intent.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}" +}; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine +// user intent and respond. +service Sessions { + 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"; + + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause session + // entity types to be updated, which in turn might affect results of future + // queries. + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent" + body: "*" + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) { + } + + // Returns preliminary intent match results, doesn't change the session + // status. + rpc MatchIntent(MatchIntentRequest) returns (MatchIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent" + body: "*" + }; + } + + // Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. + // Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from + // [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined. + rpc FulfillIntent(FulfillIntentRequest) returns (FulfillIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent" + body: "*" + }; + } +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If + // multiple default text responses exist, they will be concatenated when + // generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 4; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 5; +} + +// The top-level message sent by the client to the +// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], +// [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] plus optionally +// [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. If the client +// wants to receive an audio response, it should also contain +// [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. +// +// 2. If [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] was set to +// [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], all subsequent messages +// must contain [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] to continue with +// Speech recognition. +// If you decide to rather detect an intent from text +// input after you already started Speech recognition, please send a message +// with [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. +// +// However, note that: +// +// * Dialogflow will bill you for the audio duration so far. +// * Dialogflow discards all Speech recognition results in favor of the +// input text. +// * Dialogflow will use the language code from the first message. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingDetectIntentRequest { + // The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // Note: session must be set in the first request. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The top-level message returned from the `StreamingDetectIntent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The last message contains `detect_intent_response`. +message StreamingDetectIntentResponse { + // The output response. + oneof response { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The response from detect intent. + DetectIntentResponse detect_intent_response = 2; + } +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// Example: +// +// 1. transcript: "tube" +// +// 2. transcript: "to be a" +// +// 3. transcript: "to be" +// +// 4. transcript: "to be or not to be" +// is_final: true +// +// 5. transcript: " that's" +// +// 6. transcript: " that is" +// +// 7. message_type: `END_OF_SINGLE_UTTERANCE` +// +// 8. transcript: " that is the question" +// is_final: true +// +// Only two of the responses contain final results (#4 and #8 indicated by +// `is_final: true`). Concatenating these generates the full transcript: "to be +// or not to be that is the question". +// +// In each response we populate: +// +// * for `TRANSCRIPT`: `transcript` and possibly `is_final`. +// +// * for `END_OF_SINGLE_UTTERANCE`: only `message_type`. +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // Event indicates that the server has detected the end of the user's speech + // utterance and expects no additional speech. Therefore, the server will + // not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // [`single_utterance`][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.single_utterance] was set to + // `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `message_type` = `TRANSCRIPT`. + string transcript = 2; + + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `message_type` = `TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; + + // An estimate of the likelihood that the speech recognizer will + // not change its guess about this interim recognition result: + // * If the value is unspecified or 0.0, Dialogflow didn't compute the + // stability. In particular, Dialogflow will only provide stability for + // `TRANSCRIPT` results with `is_final = false`. + // * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely + // unstable and 1.0 means completely stable. + float stability = 6; + + // Word-specific information for the words recognized by Speech in + // [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and + // [InputAudioConfig.enable_word_info] is set. + repeated SpeechWordInfo speech_word_info = 7; + + // Time offset of the end of this Speech recognition result relative to the + // beginning of the audio. Only populated for `message_type` = + // `TRANSCRIPT`. + google.protobuf.Duration speech_end_offset = 8; +} + +// Represents the parameters of a conversational query. +message QueryParameters { + // The time zone of this conversational query from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. If not provided, the time zone specified in the agent is + // used. + string time_zone = 1; + + // The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Additional session entity types to replace or extend developer entity types + // with. The entity synonyms apply to all languages and persist for the + // session of this query. + repeated SessionEntityType session_entity_types = 3; + + // This field can be used to pass custom data into the webhook associated with + // the agent. Arbitrary JSON objects are supported. + google.protobuf.Struct payload = 4; + + // Additional parameters to be put into [session + // parameters][SessionInfo.parameters]. To remove a + // parameter from the session, clients should explicitly set the parameter + // value to null. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 5; +} + +// Represents the query input. It can contain either: +// +// 1. A conversational query in the form of text. +// +// 2. An intent query that specifies which intent to trigger. +message QueryInput { + // Required. The input specification. + oneof input { + // The natural language text to be processed. + TextInput text = 2; + + // The intent to be triggered. + IntentInput intent = 3; + + // The natural language speech audio to be processed. + AudioInput audio = 5; + } + + // Required. The language of the input. See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + // list of the currently supported language codes. Note that queries in the + // same session do not necessarily need to specify the same language. + string language_code = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the result of a conversational query. +message QueryResult { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field + // will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will + // contain a copy of the intent identifier. + string trigger_intent = 11; + + // If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input, + // this field will contain the trascript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain + // the name of the event. + string trigger_event = 14; + } + + // The language that was triggered during intent detection. + // See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 2; + + // The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 3; + + // The list of rich messages returned to the client. Responses vary from + // simple text messages to more sophisticated, structured payloads used + // to drive complex logic. + repeated ResponseMessage response_messages = 4; + + // The list of webhook call status in the order of call sequence. + repeated google.rpc.Status webhook_statuses = 13; + + // The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in + // the order of call sequence. If some webhook call fails or doesn't return + // any payload, an empty `Struct` would be used instead. + repeated google.protobuf.Struct webhook_payloads = 6; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message, + // including but not limited to `name` and `display_name`. + Page current_page = 7; + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields + // are filled in this message, including but not limited to: `name` and + // `display_name`. + // This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead. + Intent intent = 8 [deprecated = true]; + + // The intent detection confidence. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + // This value is for informational purpose only and is only used to + // help match the best intent within the classification threshold. + // This value may change for the same end-user expression at any time due to a + // model retraining or change in implementation. + // This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead. + float intent_detection_confidence = 9 [deprecated = true]; + + // Intent match result, could be an intent or an event. + Match match = 15; + + // The free-form diagnostic info. For example, this field could contain + // webhook call latency. The string keys of the Struct's fields map can change + // without notice. + google.protobuf.Struct diagnostic_info = 10; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. Text length must + // not exceed 256 characters. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the intent to trigger programmatically rather than as a result of +// natural language processing. +message IntentInput { + // Required. The unique identifier of the intent. + // Format: `projects//locations//agents//intents/`. + string intent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the natural speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The natural language speech audio to be processed. + // A single request can contain up to 1 minute of speech audio data. + // The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256 + // bytes. + // + // For non-streaming audio detect intent, both `config` and `audio` must be + // provided. + // For streaming audio detect intent, `config` must be provided in + // the first request and `audio` must be provided in all following requests. + bytes audio = 2; +} + +// Represents one match result of [MatchIntent][]. +message Match { + // Type of a Match. + enum MatchType { + // Not specified. Should never be used. + MATCH_TYPE_UNSPECIFIED = 0; + + // The query was matched to an intent. + INTENT = 1; + + // The query directly triggered an intent. + DIRECT_INTENT = 2; + + // The query was used for parameter filling. + PARAMETER_FILLING = 3; + + // No match was found for the query. + NO_MATCH = 4; + + // Indicates an empty query. + NO_INPUT = 5; + } + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in + // this message, including but not limited to: `name` and `display_name`. Only + // filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. + Intent intent = 1; + + // The collection of parameters extracted from the query. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 2; + + // Final text input which was matched during MatchIntent. This value can be + // different from original input sent in request because of spelling + // correction or other processing. + string resolved_input = 3; + + // Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match]. + MatchType match_type = 4; + + // The confidence of this match. Values range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // This value is for informational purpose only and is only used to help match + // the best intent within the classification threshold. This value may change + // for the same end-user expression at any time due to a model retraining or + // change in implementation. + float confidence = 5; +} + +// Request of [MatchIntent][]. +message MatchIntentRequest { + // Required. The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of [MatchIntent][]. +message MatchIntentResponse { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field + // will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will + // contain a copy of the intent identifier. + string trigger_intent = 2; + + // If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input, + // this field will contain the trascript for the audio. + string transcript = 3; + } + + // Match results, if more than one, ordered descendingly by the confidence + // we have that the particular intent matches the query. + repeated Match matches = 4; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message, + // including but not limited to `name` and `display_name`. + Page current_page = 5; +} + +// Request of [FulfillIntent][] +message FulfillIntentRequest { + // Must be same as the corresponding MatchIntent request, otherwise the + // behavior is undefined. + MatchIntentRequest match_intent_request = 1; + + // The matched intent/event to fulfill. + Match match = 2; + + // Instructs the speech synthesizer how to generate output audio. + OutputAudioConfig output_audio_config = 3; +} + +// Response of [FulfillIntent][] +message FulfillIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If + // multiple default text responses exist, they will be concatenated when + // generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 3; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto b/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto new file mode 100644 index 00000000..2e4fb4b1 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto @@ -0,0 +1,226 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. +service SessionEntityTypes { + 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 session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a session entity type. + // + // If the specified session entity type already exists, overrides the + // session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + body: "session_entity_type" + }; + option (google.api.method_signature) = "parent,session_entity_type"; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + }; + option (google.api.method_signature) = "session_entity_type,update_mask"; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as favorites, +// preferences, playlists, and so on. +// +// You can redefine a session entity type at the session level to extend or +// replace a [custom entity type][google.cloud.dialogflow.cx.v3beta1.EntityType] at the user session level (we +// refer to the entity types defined at the agent level as "custom entity +// types"). +// +// Note: session entity types apply to all queries, regardless of the language. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message SessionEntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SessionEntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }; + + // The types of modifications for the session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding custom entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding custom entity type. + // + // Note: Even in this override mode calls to `ListSessionEntityTypes`, + // `GetSessionEntityType`, `CreateSessionEntityType` and + // `UpdateSessionEntityType` only return the additional entities added in + // this session entity type. If you want to get the supplemented list, + // please call [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType] on the custom entity type + // and merge. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of the session entity type. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates whether the additional data should override or supplement the + // custom entity type definition. + EntityOverrideMode entity_override_mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The collection of entities to override or supplement the custom entity + // type. + repeated EntityType.Entity entities = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: `projects//locations//agents//sessions/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 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 [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} + +// The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: `projects//locations//agents//sessions/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The session entity type to update. + // Format: `projects//locations//agents//sessions//entityTypes/`. + SessionEntityType session_entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the session entity type to delete. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto b/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto new file mode 100644 index 00000000..a2eed7b4 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto @@ -0,0 +1,248 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "TransitionRouteGroupProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. +service TransitionRouteGroups { + 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 transition route groups in the specified flow. + rpc ListTransitionRouteGroups(ListTransitionRouteGroupsRequest) returns (ListTransitionRouteGroupsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc GetTransitionRouteGroup(GetTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow. + rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + body: "transition_route_group" + }; + option (google.api.method_signature) = "parent,transition_route_group"; + } + + // Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + patch: "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + body: "transition_route_group" + }; + option (google.api.method_signature) = "transition_route_group,update_mask"; + } + + // Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// An TransitionRouteGroup represents a group of +// [`TransitionRoutes`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. +message TransitionRouteGroup { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}" + }; + + // The unique identifier of the transition route group. + // [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name + // automatically. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1; + + // Required. The human-readable name of the transition route group, unique within + // the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // Duplicate transition routes (i.e. using the same + // [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed. + // + // Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the + // transition route group scope. + repeated TransitionRoute transition_routes = 5; +} + +// The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsRequest { + // Required. The flow to list all transition route groups for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsResponse { + // The list of transition route groups. There will be a maximum number of + // items returned based on the page_size field in the request. The list may in + // some cases be empty or contain fewer entries than page_size even if this + // isn't the last page. + repeated TransitionRouteGroup transition_route_groups = 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 [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup]. +message GetTransitionRouteGroupRequest { + // Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup]. +message CreateTransitionRouteGroupRequest { + // Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // Required. The transition route group to create. + TransitionRouteGroup transition_route_group = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup]. +message UpdateTransitionRouteGroupRequest { + // Required. The transition route group to update. + TransitionRouteGroup transition_route_group = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup]. +message DeleteTransitionRouteGroupRequest { + // Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // This field has no effect for transition route group that no page is using. + // If the transition route group is referenced by any page: + // + // * If `force` is set to false, an error will be returned with message + // indicating pages that reference the transition route group. + // * If `force` is set to true, Dialogflow will remove the transition route + // group, as well as any reference to it. + bool force = 2; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/version.proto b/google/cloud/dialogflow/cx/v3beta1/version.proto new file mode 100644 index 00000000..819a6d3c --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/version.proto @@ -0,0 +1,261 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "VersionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. +service Versions { + 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 versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version"; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "CreateVersionOperationMetadata" + }; + } + + // Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Loads a specified version to draft version. + rpc LoadVersion(LoadVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Metadata associated with the long running operation for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionOperationMetadata { + // Name of the created version. + // Format: `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; +} + +// Represents a version of a flow. +message Version { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }; + + // The state of the version. + enum State { + // Not specified. This value is not used. + STATE_UNSPECIFIED = 0; + + // Version is not ready to serve (e.g. training is running). + RUNNING = 1; + + // Training has succeeded and this version is ready to serve. + SUCCEEDED = 2; + + // Version training failed. + FAILED = 3; + } + + // Format: projects//locations//agents//flows//versions/. Version ID is a self-increasing + // number generated by Dialogflow upon version creation. + string name = 1; + + // Required. The human-readable name of the version. Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the version. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // Output only. The NLU settings of the flow at version creation. + NluSettings nlu_settings = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time of the version. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this version. This field is read-only and cannot be set by + // create and update methods. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsResponse { + // A list of versions. There will be a maximum number of items returned based + // on the page_size field in the request. The list may in some cases be empty + // or contain fewer entries than page_size even if this isn't the last page. + repeated Version versions = 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 [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion]. +message GetVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. The version to create. + Version version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion]. +message UpdateVersionRequest { + // Required. The version to update. + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. Currently only `description` + // and `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion]. +message DeleteVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion]. +message LoadVersionRequest { + // Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // This field is used to prevent accidental overwrite of other agent resources + // in the draft version, which can potentially impact other flow's behavior. + // If `allow_override_agent_resources` is false, conflicted agent-level + // resources will not be overridden (i.e. intents, entities, webhooks). + bool allow_override_agent_resources = 2; +} diff --git a/google/cloud/dialogflow/cx/v3beta1/webhook.proto b/google/cloud/dialogflow/cx/v3beta1/webhook.proto new file mode 100644 index 00000000..ff565474 --- /dev/null +++ b/google/cloud/dialogflow/cx/v3beta1/webhook.proto @@ -0,0 +1,430 @@ +// Copyright 2020 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.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. +service Webhooks { + 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 webhooks in the specified agent. + rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified webhook. + rpc GetWebhook(GetWebhookRequest) returns (Webhook) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a webhook in the specified agent. + rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + body: "webhook" + }; + option (google.api.method_signature) = "parent,webhook"; + } + + // Updates the specified webhook. + rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + patch: "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}" + body: "webhook" + }; + option (google.api.method_signature) = "webhook,update_mask"; + } + + // Deletes the specified webhook. + rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Webhooks host the developer's business logic. During a session, webhooks +// allow the developer to use the data extracted by Dialogflow's natural +// language processing to generate dynamic responses, validate collected data, +// or trigger actions on the backend. +message Webhook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Webhook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }; + + // Represents configuration for a generic web service. + message GenericWebService { + // Required. The webhook URI for receiving POST requests. It must use https protocol. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The user name for HTTP Basic authentication. + string username = 2 [deprecated = true]; + + // The password for HTTP Basic authentication. + string password = 3 [deprecated = true]; + + // The HTTP request headers to send together with webhook + // requests. + map request_headers = 4; + } + + // The unique identifier of the webhook. + // Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method. + // [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically. + // Format: `projects//locations//agents//webhooks/`. + string name = 1; + + // Required. The human-readable name of the webhook, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The webhook configuration. + oneof webhook { + // Configuration for a generic web service. + GenericWebService generic_web_service = 4; + } + + // Webhook execution timeout. Execution is considered failed if Dialogflow + // doesn't receive a response from webhook at the end of the timeout period. + // Defaults to 5 seconds, maximum allowed timeout is 30 seconds. + google.protobuf.Duration timeout = 6; + + // Indicates whether the webhook is disabled. + bool disabled = 5; +} + +// The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksRequest { + // Required. The agent to list all webhooks for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksResponse { + // The list of webhooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Webhook webhooks = 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 [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. +message GetWebhookRequest { + // Required. The name of the webhook. + // Format: `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. +message CreateWebhookRequest { + // Required. The agent to create a webhook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // Required. The webhook to create. + Webhook webhook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. +message UpdateWebhookRequest { + // Required. The webhook to update. + Webhook webhook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. +message DeleteWebhookRequest { + // Required. The name of the webhook to delete. + // Format: `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for a webhook call. +message WebhookRequest { + // Represents fulfillment information communicated to the webhook. + message FulfillmentInfo { + // Always present. The tag used to identify which fulfillment is being + // called. + string tag = 1; + } + + // Represents intent information communicated to the webhook. + message IntentInfo { + // Represents a value for an intent parameter. + message IntentParameterValue { + // Always present. Original text value extracted from user utterance. + string original_value = 1; + + // Always present. Structured value for the parameter extracted from user + // utterance. + google.protobuf.Value resolved_value = 2; + } + + // Always present. The unique identifier of the last matched + // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects//locations//agents//intents/`. + string last_matched_intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Parameters identified as a result of intent matching. This is a map of + // the name of the identified parameter to the value of the parameter + // identified from the user's utterance. All parameters defined in the + // matched intent that are identified will be surfaced here. + map parameters = 2; + } + + // Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that + // will be returned to the API caller. + string detect_intent_response_id = 1; + + // Always present. Information about the fulfillment that triggered this + // webhook call. + FulfillmentInfo fulfillment_info = 6; + + // Information about the last matched intent. + IntentInfo intent_info = 3; + + // Information about page status. + PageInfo page_info = 4; + + // Information about session status. + SessionInfo session_info = 5; + + // The list of rich message responses to present to the user. Webhook can + // choose to append or replace this list in + // [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response]; + repeated ResponseMessage messages = 7; + + // Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload]. + google.protobuf.Struct payload = 8; +} + +// The response message for a webhook call. +message WebhookResponse { + // Represents a fulfillment response to the user. + message FulfillmentResponse { + // Defines merge behavior for `messages`. + enum MergeBehavior { + // Not specified. `APPEND` will be used. + MERGE_BEHAVIOR_UNSPECIFIED = 0; + + // `messages` will be appended to the list of messages waiting to be sent + // to the user. + APPEND = 1; + + // `messages` will replace the list of messages waiting to be sent to the + // user. + REPLACE = 2; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // Merge behavior for `messages`. + MergeBehavior merge_behavior = 2; + } + + // The fulfillment response to send to the user. This field can be omitted by + // the webhook if it does not intend to send any response to the user. + FulfillmentResponse fulfillment_response = 1; + + // Information about page status. This field can be omitted by the webhook if + // it does not intend to modify page status. + PageInfo page_info = 2; + + // Information about session status. This field can be omitted by the webhook + // if it does not intend to modify session status. + SessionInfo session_info = 3; + + // Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads]. + google.protobuf.Struct payload = 4; + + // The target to transition to. This can be set optionally to indicate an + // immediate transition to a different page in the same host flow, or a + // different flow in the same agent. + oneof transition { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 6 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// Represents page information communicated to and from the webhook. +message PageInfo { + // Represents form information. + message FormInfo { + // Represents parameter information. + message ParameterInfo { + // Represents the state of a parameter. + enum ParameterState { + // Not specified. This value should be never used. + PARAMETER_STATE_UNSPECIFIED = 0; + + // Indicates that the parameter does not have a value. + EMPTY = 1; + + // Indicates that the parameter value is invalid. This field can be used + // by the webhook to invalidate the parameter and ask the server to + // collect it from the user again. + INVALID = 2; + + // Indicates that the parameter has a value. + FILLED = 3; + } + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The human-readable name of the parameter, unique within the form. This + // field cannot be modified by the webhook. + string display_name = 1; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates whether the parameter is required. Optional parameters will + // not trigger prompts; however, they are filled if the user specifies + // them. Required parameters must be filled before form filling concludes. + bool required = 2; + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set + // to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by + // the webhook to invalidate the parameter; other values set by the + // webhook will be ignored. + ParameterState state = 3; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The value of the parameter. This field can be set by the webhook to + // change the parameter value. + google.protobuf.Value value = 4; + + // Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates if the parameter value was just collected on the last + // conversation turn. + bool just_collected = 5; + } + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The parameters contained in the form. Note that the webhook cannot add + // or remove any form parameter. + repeated ParameterInfo parameter_info = 2; + } + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The unique identifier of the current page. + // Format: `projects//locations//agents//flows//pages/`. + string current_page = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Information about the form. + FormInfo form_info = 3; +} + +// Represents session information communicated to and from the webhook. +message SessionInfo { + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This + // field can be used by the webhook to identify a user. + // Format: `projects//locations//agents//sessions/`. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // All parameters collected from forms and intents during the session. + // Parameters can be created, updated, or removed by the webhook. To remove a + // parameter from the session, the webhook should explicitly set the parameter + // value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters' + // display names. + map parameters = 2; +}