🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: logger setting for print_text_animated (#1341)
Wendong-Fan1af14ee51ac0
diff --git a/camel/utils/commons.py b/camel/utils/commons.pyindex 5e1565e16..01eaa3028 100644--- a/camel/utils/commons.py+++ b/camel/utils/commons.py@@ -12,7 +12,6 @@# limitations under the License.# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========import importlib-import loggingimport osimport platformimport re@@ -40,19 +39,14 @@ import pydanticimport requestsfrom pydantic import BaseModel-from camel.logger import get_loggerfrom camel.types import TaskTypefrom .constants import ConstantsF = TypeVar('F', bound=Callable[..., Any])-logger = get_logger(__name__)--def print_text_animated(- text, delay: float = 0.02, end: str = "", log_level: int = logging.INFO-):+def print_text_animated(text, delay: float = 0.02, end: str = ""):r"""Prints the given text with an animated effect.Args:@@ -61,22 +55,10 @@ def print_text_animated((default: :obj:`0.02`)end (str, optional): The end character to print after eachcharacter of text. (default: :obj:`""`)- log_level (int, optional): The log level to use.- See https://docs.python.org/3/library/logging.html#levels- (default: :obj:`logging.INFO`)"""- if logger.isEnabledFor(log_level):- # timestamp and other prefixes- logger.log(log_level, '')-- for char in text:- print(char, end=end, flush=True)- time.sleep(delay)- # Close the log entry- logger.log(log_level, '')- else:- # This may be relevant for logging frameworks- logger.log(log_level, text)+ for char in text:+ print(char, end=end, flush=True)+ time.sleep(delay)def get_prompt_template_key_words(template: str) -> Set[str]: