Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Configurable Analysis, Bulk Upload, Bulk Analyze, Delete Issue Apis #3736

Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions packages/google-cloud-contactcenterinsights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Contact_center_insights.bulk_analyze_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js,samples/README.md) |
| Contact_center_insights.calculate_issue_model_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js,samples/README.md) |
| Contact_center_insights.calculate_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js,samples/README.md) |
| Contact_center_insights.create_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js,samples/README.md) |
Expand All @@ -96,6 +97,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Contact_center_insights.create_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js,samples/README.md) |
| Contact_center_insights.delete_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js,samples/README.md) |
| Contact_center_insights.delete_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js,samples/README.md) |
| Contact_center_insights.delete_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js,samples/README.md) |
| Contact_center_insights.delete_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js,samples/README.md) |
| Contact_center_insights.delete_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js,samples/README.md) |
| Contact_center_insights.delete_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js,samples/README.md) |
Expand All @@ -108,6 +110,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Contact_center_insights.get_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js,samples/README.md) |
| Contact_center_insights.get_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js,samples/README.md) |
| Contact_center_insights.get_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js,samples/README.md) |
| Contact_center_insights.ingest_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js,samples/README.md) |
| Contact_center_insights.list_analyses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js,samples/README.md) |
| Contact_center_insights.list_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js,samples/README.md) |
| Contact_center_insights.list_issue_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js,samples/README.md) |
Expand Down
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
Loading