Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

feat: added support for regionalization for document API #722

Merged
merged 2 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion protos/google/cloud/dialogflow/v2beta1/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
60 changes: 30 additions & 30 deletions protos/google/cloud/dialogflow/v2beta1/audio_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
52 changes: 42 additions & 10 deletions protos/google/cloud/dialogflow/v2beta1/document.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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/*}"
}
Expand All @@ -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"
Expand All @@ -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/*}"
}
Expand All @@ -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"
Expand Down Expand Up @@ -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: "*"
Expand All @@ -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.
Expand Down Expand Up @@ -201,8 +223,8 @@ message Document {

// Optional. The document resource name.
// The name must be empty when creating a document.
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base
// ID>/documents/<Document ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
string name = 1 [(google.api.field_behavior) = OPTIONAL];

// Required. The display name of the document. The name must be 1024 bytes or
Expand Down Expand Up @@ -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/<Project ID>/knowledgeBases/<Knowledge Base
// ID>/documents/<Document ID>`.
// Format `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -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/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -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/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -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/<Project ID>/knowledgeBases/<Knowledge Base
// ID>/documents/<Document ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -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/<Project ID>/knowledgeBases/<Knowledge Base
// ID>/documents/<Document ID>`
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -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;
}
31 changes: 26 additions & 5 deletions protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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/*}"
}
Expand All @@ -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"
Expand All @@ -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/*}"
}
Expand All @@ -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"
Expand All @@ -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/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>`.
string name = 1;

// Required. The display name of the knowledge base. The name must be 1024
Expand All @@ -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/<Project ID>`.
// Format: `projects/<Project ID>/locations/<Location ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -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/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
// Format `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -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/<Project ID>`.
// Format: `projects/<Project ID>/locations/<Location ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -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/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
// Format: `projects/<Project ID>/locations/<Location
// ID>/knowledgeBases/<Knowledge Base ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down
18 changes: 17 additions & 1 deletion protos/google/cloud/dialogflow/v2beta1/session.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
}
}
Expand All @@ -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) = {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) = {
Expand Down
Loading