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

[BUG] HumanToolkit Provides More Explicit Feedback When Messaging User (#2880)

Hesam Sheikh485cddc32367
diff --git a/camel/toolkits/human_toolkit.py b/camel/toolkits/human_toolkit.py
index 4c5a59c62..06db71992 100644
--- a/camel/toolkits/human_toolkit.py
+++ b/camel/toolkits/human_toolkit.py
@@ -52,7 +52,7 @@ class HumanToolkit(BaseToolkit):
logger.info(f"User reply: {reply}")
return reply
- def send_message_to_user(self, message: str) -> None:
+ def send_message_to_user(self, message: str) -> str:
r"""Use this tool to send a tidy message to the user in one short
sentence.
@@ -68,9 +68,13 @@ class HumanToolkit(BaseToolkit):
Args:
message (str): The tidy and informative message for the user.
+
+ Returns:
+ str: Confirmation that the message was successfully sent.
"""
print(f"\nAgent Message:\n{message}")
logger.info(f"\nAgent Message:\n{message}")
+ return f"Message successfully sent to user: '{message}'"
def get_tools(self) -> List[FunctionTool]:
r"""Returns a list of FunctionTool objects representing the
diff --git a/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
index 63b89a5e7..1f4d4e6bf 100644
--- a/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
@@ -46,14 +46,14 @@ credentials, file paths).
### send_message_to_user
```python
-def send_message_to_user(self, message: str):
+def send_message_to_user(self, message: str) -> str:
```
Use this tool to send a tidy message to the user in one short
sentence.
This one-way tool keeps the user informed about your progress,
-decisions, or actions. It does not require a response.
+decisions, or actions. It does not require a response from user.
You should use it to:
- Announce what you are about to do (e.g., "I will now search for
papers on GUI Agents.").
diff --git a/docs/reference/camel.toolkits.human_toolkit.md b/docs/reference/camel.toolkits.human_toolkit.md
index 63b89a5e7..1f4d4e6bf 100644
--- a/docs/reference/camel.toolkits.human_toolkit.md
+++ b/docs/reference/camel.toolkits.human_toolkit.md
@@ -46,14 +46,14 @@ credentials, file paths).
### send_message_to_user
```python
-def send_message_to_user(self, message: str):
+def send_message_to_user(self, message: str) -> str:
```
Use this tool to send a tidy message to the user in one short
sentence.
This one-way tool keeps the user informed about your progress,
-decisions, or actions. It does not require a response.
+decisions, or actions. It does not require a response from user.
You should use it to:
- Announce what you are about to do (e.g., "I will now search for
papers on GUI Agents.").
diff --git a/examples/workforce/eigent.py b/examples/workforce/eigent.py
index 5209e4da7..78be1322a 100644
--- a/examples/workforce/eigent.py
+++ b/examples/workforce/eigent.py
@@ -54,7 +54,7 @@ logger = get_logger(__name__)
WORKING_DIRECTORY = os.environ.get("CAMEL_WORKDIR") or "working_dir/"
-def send_message_to_user(message: str) -> None:
+def send_message_to_user(message: str) -> str:
r"""Use this tool to send a tidy message to the user, including a
short title and a one-sentence description.
@@ -75,9 +75,13 @@ def send_message_to_user(message: str) -> None:
Args:
message (str): The tidy and informative message for the user,
which should contain a title and a description.
+
+ Returns:
+ str: Confirmation that the message was successfully sent.
"""
print(f"\nAgent Message:\n{message}")
logger.info(f"\nAgent Message:\n{message}")
+ return f"Message successfully sent to user: '{message}'"
def developer_agent_factory(