diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 85e83f228..a5312a692 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -3,7 +3,6 @@ import uuid from typing import Any, Dict, List, Optional, Union from langchain_core.callbacks import BaseCallbackHandler - from pydantic import ( UUID4, BaseModel, @@ -68,7 +67,8 @@ class Crew(BaseModel): description="Language model that will run the agent.", default=None ) manager_callbacks: Optional[List[InstanceOf[BaseCallbackHandler]]] = Field( - default=None, description="A list of callback handlers to be executed by the manager agent when hierarchical process is used" + default=None, + description="A list of callback handlers to be executed by the manager agent when hierarchical process is used", ) function_calling_llm: Optional[Any] = Field( description="Language model that will run the agent.", default=None @@ -232,8 +232,10 @@ class Crew(BaseModel): task.tools += AgentTools(agents=agents_for_delegation).tools() role = task.agent.role if task.agent is not None else "None" - self._logger.log("debug", f"Working Agent: {role}") - self._logger.log("info", f"Starting Task: {task.description}") + self._logger.log("debug", f" == Working Agent: {role}", color="bold_yellow") + self._logger.log( + "info", f" == Starting Task: {task.description}", color="bold_yellow" + ) output = task.execute(context=task_output) if not task.async_execution: diff --git a/src/crewai/utilities/logger.py b/src/crewai/utilities/logger.py index 489132253..d7a3ac27d 100644 --- a/src/crewai/utilities/logger.py +++ b/src/crewai/utilities/logger.py @@ -10,7 +10,7 @@ class Logger: ) self.verbose_level = verbose_level - def log(self, level, message): + def log(self, level, message, color="bold_green"): level_map = {"debug": 1, "info": 2} if self.verbose_level and level_map.get(level, 0) <= self.verbose_level: - self._printer.print(f"[{level.upper()}]: {message}", color="bold_green") + self._printer.print(f"[{level.upper()}]: {message}", color=color) diff --git a/src/crewai/utilities/printer.py b/src/crewai/utilities/printer.py index ee3655b2a..f0bf8262d 100644 --- a/src/crewai/utilities/printer.py +++ b/src/crewai/utilities/printer.py @@ -6,9 +6,14 @@ class Printer: self._print_red(content) elif color == "bold_green": self._print_bold_green(content) + elif color == "bold_yellow": + self._print_bold_yellow(content) else: print(content) + def _print_bold_yellow(self, content): + print("\033[1m\033[93m {}\033[00m".format(content)) + def _print_bold_green(self, content): print("\033[1m\033[92m {}\033[00m".format(content))