doc: use the corresponding source depending on filetype (#2038)

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
Nicolas Lorin
2025-02-10 00:25:33 +01:00
committed by GitHub
parent 17e25fb842
commit fbd0e015d5

View File

@@ -91,7 +91,7 @@ result = crew.kickoff(inputs={"question": "What city does John live in and how o
``` ```
Here's another example with the `CrewDoclingSource`. The CrewDoclingSource is actually quite versatile and can handle multiple file formats including TXT, PDF, DOCX, HTML, and more. Here's another example with the `CrewDoclingSource`. The CrewDoclingSource is actually quite versatile and can handle multiple file formats including MD, PDF, DOCX, HTML, and more.
<Note> <Note>
You need to install `docling` for the following example to work: `uv add docling` You need to install `docling` for the following example to work: `uv add docling`
@@ -152,10 +152,10 @@ Here are examples of how to use different types of knowledge sources:
### Text File Knowledge Source ### Text File Knowledge Source
```python ```python
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource from crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource
# Create a text file knowledge source # Create a text file knowledge source
text_source = CrewDoclingSource( text_source = TextFileKnowledgeSource(
file_paths=["document.txt", "another.txt"] file_paths=["document.txt", "another.txt"]
) )