Skip to content

Commit

Permalink
Added an override for the content field from the inheritted BaseFileK…
Browse files Browse the repository at this point in the history
…nowledgeSource to account for the change in the load_content method to support excel files with multiple tabs/sheets. This change should ensure it passes the type check test, as it failed before since content was assigned a different type in BaseFileKnowledgeSource
  • Loading branch information
Kking112 committed Jan 30, 2025
1 parent 8a8698e commit ddf2bba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crewai/knowledge/source/excel_knowledge_source.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from pathlib import Path
from typing import Dict, List
from pydantic import Field

from crewai.knowledge.source.base_file_knowledge_source import BaseFileKnowledgeSource


class ExcelKnowledgeSource(BaseFileKnowledgeSource):
"""A knowledge source that stores and queries Excel file content using embeddings."""

# override content to be a dict of file paths to sheet names to csv content
content: Dict[Path, Dict[str, str]] = Field(default_factory=dict)

def load_content(self) -> Dict[Path, Dict[str, str]]:
"""Load and preprocess Excel file content from multiple sheets.
Expand Down

0 comments on commit ddf2bba

Please sign in to comment.