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

feat: add metadata from dialogflow related to transcript segment #54

Merged
merged 2 commits into from Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions google/cloud/contact_center_insights_v1/types/resources.py
Expand Up @@ -157,6 +157,9 @@ class Transcript(proto.Message):
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):
Expand All @@ -179,6 +182,11 @@ class TranscriptSegment(proto.Message):
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):
Expand Down Expand Up @@ -209,6 +217,22 @@ class WordInfo(proto.Message):
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(
Expand All @@ -221,6 +245,12 @@ class WordInfo(proto.Message):
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,
Expand Down Expand Up @@ -1276,6 +1306,8 @@ class ConversationParticipant(proto.Message):
Deprecated. Use ``dialogflow_participant_name`` instead. The
name of the Dialogflow participant. Format:
projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
obfuscated_external_user_id (str):
Obfuscated user ID from Dialogflow.
role (google.cloud.contact_center_insights_v1.types.ConversationParticipant.Role):
The role of the participant.
"""
Expand All @@ -1293,6 +1325,7 @@ class Role(proto.Enum):
)
user_id = proto.Field(proto.STRING, number=6, oneof="participant",)
dialogflow_participant = proto.Field(proto.STRING, number=1,)
obfuscated_external_user_id = proto.Field(proto.STRING, number=3,)
role = proto.Field(proto.ENUM, number=2, enum=Role,)


Expand Down