Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: fix the incorrect plaintext file key when saving (#10429)

Yingchun Lai53bb37b74953
diff --git a/api/core/rag/extractor/pdf_extractor.py b/api/core/rag/extractor/pdf_extractor.py
index 89a7061c26a..04033dec3fa 100644
--- a/api/core/rag/extractor/pdf_extractor.py
+++ b/api/core/rag/extractor/pdf_extractor.py
@@ -23,7 +23,6 @@ class PdfExtractor(BaseExtractor):
self._file_cache_key = file_cache_key
def extract(self) -> list[Document]:
- plaintext_file_key = ""
plaintext_file_exists = False
if self._file_cache_key:
try:
@@ -39,8 +38,8 @@ class PdfExtractor(BaseExtractor):
text = "\n\n".join(text_list)
# save plaintext file for caching
- if not plaintext_file_exists and plaintext_file_key:
- storage.save(plaintext_file_key, text.encode("utf-8"))
+ if not plaintext_file_exists and self._file_cache_key:
+ storage.save(self._file_cache_key, text.encode("utf-8"))
return documents