fix(glm47): improve tool call parsing and content normalization (#37386)
Signed-off-by: karanb192 <karan@example.com> Co-authored-by: karanb192 <karan@example.com>
This commit is contained in:
co-authored by
karanb192
parent
8c31f47c63
commit
fad09e8a1f
@@ -206,7 +206,12 @@ class Glm4MoeModelToolParser(ToolParser):
|
||||
)
|
||||
else:
|
||||
if len(tool_calls) > 0:
|
||||
content = model_output[: model_output.find(self.tool_calls_start_token)]
|
||||
content: str | None = model_output[
|
||||
: model_output.find(self.tool_calls_start_token)
|
||||
]
|
||||
# Normalize empty/whitespace-only content to None
|
||||
if not content or not content.strip():
|
||||
content = None
|
||||
return ExtractedToolCallInformation(
|
||||
tools_called=True, tool_calls=tool_calls, content=content
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user