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: use print instead of customized logger for human tool (#1258)

Wendong-Fan8d71db77a1e4
diff --git a/camel/toolkits/human_toolkit.py b/camel/toolkits/human_toolkit.py
index 6f25626a7..42746961c 100644
--- a/camel/toolkits/human_toolkit.py
+++ b/camel/toolkits/human_toolkit.py
@@ -18,18 +18,6 @@ from typing import List
from camel.toolkits.base import BaseToolkit
from camel.toolkits.function_tool import FunctionTool
-# Add a new logging level called NOTICE, which is the same as WARNING
-# Used for logging questions, and it will be shown in the console
-NOTICE_LEVEL = 30 # same as WARNING
-logging.addLevelName(NOTICE_LEVEL, "NOTICE")
-
-
-def notice(self, message, *args, **kwargs):
- if self.isEnabledFor(NOTICE_LEVEL):
- self._log(NOTICE_LEVEL, message, args, **kwargs)
-
-
-logging.Logger.notice = notice # type: ignore[attr-defined]
logger = logging.getLogger(__name__)
@@ -48,7 +36,8 @@ class HumanToolkit(BaseToolkit):
Returns:
str: The answer from the human.
"""
- logger.notice(f"Question: {question}") # type: ignore[attr-defined]
+ print(f"Question: {question}")
+ logger.info(f"Question: {question}")
reply = input("Your reply: ")
logger.info(f"User reply: {reply}")
return reply