Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the LLM uses ellipsis in place of the REDACTED string, print the original version #614

Closed
wants to merge 1 commit into from

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Jan 16, 2025

I was able to make the LLM to reply with REDACTED=<...> when
summarizing code. Because our regex and the prefix marker expected the
redacted string to contain the dollar sign, we never flushed the prefix
buffer correctly and ended up later flushing repeatedly.

…riginal version

I was able to make the LLM to reply with `REDACTED=<...>` when
summarizing code. Because our regex and the prefix marker expected the
redacted string to contain the dollar sign, we never flushed the prefix
buffer correctly and ended up later flushing repeatedly.
@@ -312,8 +312,8 @@ class SecretUnredactionStep(OutputPipelineStep):
"""Pipeline step that unredacts protected content in the stream"""

def __init__(self):
self.redacted_pattern = re.compile(r"REDACTED<\$([^>]+)>")
self.marker_start = "REDACTED<$"
self.redacted_pattern = re.compile(r"REDACTED<(\$?[^>]+)>")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with all regexes, this will start getting harder to maintain with time. Mind adding a couple of examples expected patterns?

@jhrozek
Copy link
Contributor Author

jhrozek commented Jan 16, 2025

this was obsoleted by #608

@jhrozek jhrozek closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants