Skip to content

Commit

Permalink
Update to mask_pii method to mask only the response content and not t…
Browse files Browse the repository at this point in the history
…he reference links
  • Loading branch information
mdciri committed Nov 5, 2024
1 parent 344fdbc commit 09ba87a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/chatbot/src/modules/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def _unmask_reference(self, response_str: str, nodes) -> str:
def mask_pii(self, message: str) -> str:
if USE_PRESIDIO:
try:
return self.pii.mask_pii(message)
split_message = message.split("Rif:")
masked_message = self.pii.mask_pii(split_message[0])
if len(split_message)>1:
masked_message = masked_message + "Rif:" + split_message[1]
return masked_message
except Exception as e:
logging.warning(f"[chatbot.py - mask_pii] exception in mask_pii: {e}")
else:
Expand Down

0 comments on commit 09ba87a

Please sign in to comment.