@@ -202,6 +202,11 @@ class WordBoost(str, Enum):
202
202
high = "high"
203
203
204
204
205
+ class PIIRedactedAudioQuality (str , Enum ):
206
+ mp3 = "mp3"
207
+ wav = "wav"
208
+
209
+
205
210
class EntityType (str , Enum ):
206
211
"""
207
212
Used for AssemblyAI's Entity Detection feature.
@@ -454,6 +459,8 @@ class RawTranscriptionConfig(BaseModel):
454
459
"Redact PII from the transcribed text."
455
460
redact_pii_audio : Optional [bool ]
456
461
"Generate a copy of the original media file with spoken PII 'beeped' out."
462
+ redact_pii_audio_quality : Optional [PIIRedactedAudioQuality ]
463
+ "The quality of the redacted audio file in case `redact_pii_audio` is enabled."
457
464
redact_pii_policies : Optional [List [PIIRedactionPolicy ]]
458
465
"The list of PII Redaction policies to enable."
459
466
redact_pii_sub : Optional [PIISubstitutionPolicy ]
@@ -543,6 +550,7 @@ def __init__(
543
550
filter_profanity : Optional [bool ] = None ,
544
551
redact_pii : Optional [bool ] = None ,
545
552
redact_pii_audio : Optional [bool ] = None ,
553
+ redact_pii_audio_quality : Optional [PIIRedactedAudioQuality ] = None ,
546
554
redact_pii_policies : Optional [List [PIIRedactionPolicy ]] = None ,
547
555
redact_pii_sub : Optional [PIISubstitutionPolicy ] = None ,
548
556
speaker_labels : Optional [bool ] = None ,
@@ -580,6 +588,7 @@ def __init__(
580
588
filter_profanity: Filter profanity from the transcribed text.
581
589
redact_pii: Redact PII from the transcribed text.
582
590
redact_pii_audio: Generate a copy of the original media file with spoken PII 'beeped' out (new audio only available for 24 hours).
591
+ redact_pii_audio_quality: The quality of the redacted audio file in case `redact_pii_audio` is enabled.
583
592
redact_pii_policies: The list of PII Redaction policies to enable.
584
593
redact_pii_sub: The replacement logic for detected PII.
585
594
speaker_labels: Enable Speaker Diarization.
@@ -623,6 +632,7 @@ def __init__(
623
632
self .set_redact_pii (
624
633
redact_pii ,
625
634
redact_pii_audio ,
635
+ redact_pii_audio_quality ,
626
636
redact_pii_policies ,
627
637
redact_pii_sub ,
628
638
)
@@ -773,6 +783,12 @@ def redact_pii_audio(self) -> Optional[bool]:
773
783
774
784
return self ._raw_transcription_config .redact_pii_audio
775
785
786
+ @property
787
+ def redact_pii_audio_quality (self ) -> Optional [PIIRedactedAudioQuality ]:
788
+ "The quality of the redacted audio file in case `redact_pii_audio` is enabled."
789
+
790
+ return self ._raw_transcription_config .redact_pii_audio_quality
791
+
776
792
@property
777
793
def redact_pii_policies (self ) -> Optional [List [PIIRedactionPolicy ]]:
778
794
"Returns a list of set of defined PII redaction policies."
@@ -1122,6 +1138,7 @@ def set_redact_pii(
1122
1138
self ,
1123
1139
enable : Optional [bool ] = True ,
1124
1140
redact_audio : Optional [bool ] = None ,
1141
+ redact_audio_quality : Optional [PIIRedactedAudioQuality ] = None ,
1125
1142
policies : Optional [List [PIIRedactionPolicy ]] = None ,
1126
1143
substitution : Optional [PIISubstitutionPolicy ] = None ,
1127
1144
) -> Self :
@@ -1131,13 +1148,15 @@ def set_redact_pii(
1131
1148
Args:
1132
1149
enable: whether to enable or disable the PII Redaction feature.
1133
1150
redact_audio: Generate a copy of the original media file with spoken PII 'beeped' out. NOTE: The copy is available for 24h
1151
+ redact_audio_quality: The quality of the redacted audio file in case `redact_audio` is enabled.
1134
1152
policies: A list of PII redaction policies to enable.
1135
1153
substitution: The replacement logic for detected PII (`PIISubstutionPolicy.hash` by default).
1136
1154
"""
1137
1155
1138
1156
if not enable :
1139
1157
self ._raw_transcription_config .redact_pii = None
1140
1158
self ._raw_transcription_config .redact_pii_audio = None
1159
+ self ._raw_transcription_config .redact_pii_audio_quality = None
1141
1160
self ._raw_transcription_config .redact_pii_policies = None
1142
1161
self ._raw_transcription_config .redact_pii_sub = None
1143
1162
@@ -1148,6 +1167,7 @@ def set_redact_pii(
1148
1167
1149
1168
self ._raw_transcription_config .redact_pii = True
1150
1169
self ._raw_transcription_config .redact_pii_audio = redact_audio
1170
+ self ._raw_transcription_config .redact_pii_audio_quality = redact_audio_quality
1151
1171
self ._raw_transcription_config .redact_pii_policies = policies
1152
1172
self ._raw_transcription_config .redact_pii_sub = substitution
1153
1173
@@ -1527,6 +1547,8 @@ class BaseTranscript(BaseModel):
1527
1547
"Redact PII from the transcribed text."
1528
1548
redact_pii_audio : Optional [bool ]
1529
1549
"Generate a copy of the original media file with spoken PII 'beeped' out."
1550
+ redact_pii_audio_quality : Optional [PIIRedactedAudioQuality ]
1551
+ "The quality of the redacted audio file in case `redact_pii_audio` is enabled."
1530
1552
redact_pii_policies : Optional [List [PIIRedactionPolicy ]]
1531
1553
"The list of PII Redaction policies to enable."
1532
1554
redact_pii_sub : Optional [PIISubstitutionPolicy ]
0 commit comments