From a6cbc5fabe30ffce1a46885e80ec552fd2ea6b8d Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 3 Dec 2020 15:08:48 -0800 Subject: [PATCH] feat: added support for regionalization for document API docs: suggested to always use version for production traffic when calling DetectIntent.marked match_mode in Agent message as deprecated PiperOrigin-RevId: 345544333 --- google/cloud/dialogflow/v2beta1/agent.proto | 2 +- .../dialogflow/v2beta1/audio_config.proto | 60 +++++++++---------- .../dialogflow_grpc_service_config.json | 3 + .../cloud/dialogflow/v2beta1/document.proto | 52 ++++++++++++---- .../dialogflow/v2beta1/knowledge_base.proto | 31 ++++++++-- google/cloud/dialogflow/v2beta1/session.proto | 18 +++++- 6 files changed, 119 insertions(+), 47 deletions(-) diff --git a/google/cloud/dialogflow/v2beta1/agent.proto b/google/cloud/dialogflow/v2beta1/agent.proto index 43584102..bb413e84 100644 --- a/google/cloud/dialogflow/v2beta1/agent.proto +++ b/google/cloud/dialogflow/v2beta1/agent.proto @@ -305,7 +305,7 @@ message Agent { bool enable_logging = 8; // Optional. Determines how intents are detected from user queries. - MatchMode match_mode = 9; + MatchMode match_mode = 9 [deprecated = true]; // Optional. To filter out false positive results and still get variety in // matched natural language inputs for your agent, you can tune the machine diff --git a/google/cloud/dialogflow/v2beta1/audio_config.proto b/google/cloud/dialogflow/v2beta1/audio_config.proto index f9a9d53e..7afa9bbc 100644 --- a/google/cloud/dialogflow/v2beta1/audio_config.proto +++ b/google/cloud/dialogflow/v2beta1/audio_config.proto @@ -30,36 +30,6 @@ option java_outer_classname = "AudioConfigProto"; option java_package = "com.google.cloud.dialogflow.v2beta1"; option objc_class_prefix = "DF"; -// Hints for the speech recognizer to help with recognition in a specific -// conversation state. -message SpeechContext { - // Optional. A list of strings containing words and phrases that the speech - // recognizer should recognize with higher likelihood. - // - // This list can be used to: - // - // * improve accuracy for words and phrases you expect the user to say, - // e.g. typical commands for your Dialogflow agent - // * add additional words to the speech recognizer vocabulary - // * ... - // - // See the [Cloud Speech - // documentation](https://cloud.google.com/speech-to-text/quotas) for usage - // limits. - repeated string phrases = 1; - - // Optional. Boost for this context compared to other contexts: - // - // * If the boost is positive, Dialogflow will increase the probability that - // the phrases in this context are recognized over similar sounding phrases. - // * If the boost is unspecified or non-positive, Dialogflow will not apply - // any boost. - // - // Dialogflow recommends that you use boosts in the range (0, 20] and that you - // find a value that fits your use case with binary search. - float boost = 2; -} - // Audio encoding of the audio content sent in the conversational query request. // Refer to the // [Cloud Speech API @@ -109,6 +79,36 @@ enum AudioEncoding { AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; } +// Hints for the speech recognizer to help with recognition in a specific +// conversation state. +message SpeechContext { + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // This list can be used to: + // + // * improve accuracy for words and phrases you expect the user to say, + // e.g. typical commands for your Dialogflow agent + // * add additional words to the speech recognizer vocabulary + // * ... + // + // See the [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/quotas) for usage + // limits. + repeated string phrases = 1; + + // Optional. Boost for this context compared to other contexts: + // + // * If the boost is positive, Dialogflow will increase the probability that + // the phrases in this context are recognized over similar sounding phrases. + // * If the boost is unspecified or non-positive, Dialogflow will not apply + // any boost. + // + // Dialogflow recommends that you use boosts in the range (0, 20] and that you + // find a value that fits your use case with binary search. + float boost = 2; +} + // Information for a word recognized by the speech recognizer. message SpeechWordInfo { // The word this info is for. diff --git a/google/cloud/dialogflow/v2beta1/dialogflow_grpc_service_config.json b/google/cloud/dialogflow/v2beta1/dialogflow_grpc_service_config.json index 339f745f..eebb6218 100755 --- a/google/cloud/dialogflow/v2beta1/dialogflow_grpc_service_config.json +++ b/google/cloud/dialogflow/v2beta1/dialogflow_grpc_service_config.json @@ -14,6 +14,9 @@ { "service": "google.cloud.dialogflow.aam.v2beta1.AamLabels" }, + { + "service": "google.cloud.dialogflow.aam.v2beta1.AamNotices" + }, { "service": "google.cloud.dialogflow.aam.v2beta1.AamTasks" }, diff --git a/google/cloud/dialogflow/v2beta1/document.proto b/google/cloud/dialogflow/v2beta1/document.proto index 94d7055a..a0bc4812 100644 --- a/google/cloud/dialogflow/v2beta1/document.proto +++ b/google/cloud/dialogflow/v2beta1/document.proto @@ -49,6 +49,9 @@ service Documents { rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { option (google.api.http) = { get: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + } additional_bindings { get: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" } @@ -63,6 +66,9 @@ service Documents { rpc GetDocument(GetDocumentRequest) returns (Document) { option (google.api.http) = { get: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } additional_bindings { get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" } @@ -78,6 +84,10 @@ service Documents { option (google.api.http) = { post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents" body: "document" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + body: "document" + } additional_bindings { post: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" body: "document" @@ -97,6 +107,9 @@ service Documents { rpc DeleteDocument(DeleteDocumentRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } additional_bindings { delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" } @@ -116,6 +129,10 @@ service Documents { option (google.api.http) = { patch: "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}" body: "document" + additional_bindings { + patch: "/v2beta1/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}" + body: "document" + } additional_bindings { patch: "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}" body: "document" @@ -143,6 +160,10 @@ service Documents { option (google.api.http) = { post: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload" body: "*" + additional_bindings { + post: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload" + body: "*" + } additional_bindings { post: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload" body: "*" @@ -167,6 +188,7 @@ message Document { option (google.api.resource) = { type: "dialogflow.googleapis.com/Document" pattern: "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}" + pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}" }; // The status of a reload attempt. @@ -201,8 +223,8 @@ message Document { // Optional. The document resource name. // The name must be empty when creating a document. - // Format: `projects//knowledgeBases//documents/`. + // Format: `projects//locations//knowledgeBases//documents/`. string name = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. The display name of the document. The name must be 1024 bytes or @@ -266,8 +288,8 @@ message Document { // Request message for [Documents.GetDocument][google.cloud.dialogflow.v2beta1.Documents.GetDocument]. message GetDocumentRequest { // Required. The name of the document to retrieve. - // Format `projects//knowledgeBases//documents/`. + // Format `projects//locations//knowledgeBases//documents/`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -279,7 +301,8 @@ message GetDocumentRequest { // Request message for [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments]. message ListDocumentsRequest { // Required. The knowledge base to list all documents for. - // Format: `projects//knowledgeBases/`. + // Format: `projects//locations//knowledgeBases/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -331,7 +354,8 @@ message ListDocumentsResponse { // Request message for [Documents.CreateDocument][google.cloud.dialogflow.v2beta1.Documents.CreateDocument]. message CreateDocumentRequest { // Required. The knowledge base to create a document for. - // Format: `projects//knowledgeBases/`. + // Format: `projects//locations//knowledgeBases/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -341,13 +365,17 @@ message CreateDocumentRequest { // Required. The document to create. Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // Whether to import custom metadata from Google Cloud Storage. + // Only valid when the document source is Google Cloud Storage URI. + bool import_gcs_custom_metadata = 3; } // Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2beta1.Documents.DeleteDocument]. message DeleteDocumentRequest { // Required. The name of the document to delete. - // Format: `projects//knowledgeBases//documents/`. + // Format: `projects//locations//knowledgeBases//documents/`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -391,8 +419,8 @@ message KnowledgeOperationMetadata { // Request message for [Documents.ReloadDocument][google.cloud.dialogflow.v2beta1.Documents.ReloadDocument]. message ReloadDocumentRequest { // Required. The name of the document to reload. - // Format: `projects//knowledgeBases//documents/` + // Format: `projects//locations//knowledgeBases//documents/` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -408,4 +436,8 @@ message ReloadDocumentRequest { // If not provided, the Document's existing source will be reloaded. GcsSource gcs_source = 3; } + + // Whether to import custom metadata from Google Cloud Storage. + // Only valid when the document source is Google Cloud Storage URI. + bool import_gcs_custom_metadata = 4; } diff --git a/google/cloud/dialogflow/v2beta1/knowledge_base.proto b/google/cloud/dialogflow/v2beta1/knowledge_base.proto index 48f1be62..997b2bea 100644 --- a/google/cloud/dialogflow/v2beta1/knowledge_base.proto +++ b/google/cloud/dialogflow/v2beta1/knowledge_base.proto @@ -45,6 +45,9 @@ service KnowledgeBases { rpc ListKnowledgeBases(ListKnowledgeBasesRequest) returns (ListKnowledgeBasesResponse) { option (google.api.http) = { get: "/v2beta1/{parent=projects/*}/knowledgeBases" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases" + } additional_bindings { get: "/v2beta1/{parent=projects/*/agent}/knowledgeBases" } @@ -59,6 +62,9 @@ service KnowledgeBases { rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) { option (google.api.http) = { get: "/v2beta1/{name=projects/*/knowledgeBases/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" + } additional_bindings { get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" } @@ -74,6 +80,10 @@ service KnowledgeBases { option (google.api.http) = { post: "/v2beta1/{parent=projects/*}/knowledgeBases" body: "knowledge_base" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases" + body: "knowledge_base" + } additional_bindings { post: "/v2beta1/{parent=projects/*/agent}/knowledgeBases" body: "knowledge_base" @@ -89,6 +99,9 @@ service KnowledgeBases { rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2beta1/{name=projects/*/knowledgeBases/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" + } additional_bindings { delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" } @@ -104,6 +117,10 @@ service KnowledgeBases { option (google.api.http) = { patch: "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}" body: "knowledge_base" + additional_bindings { + patch: "/v2beta1/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}" + body: "knowledge_base" + } additional_bindings { patch: "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}" body: "knowledge_base" @@ -128,11 +145,13 @@ message KnowledgeBase { option (google.api.resource) = { type: "dialogflow.googleapis.com/KnowledgeBase" pattern: "projects/{project}/knowledgeBases/{knowledge_base}" + pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" }; // The knowledge base resource name. // The name must be empty when creating a knowledge base. - // Format: `projects//knowledgeBases/`. + // Format: `projects//locations//knowledgeBases/`. string name = 1; // Required. The display name of the knowledge base. The name must be 1024 @@ -148,7 +167,7 @@ message KnowledgeBase { // Request message for [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases]. message ListKnowledgeBasesRequest { // Required. The project to list of knowledge bases for. - // Format: `projects/`. + // Format: `projects//locations/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -205,7 +224,8 @@ message ListKnowledgeBasesResponse { // Request message for [KnowledgeBases.GetKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBase]. message GetKnowledgeBaseRequest { // Required. The name of the knowledge base to retrieve. - // Format `projects//knowledgeBases/`. + // Format `projects//locations//knowledgeBases/`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -217,7 +237,7 @@ message GetKnowledgeBaseRequest { // Request message for [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBase]. message CreateKnowledgeBaseRequest { // Required. The project to create a knowledge base for. - // Format: `projects/`. + // Format: `projects//locations/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -232,7 +252,8 @@ message CreateKnowledgeBaseRequest { // Request message for [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase]. message DeleteKnowledgeBaseRequest { // Required. The name of the knowledge base to delete. - // Format: `projects//knowledgeBases/`. + // Format: `projects//locations//knowledgeBases/`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/google/cloud/dialogflow/v2beta1/session.proto b/google/cloud/dialogflow/v2beta1/session.proto index 340051c1..566824d5 100644 --- a/google/cloud/dialogflow/v2beta1/session.proto +++ b/google/cloud/dialogflow/v2beta1/session.proto @@ -60,6 +60,10 @@ service Sessions { // as a result. This method is not idempotent, because it may cause contexts // and session entity types to be updated, which in turn might affect // results of future queries. + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { option (google.api.http) = { post: "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent" @@ -83,6 +87,10 @@ service Sessions { // 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). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) { } } @@ -107,6 +115,10 @@ message DetectIntentRequest { // The length of the `Session ID` and `User ID` must not exceed 36 characters. // For more information, see the [API interactions // guide](https://cloud.google.com/dialogflow/docs/api-overview). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). string session = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -234,7 +246,7 @@ message QueryParameters { repeated SubAgent sub_agents = 13; // This field can be used to pass HTTP headers for a webhook - // call. These headers will be sent to webhook alone with the headers that + // call. These headers will be sent to webhook along with the headers that // have been configured through Dialogflow web console. The headers defined // within this field will overwrite the headers configured through Dialogflow // console if there is a conflict. Header names are case-insensitive. @@ -487,6 +499,10 @@ message StreamingDetectIntentRequest { // // For more information, see the [API interactions // guide](https://cloud.google.com/dialogflow/docs/api-overview). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). string session = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = {