dsh-biocore 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -23,7 +23,12 @@ class ReplySanitizer:
|
|
|
23
23
|
|
|
24
24
|
CONTROL_TAG_PATTERNS = [
|
|
25
25
|
re.compile(r"<\s*(?:bc|biocore)\b[^>]*>.*?</\s*(?:bc|biocore)\s*>", re.I | re.S),
|
|
26
|
-
re.compile(r"<\s*(?:bc|biocore)\b[^>]*>[^\n]*", re.I),
|
|
26
|
+
re.compile(r"<\s*(?:bc|biocore)\b[^>]*>[^\n]*", re.I),
|
|
27
|
+
# Reminder tags are instructions for the model, never user-visible text.
|
|
28
|
+
re.compile(r"<\s*(?:system_reminder|reminder|system)\b[^>]*>.*?</\s*(?:system_reminder|reminder|system)\s*>", re.I | re.S),
|
|
29
|
+
re.compile(r"<\s*(?:system_reminder|reminder|system)\b[^>]*>[^\n]*", re.I),
|
|
30
|
+
# Models sometimes echo the instruction header verbatim.
|
|
31
|
+
re.compile(r"^\s*【[^】]*】\s*$", re.M),
|
|
27
32
|
re.compile(r"<\s*(?:thinking|think|thought|reasoning|analysis)\b[^>]*>.*?</\s*(?:thinking|think|thought|reasoning|analysis)\s*>", re.I | re.S),
|
|
28
33
|
re.compile(r"<\s*(?:thinking|think|thought|reasoning|analysis)\b[^>]*>[^\n]*", re.I),
|
|
29
34
|
re.compile(r"<\s*(?:思考|分析|推理|内心独白)\s*>.*?</\s*(?:思考|分析|推理|内心独白)\s*>", re.S),
|
|
@@ -1303,7 +1303,7 @@ class LengthHintTest(unittest.TestCase):
|
|
|
1303
1303
|
if "字以内" not in line and "一次只说一句" not in line]
|
|
1304
1304
|
self.assertEqual(strip(default), strip(explicit))
|
|
1305
1305
|
self.assertIn("语气自然平稳", "\n".join(default))
|
|
1306
|
-
self.assertIn("
|
|
1306
|
+
self.assertIn("先不主动发新消息", "\n".join(default))
|
|
1307
1307
|
self.assertIn("允许改口", "\n".join(default))
|
|
1308
1308
|
|
|
1309
1309
|
def test_prompt_still_has_intero_and_persona(self):
|