diff --git a/tonic_textual/classes/record_api_request_options.py b/tonic_textual/classes/record_api_request_options.py index acbd518..e1fa9ab 100644 --- a/tonic_textual/classes/record_api_request_options.py +++ b/tonic_textual/classes/record_api_request_options.py @@ -13,10 +13,10 @@ class RecordApiRequestOptions(dict): retention_time_in_hours: int The number of hours to store the request. The request is then purged automatically. - tags : Optional[List[str]] - An optional list of tags to assign to the request. Used to help search for the request on the API Explorer page. + tags : List[str] + A list of tags to assign to the request. Used to help search for the request on the API Explorer page. The default is the empty list [], which corresponds to assigning no tags to the request. """ - def __init__(self, record: bool, retention_time_in_hours: int, tags: Optional[List[str]] = []): + def __init__(self, record: bool, retention_time_in_hours: int, tags: List[str] = []): self.record = record self.retention_time_in_hours = retention_time_in_hours self.tags = tags diff --git a/tonic_textual/redact_api.py b/tonic_textual/redact_api.py index ffdc66f..13ec67d 100644 --- a/tonic_textual/redact_api.py +++ b/tonic_textual/redact_api.py @@ -224,7 +224,7 @@ def redact( random_seed: Optional[int] = None, label_block_lists: Optional[Dict[str, List[str]]] = None, label_allow_lists: Optional[Dict[str, List[str]]] = None, - record_options: Optional[RecordApiRequestOptions] = default_record_options + record_options: RecordApiRequestOptions = default_record_options ) -> RedactionResponse: """Redacts a string. Depending on the configured handling for each sensitive data type, values are either redacted, synthesized, or ignored. @@ -256,8 +256,8 @@ def redact( A dictionary of (entity type, additional values). When a piece of text matches a listed regular expression, the text is marked as the entity type and is included in the redaction or synthesis. - record_options: Optional[RecordApiRequestOptions] - An optional value to record API the request and results for analysis in the Textual application. The default value is False. + record_options: RecordApiRequestOptions + A value to record the API request and results for analysis in the Textual application. The default value is to not record the API request and results in the Textual application. Returns ------- @@ -313,8 +313,7 @@ def redact_bulk( generator_default: PiiState = PiiState.Redaction, random_seed: Optional[int] = None, label_block_lists: Optional[Dict[str, List[str]]] = None, - label_allow_lists: Optional[Dict[str, List[str]]] = None, - record: Optional[RecordApiRequestOptions] = False + label_allow_lists: Optional[Dict[str, List[str]]] = None ) -> BulkRedactionResponse: """Redacts a string. Depending on the configured handling for each sensitive data type, values are either redacted, synthesized, or ignored. @@ -346,8 +345,6 @@ def redact_bulk( A dictionary of (entity type, additional values). When a piece of text matches a listed regular expression, the text is marked as the entity type and is included in the redaction or synthesis. - record: Optional[bool] - An optional value to record the API request and results for analysis in the Textual application. The default value is False. Returns ------- @@ -388,7 +385,6 @@ def redact_bulk( for k, v in label_allow_lists.items() } - payload["record"] = True if record else False return self.send_redact_bulk_request("/api/redact/bulk", payload, random_seed)