SimpleChatTC: Saner/Robust AssistantResponse content_equiv

Previously if content was empty, it would have always sent the
toolcall info related version even if there was no toolcall info
in it. Fixed now to return empty string, if both content and
toolname are empty.
This commit is contained in:
hanishkvc 2025-10-11 04:22:15 +05:30
parent 383c19c99b
commit 6d43011003
1 changed files with 3 additions and 1 deletions

View File

@ -71,8 +71,10 @@ class AssistantResponse {
content_equiv() {
if (this.response.content !== "") {
return this.response.content;
} else {
} else if (this.response.toolname !== "") {
return `ToolCall:${this.response.toolname}:${this.response.toolargs}`;
} else {
return ""
}
}