mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-03 04:42:38 +02:00
add llm stream log
This commit is contained in:
parent
7671935741
commit
0eef8a8607
5 changed files with 21 additions and 8 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
|
||||
from loguru import logger as _logger
|
||||
|
||||
|
|
@ -26,3 +27,15 @@ def define_log_level(print_level="INFO", logfile_level="DEBUG"):
|
|||
|
||||
|
||||
logger = define_log_level()
|
||||
|
||||
|
||||
def log_llm_stream(msg):
|
||||
_llm_stream_log(msg)
|
||||
|
||||
|
||||
def set_llm_stream_logfunc(func):
|
||||
global _llm_stream_log
|
||||
_llm_stream_log = func
|
||||
|
||||
|
||||
_llm_stream_log = partial(print, end="")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue