fix: correct default model (gpt-4o), correct token counts, and correct TaskOutput attributes (added agent) (#749)

* fix: 'from datetime import datetime for logging' to print the timestamp

* fix: correct default model (gpt-4o), correct token counts, and correct TaskOutput attributes (added agent)

* test: verify Task callback data is an instance of TaskOutput
This commit is contained in:
Matt Thompson
2024-06-11 20:29:22 +02:00
committed by GitHub
parent e202592715
commit 4f093e2626
4 changed files with 59 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
from datetime import datetime
from crewai.utilities.printer import Printer
@@ -13,6 +14,7 @@ class Logger:
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:
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
self._printer.print(f"[{timestamp}][{level.upper()}]: {message}", color=color)
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
self._printer.print(
f"[{timestamp}][{level.upper()}]: {message}", color=color
)