Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

Fix: Remove leading newlines from tool calls (#1350)

CaelumFcb65696a61cd
diff --git a/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py b/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py
index 0cb7e16e0..f4e2d5393 100644
--- a/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py
+++ b/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py
@@ -109,7 +109,10 @@ class HermesFunctionFormatter(
format.
"""
tool_call_dict = {"name": func_name, "arguments": args}
- return f"{content}\n<tool_call>\n{tool_call_dict}\n</tool_call>"
+
+ if content:
+ return f"{content}\n<tool_call>\n{tool_call_dict}\n</tool_call>"
+ return f"<tool_call>\n{tool_call_dict}\n</tool_call>"
def format_tool_response(self, func_name: str, result: Any) -> str:
r"""Formats a tool response message with the given function name and