mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 08:26:22 +02:00
fix sync /chat call to agents service
This commit is contained in:
parent
57693b36cc
commit
a59d8c3ed3
6 changed files with 29 additions and 31 deletions
|
|
@ -9,15 +9,12 @@ from openai import OpenAI
|
|||
|
||||
load_dotenv()
|
||||
|
||||
def setup_logger(name, log_file='./run.log', level=logging.INFO, log_to_file=True):
|
||||
def setup_logger(name, log_file='./run.log', level=logging.INFO, log_to_file=False):
|
||||
"""Function to set up a logger with a specific name and log file."""
|
||||
formatter = logging.Formatter('%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s')
|
||||
|
||||
if log_to_file:
|
||||
handler = logging.FileHandler(log_file)
|
||||
else:
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
|
||||
# Changed to use stderr instead of stdout
|
||||
handler = logging.StreamHandler(sys.stderr)
|
||||
handler.setFormatter(formatter)
|
||||
|
||||
# Create a logger and set its level
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue