From c3d31deff6d559d947105ced6802488a85520d0d Mon Sep 17 00:00:00 2001 From: Lorenze Jay Date: Wed, 18 Dec 2024 07:22:14 -0800 Subject: [PATCH] renamed to CrewDoclingSource --- .../source/{docling_source.py => crew_docling_source.py} | 6 +++--- tests/knowledge/knowledge_test.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/crewai/knowledge/source/{docling_source.py => crew_docling_source.py} (95%) diff --git a/src/crewai/knowledge/source/docling_source.py b/src/crewai/knowledge/source/crew_docling_source.py similarity index 95% rename from src/crewai/knowledge/source/docling_source.py rename to src/crewai/knowledge/source/crew_docling_source.py index 7c3ab5184..5027ca7dd 100644 --- a/src/crewai/knowledge/source/docling_source.py +++ b/src/crewai/knowledge/source/crew_docling_source.py @@ -14,9 +14,9 @@ from crewai.utilities.constants import KNOWLEDGE_DIRECTORY from crewai.utilities.logger import Logger -class DoclingSource(BaseKnowledgeSource): - """Utility package for converting documents to markdown or json - This will auto support PDF, DOCX, and TXT, XLSX, Images, and HTML files without any additional dependencies. +class CrewDoclingSource(BaseKnowledgeSource): + """Default Source class for converting documents to markdown or json + This will auto support PDF, DOCX, and TXT, XLSX, Images, and HTML files without any additional dependencies and follows the docling package as the source of truth. """ _logger: Logger = Logger(verbose=True) diff --git a/tests/knowledge/knowledge_test.py b/tests/knowledge/knowledge_test.py index e13ebcaef..c03a274ca 100644 --- a/tests/knowledge/knowledge_test.py +++ b/tests/knowledge/knowledge_test.py @@ -7,7 +7,7 @@ from unittest.mock import patch import pytest from crewai.knowledge.source.csv_knowledge_source import CSVKnowledgeSource -from crewai.knowledge.source.docling_source import DoclingSource +from crewai.knowledge.source.crew_docling_source import CrewDoclingSource from crewai.knowledge.source.excel_knowledge_source import ExcelKnowledgeSource from crewai.knowledge.source.json_knowledge_source import JSONKnowledgeSource from crewai.knowledge.source.pdf_knowledge_source import PDFKnowledgeSource @@ -548,7 +548,7 @@ def test_excel_knowledge_source(mock_vector_db, tmpdir): def test_docling_source(mock_vector_db): - docling_source = DoclingSource( + docling_source = CrewDoclingSource( file_paths=[ "https://lilianweng.github.io/posts/2024-11-28-reward-hacking/", ], @@ -572,7 +572,7 @@ def test_multiple_docling_sources(): "https://lilianweng.github.io/posts/2024-11-28-reward-hacking/", "https://lilianweng.github.io/posts/2024-07-07-hallucination/", ] - docling_source = DoclingSource(file_paths=urls) + docling_source = CrewDoclingSource(file_paths=urls) assert docling_source.file_paths == urls assert docling_source.content is not None @@ -581,6 +581,6 @@ def test_multiple_docling_sources(): def test_docling_source_with_local_file(): current_dir = Path(__file__).parent pdf_path = current_dir / "crewai_quickstart.pdf" - docling_source = DoclingSource(file_paths=[pdf_path]) + docling_source = CrewDoclingSource(file_paths=[pdf_path]) assert docling_source.file_paths == [pdf_path] assert docling_source.content is not None