hark130 / jack-in-the-box

Connecting Jackbox games to the OpenAI API
GNU General Public License v3.0
1 stars 0 forks source link

JITB-46: Fix trim-trailing-punctuation feature #67

Open hark130 opened 1 month ago

hark130 commented 1 month ago

BUG

It's working ok... but sometimes that trailing punctuation is necessary. For instance, parentheses. This behavior is not desired:

[2024-10-02 19:38:58.225] DEBUGGING - Successfully cleaned "Want some attention? Go to a singles bar wearing a t-shirt that says “_______”" to "Want some attention? Go to a singles bar wearing a t-shirt that says "_______""
[2024-10-02 19:38:58.225] DEBUGGING - Polished "Free Hugs (Terms and Conditions Apply" from ""Free Hugs (Terms and Conditions Apply)"" for this: "Want some attention? Go to a singles bar wearing a t-shirt that says "_______""
[2024-10-02 19:38:58.374] DEBUGGING - Answered prompt "Want some attention? Go to a singles bar wearing a t-shirt that says “_______”" with "Free Hugs (Terms and Conditions Apply"!

See: logs/jitb_20241002_193447-0.log

SOLUTION

Keep an eye out for pairs of punctuation and leave them alone: ['"':'"', "'":"'", '(':')','[':']']