forked from LlmKira/Openaibot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_tutorial.py
45 lines (41 loc) ยท 1.66 KB
/
start_tutorial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
# @Time : 2023/10/29 ไธๅ10:15
# @Author : sudoskys
# @File : start_tutorial.py
# @Software: PyCharm
import os
import sys
try:
import loguru # noqa
import rich # noqa
except ImportError:
print("Please run `poetry install --all-extras`")
sys.exit(1)
from loguru import logger
from app.tutorial import show_tutorial
logger.remove()
logger.add(
sys.stderr,
level="INFO" if os.getenv("LLMBOT_LOG_OUTPUT") != "DEBUG" else "DEBUG",
colorize=True,
enqueue=True,
)
logger.add(
sink="run.log",
format="{time} - {level} - {message}",
level="INFO",
rotation="100 MB",
enqueue=True,
)
head = """
โโโ โโโ โโโโ โโโโโโโ โโโโโโโโโโโโโ โโโโโโ
โโโ โโโ โโโโโ โโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โโโ โโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ โโโ โโโโโโ โโโโโโโโโ โโโโโโ โโโ
โโโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโโโโโ โโโโโโ โโโ
"""
logger.opt(record=False, exception=False, capture=False, colors=True).info(
f"<cyan>{head}</cyan>"
)
show_tutorial(skip_existing=False, pre_step_stop=5, database_key="start_tutorial")