This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
/
resources.py
1332 lines (1149 loc) · 53.1 KB
/
resources.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
# 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.
#
import proto # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
__protobuf__ = proto.module(
package="google.cloud.contactcenterinsights.v1",
manifest={
"Conversation",
"Analysis",
"ConversationDataSource",
"GcsSource",
"DialogflowSource",
"AnalysisResult",
"IssueModelResult",
"ConversationLevelSentiment",
"IssueAssignment",
"CallAnnotation",
"AnnotationBoundary",
"Entity",
"Intent",
"PhraseMatchData",
"DialogflowIntent",
"InterruptionData",
"SilenceData",
"HoldData",
"EntityMentionData",
"IntentMatchData",
"SentimentData",
"IssueModel",
"Issue",
"IssueModelLabelStats",
"PhraseMatcher",
"PhraseMatchRuleGroup",
"PhraseMatchRule",
"PhraseMatchRuleConfig",
"ExactMatchConfig",
"Settings",
"RuntimeAnnotation",
"AnswerFeedback",
"ArticleSuggestionData",
"FaqAnswerData",
"SmartReplyData",
"SmartComposeSuggestionData",
"DialogflowInteractionData",
"ConversationParticipant",
},
)
class Conversation(proto.Message):
r"""The conversation resource.
Attributes:
call_metadata (google.cloud.contact_center_insights_v1.types.Conversation.CallMetadata):
Call-specific metadata.
expire_time (google.protobuf.timestamp_pb2.Timestamp):
The time at which this conversation should
expire. After this time, the conversation data
and any associated analyses will be deleted.
ttl (google.protobuf.duration_pb2.Duration):
Input only. The TTL for this resource. If
specified, then this TTL will be used to
calculate the expire time.
name (str):
Immutable. The resource name of the
conversation. Format:
projects/{project}/locations/{location}/conversations/{conversation}
data_source (google.cloud.contact_center_insights_v1.types.ConversationDataSource):
The source of the audio and transcription for
the conversation.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The time at which the
conversation was created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The most recent time at which
the conversation was updated.
start_time (google.protobuf.timestamp_pb2.Timestamp):
The time at which the conversation started.
language_code (str):
A user-specified language code for the
conversation.
agent_id (str):
An opaque, user-specified string representing
the human agent who handled the conversation.
labels (Sequence[google.cloud.contact_center_insights_v1.types.Conversation.LabelsEntry]):
A map for the user to specify any custom
fields. A maximum of 20 labels per conversation
is allowed, with a maximum of 256 characters per
entry.
transcript (google.cloud.contact_center_insights_v1.types.Conversation.Transcript):
Output only. The conversation transcript.
medium (google.cloud.contact_center_insights_v1.types.Conversation.Medium):
Immutable. The conversation medium.
duration (google.protobuf.duration_pb2.Duration):
Output only. The duration of the
conversation.
turn_count (int):
Output only. The number of turns in the
conversation.
latest_analysis (google.cloud.contact_center_insights_v1.types.Analysis):
Output only. The conversation's latest
analysis, if one exists.
runtime_annotations (Sequence[google.cloud.contact_center_insights_v1.types.RuntimeAnnotation]):
Output only. The annotations that were
generated during the customer and agent
interaction.
dialogflow_intents (Sequence[google.cloud.contact_center_insights_v1.types.Conversation.DialogflowIntentsEntry]):
Output only. All the matched Dialogflow
intents in the call. The key corresponds to a
Dialogflow intent, format:
projects/{project}/agent/{agent}/intents/{intent}
"""
class Medium(proto.Enum):
r"""Possible media for the conversation."""
MEDIUM_UNSPECIFIED = 0
PHONE_CALL = 1
CHAT = 2
class CallMetadata(proto.Message):
r"""Call-specific metadata.
Attributes:
customer_channel (int):
The audio channel that contains the customer.
agent_channel (int):
The audio channel that contains the agent.
"""
customer_channel = proto.Field(proto.INT32, number=1,)
agent_channel = proto.Field(proto.INT32, number=2,)
class Transcript(proto.Message):
r"""A message representing the transcript of a conversation.
Attributes:
transcript_segments (Sequence[google.cloud.contact_center_insights_v1.types.Conversation.Transcript.TranscriptSegment]):
A list of sequential transcript segments that
comprise the conversation.
"""
class TranscriptSegment(proto.Message):
r"""A segment of a full transcript.
Attributes:
message_time (google.protobuf.timestamp_pb2.Timestamp):
The time that the message occurred, if
provided.
text (str):
The text of this segment.
confidence (float):
A confidence estimate between 0.0 and 1.0 of
the fidelity of this segment. A default value of
0.0 indicates that the value is unset.
words (Sequence[google.cloud.contact_center_insights_v1.types.Conversation.Transcript.TranscriptSegment.WordInfo]):
A list of the word-specific information for
each word in the segment.
language_code (str):
The language code of this segment as a
`BCP-47 <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>`__
language tag. Example: "en-US".
channel_tag (int):
For conversations derived from multi-channel
audio, this is the channel number corresponding
to the audio from that channel. For
audioChannelCount = N, its output values can
range from '1' to 'N'. A channel tag of 0
indicates that the audio is mono.
segment_participant (google.cloud.contact_center_insights_v1.types.ConversationParticipant):
The participant of this segment.
dialogflow_segment_metadata (google.cloud.contact_center_insights_v1.types.Conversation.Transcript.TranscriptSegment.DialogflowSegmentMetadata):
CCAI metadata relating to the current
transcript segment.
sentiment (google.cloud.contact_center_insights_v1.types.SentimentData):
The sentiment for this transcript segment.
"""
class WordInfo(proto.Message):
r"""Word-level info for words in a transcript.
Attributes:
start_offset (google.protobuf.duration_pb2.Duration):
Time offset of the start of this word
relative to the beginning of the total
conversation.
end_offset (google.protobuf.duration_pb2.Duration):
Time offset of the end of this word relative
to the beginning of the total conversation.
word (str):
The word itself. Includes punctuation marks
that surround the word.
confidence (float):
A confidence estimate between 0.0 and 1.0 of
the fidelity of this word. A default value of
0.0 indicates that the value is unset.
"""
start_offset = proto.Field(
proto.MESSAGE, number=1, message=duration_pb2.Duration,
)
end_offset = proto.Field(
proto.MESSAGE, number=2, message=duration_pb2.Duration,
)
word = proto.Field(proto.STRING, number=3,)
confidence = proto.Field(proto.FLOAT, number=4,)
class DialogflowSegmentMetadata(proto.Message):
r"""Metadata from Dialogflow relating to the current transcript
segment.
Attributes:
smart_reply_allowlist_covered (bool):
Whether the transcript segment was covered
under the configured smart reply allowlist in
Agent Assist.
"""
smart_reply_allowlist_covered = proto.Field(proto.BOOL, number=1,)
message_time = proto.Field(
proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,
)
text = proto.Field(proto.STRING, number=1,)
confidence = proto.Field(proto.FLOAT, number=2,)
words = proto.RepeatedField(
proto.MESSAGE,
number=3,
message="Conversation.Transcript.TranscriptSegment.WordInfo",
)
language_code = proto.Field(proto.STRING, number=4,)
channel_tag = proto.Field(proto.INT32, number=5,)
segment_participant = proto.Field(
proto.MESSAGE, number=9, message="ConversationParticipant",
)
dialogflow_segment_metadata = proto.Field(
proto.MESSAGE,
number=10,
message="Conversation.Transcript.TranscriptSegment.DialogflowSegmentMetadata",
)
sentiment = proto.Field(proto.MESSAGE, number=11, message="SentimentData",)
transcript_segments = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="Conversation.Transcript.TranscriptSegment",
)
call_metadata = proto.Field(
proto.MESSAGE, number=7, oneof="metadata", message=CallMetadata,
)
expire_time = proto.Field(
proto.MESSAGE, number=15, oneof="expiration", message=timestamp_pb2.Timestamp,
)
ttl = proto.Field(
proto.MESSAGE, number=16, oneof="expiration", message=duration_pb2.Duration,
)
name = proto.Field(proto.STRING, number=1,)
data_source = proto.Field(
proto.MESSAGE, number=2, message="ConversationDataSource",
)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)
start_time = proto.Field(proto.MESSAGE, number=17, message=timestamp_pb2.Timestamp,)
language_code = proto.Field(proto.STRING, number=14,)
agent_id = proto.Field(proto.STRING, number=5,)
labels = proto.MapField(proto.STRING, proto.STRING, number=6,)
transcript = proto.Field(proto.MESSAGE, number=8, message=Transcript,)
medium = proto.Field(proto.ENUM, number=9, enum=Medium,)
duration = proto.Field(proto.MESSAGE, number=10, message=duration_pb2.Duration,)
turn_count = proto.Field(proto.INT32, number=11,)
latest_analysis = proto.Field(proto.MESSAGE, number=12, message="Analysis",)
runtime_annotations = proto.RepeatedField(
proto.MESSAGE, number=13, message="RuntimeAnnotation",
)
dialogflow_intents = proto.MapField(
proto.STRING, proto.MESSAGE, number=18, message="DialogflowIntent",
)
class Analysis(proto.Message):
r"""The analysis resource.
Attributes:
name (str):
Immutable. The resource name of the analysis.
Format:
projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
request_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The time at which the analysis
was requested.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The time at which the analysis
was created, which occurs when the long-running
operation completes.
analysis_result (google.cloud.contact_center_insights_v1.types.AnalysisResult):
Output only. The result of the analysis,
which is populated when the analysis finishes.
"""
name = proto.Field(proto.STRING, number=1,)
request_time = proto.Field(
proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,
)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
analysis_result = proto.Field(proto.MESSAGE, number=7, message="AnalysisResult",)
class ConversationDataSource(proto.Message):
r"""The conversation source, which is a combination of transcript
and audio.
Attributes:
gcs_source (google.cloud.contact_center_insights_v1.types.GcsSource):
A Cloud Storage location specification for
the audio and transcript.
dialogflow_source (google.cloud.contact_center_insights_v1.types.DialogflowSource):
The source when the conversation comes from
Dialogflow.
"""
gcs_source = proto.Field(
proto.MESSAGE, number=1, oneof="source", message="GcsSource",
)
dialogflow_source = proto.Field(
proto.MESSAGE, number=3, oneof="source", message="DialogflowSource",
)
class GcsSource(proto.Message):
r"""A Cloud Storage source of conversation data.
Attributes:
audio_uri (str):
Cloud Storage URI that points to a file that
contains the conversation audio.
transcript_uri (str):
Immutable. Cloud Storage URI that points to a
file that contains the conversation transcript.
"""
audio_uri = proto.Field(proto.STRING, number=1,)
transcript_uri = proto.Field(proto.STRING, number=2,)
class DialogflowSource(proto.Message):
r"""A Dialogflow source of conversation data.
Attributes:
dialogflow_conversation (str):
Output only. The name of the Dialogflow
conversation that this conversation resource is
derived from. Format:
projects/{project}/locations/{location}/conversations/{conversation}
audio_uri (str):
Cloud Storage URI that points to a file that
contains the conversation audio.
"""
dialogflow_conversation = proto.Field(proto.STRING, number=1,)
audio_uri = proto.Field(proto.STRING, number=3,)
class AnalysisResult(proto.Message):
r"""The result of an analysis.
Attributes:
call_analysis_metadata (google.cloud.contact_center_insights_v1.types.AnalysisResult.CallAnalysisMetadata):
Call-specific metadata created by the
analysis.
end_time (google.protobuf.timestamp_pb2.Timestamp):
The time at which the analysis ended.
"""
class CallAnalysisMetadata(proto.Message):
r"""Call-specific metadata created during analysis.
Attributes:
annotations (Sequence[google.cloud.contact_center_insights_v1.types.CallAnnotation]):
A list of call annotations that apply to this
call.
entities (Sequence[google.cloud.contact_center_insights_v1.types.AnalysisResult.CallAnalysisMetadata.EntitiesEntry]):
All the entities in the call.
sentiments (Sequence[google.cloud.contact_center_insights_v1.types.ConversationLevelSentiment]):
Overall conversation-level sentiment for each
channel of the call.
intents (Sequence[google.cloud.contact_center_insights_v1.types.AnalysisResult.CallAnalysisMetadata.IntentsEntry]):
All the matched intents in the call.
phrase_matchers (Sequence[google.cloud.contact_center_insights_v1.types.AnalysisResult.CallAnalysisMetadata.PhraseMatchersEntry]):
All the matched phrase matchers in the call.
issue_model_result (google.cloud.contact_center_insights_v1.types.IssueModelResult):
Overall conversation-level issue modeling
result.
"""
annotations = proto.RepeatedField(
proto.MESSAGE, number=2, message="CallAnnotation",
)
entities = proto.MapField(
proto.STRING, proto.MESSAGE, number=3, message="Entity",
)
sentiments = proto.RepeatedField(
proto.MESSAGE, number=4, message="ConversationLevelSentiment",
)
intents = proto.MapField(
proto.STRING, proto.MESSAGE, number=6, message="Intent",
)
phrase_matchers = proto.MapField(
proto.STRING, proto.MESSAGE, number=7, message="PhraseMatchData",
)
issue_model_result = proto.Field(
proto.MESSAGE, number=8, message="IssueModelResult",
)
call_analysis_metadata = proto.Field(
proto.MESSAGE, number=2, oneof="metadata", message=CallAnalysisMetadata,
)
end_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,)
class IssueModelResult(proto.Message):
r"""Issue Modeling result on a conversation.
Attributes:
issue_model (str):
Issue model that generates the result.
issues (Sequence[google.cloud.contact_center_insights_v1.types.IssueAssignment]):
All the matched issues.
"""
issue_model = proto.Field(proto.STRING, number=1,)
issues = proto.RepeatedField(proto.MESSAGE, number=2, message="IssueAssignment",)
class ConversationLevelSentiment(proto.Message):
r"""One channel of conversation-level sentiment data.
Attributes:
channel_tag (int):
The channel of the audio that the data
applies to.
sentiment_data (google.cloud.contact_center_insights_v1.types.SentimentData):
Data specifying sentiment.
"""
channel_tag = proto.Field(proto.INT32, number=1,)
sentiment_data = proto.Field(proto.MESSAGE, number=2, message="SentimentData",)
class IssueAssignment(proto.Message):
r"""Information about the issue.
Attributes:
issue (str):
Resource name of the assigned issue.
score (float):
Score indicating the likelihood of the issue assignment.
currently bounded on [0,1].
display_name (str):
Immutable. Display name of the assigned
issue. This field is set at time of analyis and
immutable since then.
"""
issue = proto.Field(proto.STRING, number=1,)
score = proto.Field(proto.DOUBLE, number=2,)
display_name = proto.Field(proto.STRING, number=3,)
class CallAnnotation(proto.Message):
r"""A piece of metadata that applies to a window of a call.
Attributes:
interruption_data (google.cloud.contact_center_insights_v1.types.InterruptionData):
Data specifying an interruption.
sentiment_data (google.cloud.contact_center_insights_v1.types.SentimentData):
Data specifying sentiment.
silence_data (google.cloud.contact_center_insights_v1.types.SilenceData):
Data specifying silence.
hold_data (google.cloud.contact_center_insights_v1.types.HoldData):
Data specifying a hold.
entity_mention_data (google.cloud.contact_center_insights_v1.types.EntityMentionData):
Data specifying an entity mention.
intent_match_data (google.cloud.contact_center_insights_v1.types.IntentMatchData):
Data specifying an intent match.
phrase_match_data (google.cloud.contact_center_insights_v1.types.PhraseMatchData):
Data specifying a phrase match.
channel_tag (int):
The channel of the audio where the annotation
occurs. For single-channel audio, this field is
not populated.
annotation_start_boundary (google.cloud.contact_center_insights_v1.types.AnnotationBoundary):
The boundary in the conversation where the
annotation starts, inclusive.
annotation_end_boundary (google.cloud.contact_center_insights_v1.types.AnnotationBoundary):
The boundary in the conversation where the
annotation ends, inclusive.
"""
interruption_data = proto.Field(
proto.MESSAGE, number=10, oneof="data", message="InterruptionData",
)
sentiment_data = proto.Field(
proto.MESSAGE, number=11, oneof="data", message="SentimentData",
)
silence_data = proto.Field(
proto.MESSAGE, number=12, oneof="data", message="SilenceData",
)
hold_data = proto.Field(proto.MESSAGE, number=13, oneof="data", message="HoldData",)
entity_mention_data = proto.Field(
proto.MESSAGE, number=15, oneof="data", message="EntityMentionData",
)
intent_match_data = proto.Field(
proto.MESSAGE, number=16, oneof="data", message="IntentMatchData",
)
phrase_match_data = proto.Field(
proto.MESSAGE, number=17, oneof="data", message="PhraseMatchData",
)
channel_tag = proto.Field(proto.INT32, number=1,)
annotation_start_boundary = proto.Field(
proto.MESSAGE, number=4, message="AnnotationBoundary",
)
annotation_end_boundary = proto.Field(
proto.MESSAGE, number=5, message="AnnotationBoundary",
)
class AnnotationBoundary(proto.Message):
r"""A point in a conversation that marks the start or the end of
an annotation.
Attributes:
word_index (int):
The word index of this boundary with respect
to the first word in the transcript piece. This
index starts at zero.
transcript_index (int):
The index in the sequence of transcribed
pieces of the conversation where the boundary is
located. This index starts at zero.
"""
word_index = proto.Field(proto.INT32, number=3, oneof="detailed_boundary",)
transcript_index = proto.Field(proto.INT32, number=1,)
class Entity(proto.Message):
r"""The data for an entity annotation.
Represents a phrase in the conversation that is a known entity,
such as a person, an organization, or location.
Attributes:
display_name (str):
The representative name for the entity.
type_ (google.cloud.contact_center_insights_v1.types.Entity.Type):
The entity type.
metadata (Sequence[google.cloud.contact_center_insights_v1.types.Entity.MetadataEntry]):
Metadata associated with the entity.
For most entity types, the metadata is a Wikipedia URL
(``wikipedia_url``) and Knowledge Graph MID (``mid``), if
they are available. For the metadata associated with other
entity types, see the Type table below.
salience (float):
The salience score associated with the entity in the [0,
1.0] range.
The salience score for an entity provides information about
the importance or centrality of that entity to the entire
document text. Scores closer to 0 are less salient, while
scores closer to 1.0 are highly salient.
sentiment (google.cloud.contact_center_insights_v1.types.SentimentData):
The aggregate sentiment expressed for this
entity in the conversation.
"""
class Type(proto.Enum):
r"""The type of the entity. For most entity types, the associated
metadata is a Wikipedia URL (``wikipedia_url``) and Knowledge Graph
MID (``mid``). The table below lists the associated fields for
entities that have different metadata.
"""
TYPE_UNSPECIFIED = 0
PERSON = 1
LOCATION = 2
ORGANIZATION = 3
EVENT = 4
WORK_OF_ART = 5
CONSUMER_GOOD = 6
OTHER = 7
PHONE_NUMBER = 9
ADDRESS = 10
DATE = 11
NUMBER = 12
PRICE = 13
display_name = proto.Field(proto.STRING, number=1,)
type_ = proto.Field(proto.ENUM, number=2, enum=Type,)
metadata = proto.MapField(proto.STRING, proto.STRING, number=3,)
salience = proto.Field(proto.FLOAT, number=4,)
sentiment = proto.Field(proto.MESSAGE, number=5, message="SentimentData",)
class Intent(proto.Message):
r"""The data for an intent. Represents a detected intent in the
conversation, for example MAKES_PROMISE.
Attributes:
id (str):
The unique identifier of the intent.
display_name (str):
The human-readable name of the intent.
"""
id = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
class PhraseMatchData(proto.Message):
r"""The data for a matched phrase matcher.
Represents information identifying a phrase matcher for a given
match.
Attributes:
phrase_matcher (str):
The unique identifier (the resource name) of
the phrase matcher.
display_name (str):
The human-readable name of the phrase
matcher.
"""
phrase_matcher = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
class DialogflowIntent(proto.Message):
r"""The data for a Dialogflow intent. Represents a detected intent in
the conversation, e.g. MAKES_PROMISE.
Attributes:
display_name (str):
The human-readable name of the intent.
"""
display_name = proto.Field(proto.STRING, number=1,)
class InterruptionData(proto.Message):
r"""The data for an interruption annotation. """
class SilenceData(proto.Message):
r"""The data for a silence annotation. """
class HoldData(proto.Message):
r"""The data for a hold annotation. """
class EntityMentionData(proto.Message):
r"""The data for an entity mention annotation. This represents a mention
of an ``Entity`` in the conversation.
Attributes:
entity_unique_id (str):
The key of this entity in conversation entities. Can be used
to retrieve the exact ``Entity`` this mention is attached
to.
type_ (google.cloud.contact_center_insights_v1.types.EntityMentionData.MentionType):
The type of the entity mention.
sentiment (google.cloud.contact_center_insights_v1.types.SentimentData):
Sentiment expressed for this mention of the
entity.
"""
class MentionType(proto.Enum):
r"""The supported types of mentions."""
MENTION_TYPE_UNSPECIFIED = 0
PROPER = 1
COMMON = 2
entity_unique_id = proto.Field(proto.STRING, number=1,)
type_ = proto.Field(proto.ENUM, number=2, enum=MentionType,)
sentiment = proto.Field(proto.MESSAGE, number=3, message="SentimentData",)
class IntentMatchData(proto.Message):
r"""The data for an intent match.
Represents an intent match for a text segment in the
conversation. A text segment can be part of a sentence, a
complete sentence, or an utterance with multiple sentences.
Attributes:
intent_unique_id (str):
The id of the matched intent.
Can be used to retrieve the corresponding intent
information.
"""
intent_unique_id = proto.Field(proto.STRING, number=1,)
class SentimentData(proto.Message):
r"""The data for a sentiment annotation.
Attributes:
magnitude (float):
A non-negative number from 0 to infinity
which represents the abolute magnitude of
sentiment regardless of score.
score (float):
The sentiment score between -1.0 (negative)
and 1.0 (positive).
"""
magnitude = proto.Field(proto.FLOAT, number=1,)
score = proto.Field(proto.FLOAT, number=2,)
class IssueModel(proto.Message):
r"""The issue model resource.
Attributes:
name (str):
Immutable. The resource name of the issue model. Format:
projects/{project}/locations/{location}/issueModels/{issue_model}
display_name (str):
The representative name for the issue model.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The time at which this issue
model was created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The most recent time at which
the issue model was updated.
state (google.cloud.contact_center_insights_v1.types.IssueModel.State):
Output only. State of the model.
input_data_config (google.cloud.contact_center_insights_v1.types.IssueModel.InputDataConfig):
Configs for the input data that used to
create the issue model.
training_stats (google.cloud.contact_center_insights_v1.types.IssueModelLabelStats):
Output only. Immutable. The issue model's
label statistics on its training data.
"""
class State(proto.Enum):
r"""State of the model."""
STATE_UNSPECIFIED = 0
UNDEPLOYED = 1
DEPLOYING = 2
DEPLOYED = 3
UNDEPLOYING = 4
DELETING = 5
class InputDataConfig(proto.Message):
r"""Configs for the input data used to create the issue model.
Attributes:
medium (google.cloud.contact_center_insights_v1.types.Conversation.Medium):
Medium of conversations used in training data. This field is
being deprecated. To specify the medium to be used in
training a new issue model, set the ``medium`` field on
``filter``.
training_conversations_count (int):
Output only. Number of conversations used in
training. Output only.
filter (str):
A filter to reduce the conversations used for
training the model to a specific subset.
"""
medium = proto.Field(proto.ENUM, number=1, enum="Conversation.Medium",)
training_conversations_count = proto.Field(proto.INT64, number=2,)
filter = proto.Field(proto.STRING, number=3,)
name = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)
state = proto.Field(proto.ENUM, number=5, enum=State,)
input_data_config = proto.Field(proto.MESSAGE, number=6, message=InputDataConfig,)
training_stats = proto.Field(
proto.MESSAGE, number=7, message="IssueModelLabelStats",
)
class Issue(proto.Message):
r"""The issue resource.
Attributes:
name (str):
Immutable. The resource name of the issue. Format:
projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}
display_name (str):
The representative name for the issue.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The time at which this issue was
created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The most recent time that this
issue was updated.
"""
name = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)
class IssueModelLabelStats(proto.Message):
r"""Aggregated statistics about an issue model.
Attributes:
analyzed_conversations_count (int):
Number of conversations the issue model has
analyzed at this point in time.
unclassified_conversations_count (int):
Number of analyzed conversations for which no
issue was applicable at this point in time.
issue_stats (Sequence[google.cloud.contact_center_insights_v1.types.IssueModelLabelStats.IssueStatsEntry]):
Statistics on each issue. Key is the issue's
resource name.
"""
class IssueStats(proto.Message):
r"""Aggregated statistics about an issue.
Attributes:
issue (str):
Issue resource. Format:
projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}
labeled_conversations_count (int):
Number of conversations attached to the issue
at this point in time.
"""
issue = proto.Field(proto.STRING, number=1,)
labeled_conversations_count = proto.Field(proto.INT64, number=2,)
analyzed_conversations_count = proto.Field(proto.INT64, number=1,)
unclassified_conversations_count = proto.Field(proto.INT64, number=2,)
issue_stats = proto.MapField(
proto.STRING, proto.MESSAGE, number=3, message=IssueStats,
)
class PhraseMatcher(proto.Message):
r"""The phrase matcher resource.
Attributes:
name (str):
The resource name of the phrase matcher. Format:
projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
revision_id (str):
Output only. Immutable. The revision ID of
the phrase matcher. A new revision is committed
whenever the matcher is changed, except when it
is activated or deactivated. A server generated
random ID will be used. Example:
locations/global/phraseMatchers/my-first-
matcher@1234567
version_tag (str):
The customized version tag to use for the phrase matcher. If
not specified, it will default to ``revision_id``.
revision_create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The timestamp of when the
revision was created. It is also the create time
when a new matcher is added.
display_name (str):
The human-readable name of the phrase
matcher.
type_ (google.cloud.contact_center_insights_v1.types.PhraseMatcher.PhraseMatcherType):
Required. The type of this phrase matcher.
active (bool):
Applies the phrase matcher only when it is
active.
phrase_match_rule_groups (Sequence[google.cloud.contact_center_insights_v1.types.PhraseMatchRuleGroup]):
A list of phase match rule groups that are
included in this matcher.
activation_update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The most recent time at which
the activation status was updated.
role_match (google.cloud.contact_center_insights_v1.types.ConversationParticipant.Role):
The role whose utterances the phrase matcher should be
matched against. If the role is ROLE_UNSPECIFIED it will be
matched against any utterances in the transcript.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. The most recent time at which
the phrase matcher was updated.
"""
class PhraseMatcherType(proto.Enum):
r"""Specifies how to combine each phrase match rule group to
determine whether there is a match.
"""
PHRASE_MATCHER_TYPE_UNSPECIFIED = 0
ALL_OF = 1
ANY_OF = 2
name = proto.Field(proto.STRING, number=1,)
revision_id = proto.Field(proto.STRING, number=2,)
version_tag = proto.Field(proto.STRING, number=3,)
revision_create_time = proto.Field(
proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,
)
display_name = proto.Field(proto.STRING, number=5,)
type_ = proto.Field(proto.ENUM, number=6, enum=PhraseMatcherType,)
active = proto.Field(proto.BOOL, number=7,)
phrase_match_rule_groups = proto.RepeatedField(
proto.MESSAGE, number=8, message="PhraseMatchRuleGroup",
)
activation_update_time = proto.Field(
proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp,
)
role_match = proto.Field(
proto.ENUM, number=10, enum="ConversationParticipant.Role",
)
update_time = proto.Field(
proto.MESSAGE, number=11, message=timestamp_pb2.Timestamp,
)
class PhraseMatchRuleGroup(proto.Message):
r"""A message representing a rule in the phrase matcher.
Attributes:
type_ (google.cloud.contact_center_insights_v1.types.PhraseMatchRuleGroup.PhraseMatchRuleGroupType):
Required. The type of this phrase match rule
group.
phrase_match_rules (Sequence[google.cloud.contact_center_insights_v1.types.PhraseMatchRule]):
A list of phase match rules that are included
in this group.
"""
class PhraseMatchRuleGroupType(proto.Enum):
r"""Specifies how to combine each phrase match rule for whether
there is a match.
"""
PHRASE_MATCH_RULE_GROUP_TYPE_UNSPECIFIED = 0
ALL_OF = 1
ANY_OF = 2
type_ = proto.Field(proto.ENUM, number=1, enum=PhraseMatchRuleGroupType,)
phrase_match_rules = proto.RepeatedField(
proto.MESSAGE, number=2, message="PhraseMatchRule",
)
class PhraseMatchRule(proto.Message):
r"""The data for a phrase match rule.
Attributes:
query (str):
Required. The phrase to be matched.
negated (bool):
Specifies whether the phrase must be missing
from the transcript segment or present in the
transcript segment.
config (google.cloud.contact_center_insights_v1.types.PhraseMatchRuleConfig):
Provides additional information about the
rule that specifies how to apply the rule.
"""
query = proto.Field(proto.STRING, number=1,)
negated = proto.Field(proto.BOOL, number=2,)
config = proto.Field(proto.MESSAGE, number=3, message="PhraseMatchRuleConfig",)
class PhraseMatchRuleConfig(proto.Message):
r"""Configuration information of a phrase match rule.
Attributes:
exact_match_config (google.cloud.contact_center_insights_v1.types.ExactMatchConfig):
The configuration for the exact match rule.
"""
exact_match_config = proto.Field(
proto.MESSAGE, number=1, oneof="config", message="ExactMatchConfig",
)
class ExactMatchConfig(proto.Message):
r"""Exact match configuration.
Attributes:
case_sensitive (bool):
Whether to consider case sensitivity when
performing an exact match.
"""
case_sensitive = proto.Field(proto.BOOL, number=1,)