fix: tool-block parsing crashes on a non-string input (#1628)
This commit is contained in:
@@ -69,6 +69,8 @@ _TOOL_CODE_RE = re.compile(
|
||||
# fullwidth (U+FF5C) and ascii '|' in any count.
|
||||
_DSML_PIPES = r"[||]+"
|
||||
def _normalize_dsml(text: str) -> str:
|
||||
if not isinstance(text, str):
|
||||
return ""
|
||||
if "DSML" not in text:
|
||||
return text
|
||||
t = text
|
||||
|
||||
Reference in New Issue
Block a user