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
remove unused import (#2679)
yqkcn570ad420a876
diff --git a/rag/app/audio.py b/rag/app/audio.pyindex 397e4e75e4..ec7ffeea3e 100644--- a/rag/app/audio.py+++ b/rag/app/audio.py@@ -10,9 +10,7 @@# See the License for the specific language governing permissions and# limitations under the License.#-import ioimport re-import numpy as npfrom api.db import LLMTypefrom rag.nlp import rag_tokenizerdiff --git a/rag/app/book.py b/rag/app/book.pyindex 716c3b4eb1..cf29bb1195 100644--- a/rag/app/book.py+++ b/rag/app/book.py@@ -15,9 +15,9 @@ import refrom io import BytesIOfrom deepdoc.parser.utils import get_text-from rag.nlp import bullets_category, is_english, tokenize, remove_contents_table, \- hierarchical_merge, make_colon_as_title, naive_merge, random_choices, tokenize_table, add_positions, \- tokenize_chunks, find_codec+from rag.nlp import bullets_category, is_english,remove_contents_table, \+ hierarchical_merge, make_colon_as_title, naive_merge, random_choices, tokenize_table, \+ tokenize_chunksfrom rag.nlp import rag_tokenizerfrom deepdoc.parser import PdfParser, DocxParser, PlainParser, HtmlParserdiff --git a/rag/app/laws.py b/rag/app/laws.pyindex c1f2740d07..74aac8a292 100644--- a/rag/app/laws.py+++ b/rag/app/laws.py@@ -10,7 +10,6 @@# See the License for the specific language governing permissions and# limitations under the License.#-import copyfrom tika import parserimport refrom io import BytesIO@@ -18,8 +17,8 @@ from docx import Documentfrom api.db import ParserTypefrom deepdoc.parser.utils import get_text-from rag.nlp import bullets_category, is_english, tokenize, remove_contents_table, hierarchical_merge, \- make_colon_as_title, add_positions, tokenize_chunks, find_codec, docx_question_level+from rag.nlp import bullets_category, remove_contents_table, hierarchical_merge, \+ make_colon_as_title, tokenize_chunks, docx_question_levelfrom rag.nlp import rag_tokenizerfrom deepdoc.parser import PdfParser, DocxParser, PlainParser, HtmlParserfrom rag.settings import cron_loggerdiff --git a/rag/app/manual.py b/rag/app/manual.pyindex 29c7cd7f6e..8c663e7879 100644--- a/rag/app/manual.py+++ b/rag/app/manual.py@@ -19,13 +19,13 @@ import refrom api.db import ParserTypefrom io import BytesIO-from rag.nlp import rag_tokenizer, tokenize, tokenize_table, add_positions, bullets_category, title_frequency, tokenize_chunks, docx_question_level-from deepdoc.parser import PdfParser, PlainParser+from rag.nlp import rag_tokenizer, tokenize, tokenize_table, bullets_category, title_frequency, tokenize_chunks, docx_question_levelfrom rag.utils import num_tokens_from_string-from deepdoc.parser import PdfParser, ExcelParser, DocxParser+from deepdoc.parser import PdfParser, PlainParser, DocxParserfrom docx import Documentfrom PIL import Image+class Pdf(PdfParser):def __init__(self):self.model_speciess = ParserType.MANUAL.valuediff --git a/rag/app/naive.py b/rag/app/naive.pyindex c5a7f0ba84..54d10e4635 100644--- a/rag/app/naive.py+++ b/rag/app/naive.py@@ -25,6 +25,7 @@ from functools import reducefrom markdown import markdownfrom docx.image.exceptions import UnrecognizedImageError+class Docx(DocxParser):def __init__(self):pass@@ -93,7 +94,7 @@ class Docx(DocxParser):tbls = []for tb in self.doc.tables:- html= "<table>"+ html = "<table>"for r in tb.rows:html += "<tr>"i = 0@@ -146,8 +147,6 @@ class Pdf(PdfParser):class Markdown(MarkdownParser):def __call__(self, filename, binary=None):- txt = ""- tbls = []if binary:encoding = find_codec(binary)txt = binary.decode(encoding, errors="ignore")diff --git a/rag/app/paper.py b/rag/app/paper.pyindex 19185e962b..2092581bb3 100644--- a/rag/app/paper.py+++ b/rag/app/paper.py@@ -12,13 +12,11 @@#import copyimport re-from collections import Counterfrom api.db import ParserTypefrom rag.nlp import rag_tokenizer, tokenize, tokenize_table, add_positions, bullets_category, title_frequency, tokenize_chunksfrom deepdoc.parser import PdfParser, PlainParserimport numpy as np-from rag.utils import num_tokens_from_stringclass Pdf(PdfParser):@@ -135,7 +133,6 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,Only pdf is supported.The abstract of the paper will be sliced as an entire chunk, and will not be sliced partly."""- pdf_parser = Noneif re.search(r"\.pdf$", filename, re.IGNORECASE):if not kwargs.get("parser_config", {}).get("layout_recognize", True):pdf_parser = PlainParser()diff --git a/rag/app/qa.py b/rag/app/qa.pyindex 0a77575797..8994b4f0f8 100644--- a/rag/app/qa.py+++ b/rag/app/qa.py@@ -14,7 +14,6 @@ import refrom copy import deepcopyfrom io import BytesIOfrom timeit import default_timer as timer-from nltk import word_tokenizefrom openpyxl import load_workbookfrom deepdoc.parser.utils import get_text