Skip to content

Commit

Permalink
feat: add Configurable Analysis, Bulk Upload, Bulk Analyze, Delete Is…
Browse files Browse the repository at this point in the history
…sue Apis

PiperOrigin-RevId: 495057883
  • Loading branch information
Google APIs authored and Copybara-Service committed Dec 13, 2022
1 parent 0ff0b24 commit 59a66eb
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 0 deletions.
169 changes: 169 additions & 0 deletions google/cloud/contactcenterinsights/v1/contact_center_insights.proto
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,33 @@ service ContactCenterInsights {
option (google.api.method_signature) = "name";
}

// Analyzes multiple conversations in a single request.
rpc BulkAnalyzeConversations(BulkAnalyzeConversationsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze"
body: "*"
};
option (google.api.method_signature) = "parent,filter,analysis_percentage";
option (google.longrunning.operation_info) = {
response_type: "BulkAnalyzeConversationsResponse"
metadata_type: "BulkAnalyzeConversationsMetadata"
};
}

// Imports conversations and processes them according to the user's
// configuration.
rpc IngestConversations(IngestConversationsRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/conversations:ingest"
body: "*"
};
option (google.api.method_signature) = "parent";
option (google.longrunning.operation_info) = {
response_type: "IngestConversationsResponse"
metadata_type: "IngestConversationsMetadata"
};
}

// Export insights data to a destination defined in the request body.
rpc ExportInsightsData(ExportInsightsDataRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
Expand Down Expand Up @@ -237,6 +264,14 @@ service ContactCenterInsights {
option (google.api.method_signature) = "issue,update_mask";
}

// Deletes an issue.
rpc DeleteIssue(DeleteIssueRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}"
};
option (google.api.method_signature) = "name";
}

// Gets an issue model's statistics.
rpc CalculateIssueModelStats(CalculateIssueModelStatsRequest) returns (CalculateIssueModelStatsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -456,6 +491,9 @@ message CreateAnalysisOperationMetadata {
type: "contactcenterinsights.googleapis.com/Conversation"
}
];

// Output only. The annotator selector used for the analysis (if any).
AnnotatorSelector annotator_selector = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request to create a conversation.
Expand Down Expand Up @@ -559,6 +597,73 @@ message DeleteConversationRequest {
bool force = 2;
}

// The request to ingest conversations.
message IngestConversationsRequest {
// Configuration for Cloud Storage bucket sources.
message GcsSource {
// Required. The Cloud Storage bucket containing source objects.
string bucket_uri = 1 [(google.api.field_behavior) = REQUIRED];
}

// Configuration for processing transcript objects.
message TranscriptObjectConfig {
// Required. The medium transcript objects represent.
Conversation.Medium medium = 1 [(google.api.field_behavior) = REQUIRED];
}

// Configuration that applies to all conversations.
message ConversationConfig {
// An opaque, user-specified string representing the human agent who handled
// the conversations.
string agent_id = 1;
}

// Configuration for an external data store containing objects that will
// be converted to conversations.
oneof source {
// A cloud storage bucket source.
GcsSource gcs_source = 2;
}

// Configuration for converting individual `source` objects to conversations.
oneof object_config {
// Configuration for when `source` contains conversation transcripts.
TranscriptObjectConfig transcript_object_config = 3;
}

// Required. The parent resource for new conversations.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Configuration that applies to all conversations.
ConversationConfig conversation_config = 4;
}

// The metadata for an IngestConversations operation.
message IngestConversationsMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The original request for ingest.
IngestConversationsRequest request = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Partial errors during ingest operation that might cause the operation
// output to be incomplete.
repeated google.rpc.Status partial_errors = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The response to an IngestConversations operation.
message IngestConversationsResponse {

}

// The request to create an analysis.
message CreateAnalysisRequest {
// Required. The parent resource of the analysis.
Expand Down Expand Up @@ -631,6 +736,59 @@ message DeleteAnalysisRequest {
];
}

// The request to analyze conversations in bulk.
message BulkAnalyzeConversationsRequest {
// Required. The parent resource to create analyses in.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Required. Filter used to select the subset of conversations to analyze.
string filter = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Percentage of selected conversation to analyze, between
// [0, 100].
float analysis_percentage = 3 [(google.api.field_behavior) = REQUIRED];

// To select the annotators to run and the phrase matchers to use
// (if any). If not specified, all annotators will be run.
AnnotatorSelector annotator_selector = 8;
}

// The metadata for a bulk analyze conversations operation.
message BulkAnalyzeConversationsMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;

// The time the operation finished running.
google.protobuf.Timestamp end_time = 2;

// The original request for bulk analyze.
BulkAnalyzeConversationsRequest request = 3;

// The number of requested analyses that have completed successfully so far.
int32 completed_analyses_count = 4;

// The number of requested analyses that have failed so far.
int32 failed_analyses_count = 5;

// Total number of analyses requested. Computed by the number of conversations
// returned by `filter` multiplied by `analysis_percentage` in the request.
int32 total_requested_analyses_count = 6;
}

// The response for a bulk analyze conversations operation.
message BulkAnalyzeConversationsResponse {
// Count of successful analyses.
int32 successful_analysis_count = 1;

// Count of failed analyses.
int32 failed_analysis_count = 2;
}

// The request to export insights.
message ExportInsightsDataRequest {
// A BigQuery Table Reference.
Expand Down Expand Up @@ -891,6 +1049,17 @@ message UpdateIssueRequest {
google.protobuf.FieldMask update_mask = 2;
}

// The request to delete an issue.
message DeleteIssueRequest {
// Required. The name of the issue to delete.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/Issue"
}
];
}

// Request to get statistics of an issue model.
message CalculateIssueModelStatsRequest {
// Required. The resource name of the issue model to query against.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ apis:
- name: google.longrunning.Operations

types:
- name: google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata
- name: google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse
- name: google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata
- name: google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata
- name: google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata
- name: google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata
- name: google.cloud.contactcenterinsights.v1.DeployIssueModelResponse
- name: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata
- name: google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse
- name: google.cloud.contactcenterinsights.v1.IngestConversationsMetadata
- name: google.cloud.contactcenterinsights.v1.IngestConversationsResponse
- name: google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata
- name: google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse

Expand All @@ -37,3 +41,6 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
publishing:
organization: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED
64 changes: 64 additions & 0 deletions google/cloud/contactcenterinsights/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ message Analysis {
// Output only. The result of the analysis, which is populated when the analysis
// finishes.
AnalysisResult analysis_result = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// To select the annotators to run and the phrase matchers to use
// (if any). If not specified, all annotators will be run.
AnnotatorSelector annotator_selector = 8;
}

// The conversation source, which is a combination of transcript and audio.
Expand Down Expand Up @@ -356,6 +360,9 @@ message CallAnnotation {

// Data specifying a phrase match.
PhraseMatchData phrase_match_data = 17;

// Data specifying an issue match.
IssueMatchData issue_match_data = 18;
}

// The channel of the audio where the annotation occurs. For single-channel
Expand Down Expand Up @@ -579,6 +586,12 @@ message SentimentData {
float score = 2;
}

// The data for an issue match annotation.
message IssueMatchData {
// Information about the issue's assignment.
IssueAssignment issue_assignment = 1;
}

// The issue model resource.
message IssueModel {
option (google.api.resource) = {
Expand Down Expand Up @@ -670,6 +683,10 @@ message Issue {

// Output only. The most recent time that this issue was updated.
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Resource names of the sample representative utterances that match to this
// issue.
repeated string sample_utterances = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Aggregated statistics about an issue model.
Expand Down Expand Up @@ -828,6 +845,10 @@ message Settings {
// Percentage of conversations created using Dialogflow runtime integration
// to analyze automatically, between [0, 100].
double runtime_integration_analysis_percentage = 1;

// To select the annotators to run and the phrase matchers to use
// (if any). If not specified, all annotators will be run.
AnnotatorSelector annotator_selector = 5;
}

// Immutable. The resource name of the settings resource.
Expand Down Expand Up @@ -1114,3 +1135,46 @@ message View {
// String with specific view properties.
string value = 5;
}

// Selector of all available annotators and phrase matchers to run.
message AnnotatorSelector {
// Whether to run the interruption annotator.
bool run_interruption_annotator = 1;

// Whether to run the silence annotator.
bool run_silence_annotator = 2;

// Whether to run the active phrase matcher annotator(s).
bool run_phrase_matcher_annotator = 3;

// The list of phrase matchers to run. If not provided, all active phrase
// matchers will be used. If inactive phrase matchers are provided, they will
// not be used. Phrase matchers will be run only if
// run_phrase_matcher_annotator is set to true. Format:
// projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
repeated string phrase_matchers = 4 [(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/PhraseMatcher"
}];

// Whether to run the sentiment annotator.
bool run_sentiment_annotator = 5;

// Whether to run the entity annotator.
bool run_entity_annotator = 6;

// Whether to run the intent annotator.
bool run_intent_annotator = 7;

// Whether to run the issue model annotator. A model should have already been
// deployed for this to take effect.
bool run_issue_model_annotator = 8;

// The issue model to run. If not provided, the most recently deployed topic
// model will be used. The provided issue model will only be used for
// inference if the issue model is deployed and if run_issue_model_annotator
// is set to true. If more than one issue model is provided, only the first
// provided issue model will be used for inference.
repeated string issue_models = 10 [(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/IssueModel"
}];
}

0 comments on commit 59a66eb

Please sign in to comment.