mirror of
https://github.com/StanGirard/quivr.git
synced 2024-11-24 05:55:13 +03:00
59fe7b089b
* feat(chat): use openai function for answer (backend) * feat(chat): use openai function for answer (frontend) * chore: refacto BrainPicking * feat: update chat creation logic * feat: simplify chat system logic * feat: set default method to gpt-3.5-turbo-0613 * feat: use user own openai key * feat(chat): slightly improve prompts * feat: add global error interceptor * feat: remove unused endpoints * docs: update chat system doc * chore(linter): add unused import remove config * feat: improve dx * feat: improve OpenAiFunctionBasedAnswerGenerator prompt
18 lines
495 B
Python
18 lines
495 B
Python
import logging
|
|
|
|
|
|
def get_logger(logger_name, log_level=logging.INFO):
|
|
logger = logging.getLogger(logger_name)
|
|
logger.setLevel(log_level)
|
|
logger.propagate = False # Prevent log propagation to avoid double logging
|
|
|
|
formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s")
|
|
|
|
console_handler = logging.StreamHandler()
|
|
console_handler.setFormatter(formatter)
|
|
|
|
if not logger.handlers:
|
|
logger.addHandler(console_handler)
|
|
|
|
return logger
|