Skip to content

Conversation

@rlundeen2
Copy link
Contributor

@rlundeen2 rlundeen2 commented Dec 31, 2025

This PR refactors the MessageNormalizer abstraction to standardize how PyRIT converts Message objects into formats required by different LLM targets or situations. Or, as an example, to translate Message to a string that could be understood in a system prompt. It also adds documentation and improves test coverage.

This is an update to the old ChatMessageNormalizer class. This also refactors AzureMLTarget which made use of this, and removed other legacy places that used ChatMessage.

Note: this is part of a bigger change to normalize prepended_conversations for attacks. To see a prototype of that, see d647054

@romanlutz
Copy link
Contributor

We're removing an entire module that users might have interacted with so this is most definitely BREAKING.

@rlundeen2
Copy link
Contributor Author

We're removing an entire module that users might have interacted with so this is most definitely BREAKING.

For us only used in ChatMLTarget, and it was broken. So I doubt folks were using it, but worth marking anyway

@rlundeen2 rlundeen2 changed the title MAINT: Message Normalizer Refactor MAINT Breaking: Message Normalizer Refactor Dec 31, 2025
@rlundeen2 rlundeen2 merged commit e8ec417 into Azure:main Dec 31, 2025
20 checks passed
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