diff --git a/lib/crewai-files/src/crewai_files/core/types.py b/lib/crewai-files/src/crewai_files/core/types.py index 84e3a90c3d..c76c33164a 100644 --- a/lib/crewai-files/src/crewai_files/core/types.py +++ b/lib/crewai-files/src/crewai_files/core/types.py @@ -163,7 +163,7 @@ class BaseFile(ABC, BaseModel): - File source management - Content reading - Dict unpacking support (`**` syntax) - - Per-file mode mode + - Per-file mode Can be unpacked with ** syntax: `{**ImageFile(source="./chart.png")}` which unpacks to: `{"chart": }` using filename stem as key. diff --git a/lib/crewai-files/src/crewai_files/processing/processor.py b/lib/crewai-files/src/crewai_files/processing/processor.py index afb7fbbde6..cdfe4771ad 100644 --- a/lib/crewai-files/src/crewai_files/processing/processor.py +++ b/lib/crewai-files/src/crewai_files/processing/processor.py @@ -39,11 +39,11 @@ class FileProcessor: - """Processes files according to provider constraints and per-file mode mode. + """Processes files according to provider constraints and per-file mode. Validates files against provider-specific limits and optionally transforms them (resize, compress, chunk) to meet those limits. Each file specifies - its own mode mode via `file.mode`. + its own mode via `file.mode`. Attributes: constraints: Provider constraints for validation. @@ -90,13 +90,13 @@ def validate(self, file: FileInput) -> Sequence[str]: @staticmethod def _get_mode(file: FileInput) -> FileHandling: - """Get the mode mode for a file. + """Get the mode for a file. Args: file: The file to get mode for. Returns: - The file's mode mode, defaulting to AUTO. + The file's mode, defaulting to AUTO. """ mode = getattr(file, "mode", None) if mode is None: @@ -108,7 +108,7 @@ def _get_mode(file: FileInput) -> FileHandling: return FileHandling.AUTO def process(self, file: FileInput) -> FileInput | Sequence[FileInput]: - """Process a single file according to constraints and its mode mode. + """Process a single file according to constraints and its mode. Args: file: The file to process. diff --git a/lib/crewai/tests/utilities/test_files.py b/lib/crewai/tests/utilities/test_files.py index e40215053a..668a8b4da5 100644 --- a/lib/crewai/tests/utilities/test_files.py +++ b/lib/crewai/tests/utilities/test_files.py @@ -494,13 +494,13 @@ def test_file_default_mode(self) -> None: assert f.mode == "auto" def test_file_custom_mode(self) -> None: - """Test File with custom mode mode.""" + """Test File with custom mode.""" f = File(source=b"content", mode="strict") assert f.mode == "strict" def test_file_chunk_mode(self) -> None: - """Test File with chunk mode mode.""" + """Test File with chunk mode.""" f = File(source=b"content", mode="chunk") assert f.mode == "chunk"