RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
refine log format (#312)
KevinHuShf6c7204002ca
diff --git a/README.md b/README.mdindex 5000d5e61b..686f6bb427 100644--- a/README.md+++ b/README.md@@ -65,7 +65,7 @@- CPU >= 2 cores- RAM >= 8 GB-- Docker >= 24.0.0+- Docker >= 24.0.0 & Docker Compose >= v2.26.1> If you have not installed Docker on your local machine (Windows, Mac, or Linux), see [Install Docker Engine](https://docs.docker.com/engine/install/).### 🚀 Start up the serverdiff --git a/README_ja.md b/README_ja.mdindex cf198e7f38..d3074bd14d 100644--- a/README_ja.md+++ b/README_ja.md@@ -65,7 +65,7 @@- CPU >= 2 cores- RAM >= 8 GB-- Docker >= 24.0.0+- Docker >= 24.0.0 & Docker Compose >= v2.26.1> ローカルマシン(Windows、Mac、または Linux)に Docker をインストールしていない場合は、[Docker Engine のインストール](https://docs.docker.com/engine/install/) を参照してください。### 🚀 サーバーを起動diff --git a/README_zh.md b/README_zh.mdindex 2479b4b53a..7c7d571b48 100644--- a/README_zh.md+++ b/README_zh.md@@ -65,7 +65,7 @@- CPU >= 2 核- RAM >= 8 GB-- Docker >= 24.0.0+- Docker >= 24.0.0 & Docker Compose >= v2.26.1> 如果你并没有在本机安装 Docker(Windows、Mac,或者 Linux), 可以参考文档 [Install Docker Engine](https://docs.docker.com/engine/install/) 自行安装。### 🚀 启动服务器diff --git a/api/db/db_models.py b/api/db/db_models.pyindex b66badf648..6d7adf0d22 100644--- a/api/db/db_models.py+++ b/api/db/db_models.py@@ -695,7 +695,7 @@ class Dialog(DataBaseModel):language = CharField(max_length=32,null=True,- default="English",+ default="Chinese",help_text="English|Chinese")llm_id = CharField(max_length=32, null=False, help_text="default llm ID")llm_setting = JSONField(null=False, default={"temperature": 0.1, "top_p": 0.3, "frequency_penalty": 0.7,diff --git a/api/settings.py b/api/settings.pyindex be4ae85a3e..6010ab1904 100644--- a/api/settings.py+++ b/api/settings.py@@ -13,15 +13,8 @@# See the License for the specific language governing permissions and# limitations under the License.#-import logging--from rag.utils import ELASTICSEARCH-from rag.nlp import searchimport os-from enum import IntEnum, Enum--from api.utils import get_base_config, decrypt_database_configfrom api.utils.file_utils import get_project_base_directoryfrom api.utils.log_utils import LoggerFactory, getLogger@@ -32,13 +25,16 @@ LoggerFactory.set_directory("logs","api"))# {CRITICAL: 50, FATAL:50, ERROR:40, WARNING:30, WARN:30, INFO:20, DEBUG:10, NOTSET:0}-LoggerFactory.LEVEL = 10+LoggerFactory.LEVEL = 30stat_logger = getLogger("stat")access_logger = getLogger("access")database_logger = getLogger("database")chat_logger = getLogger("chat")-database_logger.setLevel(logging.WARNING)++from rag.utils import ELASTICSEARCH+from rag.nlp import search+from api.utils import get_base_config, decrypt_database_configAPI_VERSION = "v1"RAG_FLOW_SERVICE_NAME = "ragflow"@@ -79,7 +75,7 @@ default_llm = {"image2text_model": "glm-4v","asr_model": "",},- "Local": {+ "Ollama": {"chat_model": "qwen-14B-chat","embedding_model": "flag-embedding","image2text_model": "",diff --git a/api/utils/log_utils.py b/api/utils/log_utils.pyindex 528bd99a98..e74060d4b5 100644--- a/api/utils/log_utils.py+++ b/api/utils/log_utils.py@@ -26,7 +26,8 @@ from api.utils import file_utilsclass LoggerFactory(object):TYPE = "FILE"- LOG_FORMAT = "[%(levelname)s] [%(asctime)s] [jobId] [%(process)s:%(thread)s] - [%(module)s.%(funcName)s] [line:%(lineno)d]: %(message)s"+ LOG_FORMAT = "[%(levelname)s] [%(asctime)s] [%(module)s.%(funcName)s] [line:%(lineno)d]: %(message)s"+ logging.basicConfig(format=LOG_FORMAT)LEVEL = logging.DEBUGlogger_dict = {}global_handler_dict = {}diff --git a/rag/app/book.py b/rag/app/book.pyindex 2ea850afc2..85661aca6f 100644--- a/rag/app/book.py+++ b/rag/app/book.py@@ -110,7 +110,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,[t for t in random_choices([t for t, _ in sections], k=100)])if bull >= 0:chunks = ["\n".join(ck)- for ck in hierarchical_merge(bull, sections, 3)]+ for ck in hierarchical_merge(bull, sections, 5)]else:sections = [s.split("@") for s, _ in sections]sections = [(pr[0], "@" + pr[1]) for pr in sections if len(pr) == 2]diff --git a/rag/app/laws.py b/rag/app/laws.pyindex ce0d174719..2a7842f749 100644--- a/rag/app/laws.py+++ b/rag/app/laws.py@@ -133,7 +133,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,make_colon_as_title(sections)bull = bullets_category(sections)- chunks = hierarchical_merge(bull, sections, 3)+ chunks = hierarchical_merge(bull, sections, 5)if not chunks:callback(0.99, "No chunk parsed out.")diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.pyindex 498595de7d..d4f0e7b64b 100644--- a/rag/llm/chat_model.py+++ b/rag/llm/chat_model.py@@ -98,7 +98,7 @@ class QWenChat(Base):tk_count = 0if response.status_code == HTTPStatus.OK:ans += response.output.choices[0]['message']['content']- tk_count += response.usage.output_tokens+ tk_count += response.usage.total_tokensif response.output.choices[0].get("finish_reason", "") == "length":ans += "...\nFor the content length reason, it stopped, continue?" if is_english([ans]) else "······\n由于长度的原因,回答被截断了,要继续吗?"