[Misc] Print stack trace using logger.exception (#9461)

This commit is contained in:
Cyrus Leung
2024-10-17 21:55:48 +08:00
committed by GitHub
parent e312e52b44
commit 390be74649
8 changed files with 26 additions and 30 deletions

View File

@@ -103,9 +103,9 @@ class Hermes2ProToolParser(ToolParser):
tool_calls=tool_calls,
content=content if content else None)
except Exception as e:
logger.error("Error in extracting tool call from response %s",
e)
except Exception:
logger.exception(
"Error in extracting tool call from response.")
return ExtractedToolCallInformation(tools_called=False,
tool_calls=[],
content=model_output)
@@ -333,6 +333,6 @@ class Hermes2ProToolParser(ToolParser):
return delta
except Exception as e:
logger.error("Error trying to handle streaming tool call: %s", e)
except Exception:
logger.exception("Error trying to handle streaming tool call.")
return None # do not stream a delta. skip this token ID.