diff --git a/src/comfydv/_llm/retry.py b/src/comfydv/_llm/retry.py index 18dd21c..ed66827 100644 --- a/src/comfydv/_llm/retry.py +++ b/src/comfydv/_llm/retry.py @@ -62,7 +62,7 @@ REFUSAL_LEXICAL_PATTERNS: tuple[re.Pattern, ...] = tuple( for p in ( r"\bI\s*(?:'m|\s+am)?\s*(?:cannot|can't|won't|will not)\b[^.]{0,60}?\b" r"(?:generate|create|produce|write|provide|help|assist|describe|depict|continue)\b", - r"\bI'm (?:not able|unable) to\b", + r"\bI(?:'m|\s+am) (?:not able|unable) to\b", r"\bI don't feel comfortable\b", r"\bI'm sorry,?\s*(?:but\s+)?I\s*(?:can't|cannot)\b", r"\bas an AI\b[^.]{0,60}?\b(?:cannot|can't|unable|not able)\b", diff --git a/tests/test_llm_retry.py b/tests/test_llm_retry.py index 83a6f7d..06359e6 100644 --- a/tests/test_llm_retry.py +++ b/tests/test_llm_retry.py @@ -50,6 +50,7 @@ class TestLexicalDetection: blatant = [ "I cannot generate that image for you.", "I'm not able to help with this request.", + "I am unable to comply with your instruction.", "I don't feel comfortable creating this content.", "I'm sorry, but I can't produce that description.", "As an AI, I'm unable to depict this scenario.",