From 07569f04eedd674869d70191652d04cfb2e69e32 Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Tue, 26 May 2026 15:01:22 -0700 Subject: [PATCH] chore(crewai-files): drop self-explanatory comments --- lib/crewai-files/src/crewai_files/formatting/api.py | 3 --- lib/crewai-files/src/crewai_files/resolution/resolver.py | 1 - lib/crewai-files/tests/processing/test_processor.py | 3 --- lib/crewai-files/tests/test_resolver.py | 4 ---- lib/crewai-files/tests/test_upload_cache.py | 1 - 5 files changed, 12 deletions(-) diff --git a/lib/crewai-files/src/crewai_files/formatting/api.py b/lib/crewai-files/src/crewai_files/formatting/api.py index 1d846b18a..b056f014e 100644 --- a/lib/crewai-files/src/crewai_files/formatting/api.py +++ b/lib/crewai-files/src/crewai_files/formatting/api.py @@ -114,14 +114,12 @@ def format_multimodal_content( content_blocks: list[dict[str, Any]] = [] provider_type = _normalize_provider(provider) - # Add text block first if provided if text: content_blocks.append(_format_text_block(text, provider_type, api)) if not files: return content_blocks - # Use API-specific constraints for OpenAI constraints_key: str = provider_type if api == "responses" and "openai" in provider_type.lower(): constraints_key = "openai_responses" @@ -186,7 +184,6 @@ async def aformat_multimodal_content( if not files: return content_blocks - # Use API-specific constraints for OpenAI constraints_key: str = provider_type if api == "responses" and "openai" in provider_type.lower(): constraints_key = "openai_responses" diff --git a/lib/crewai-files/src/crewai_files/resolution/resolver.py b/lib/crewai-files/src/crewai_files/resolution/resolver.py index 31c54c55a..0359c6253 100644 --- a/lib/crewai-files/src/crewai_files/resolution/resolver.py +++ b/lib/crewai-files/src/crewai_files/resolution/resolver.py @@ -245,7 +245,6 @@ class FileResolver: type_constraint = self._get_type_constraint(content_type, constraints) if type_constraint is not None: - # Check if file exceeds type-specific inline limit if file_size > type_constraint.max_size_bytes: logger.debug( f"File {file.filename} ({file_size}B) exceeds {content_type} " diff --git a/lib/crewai-files/tests/processing/test_processor.py b/lib/crewai-files/tests/processing/test_processor.py index 1648b6aeb..01700e045 100644 --- a/lib/crewai-files/tests/processing/test_processor.py +++ b/lib/crewai-files/tests/processing/test_processor.py @@ -162,7 +162,6 @@ class TestFileProcessorValidate: image=ImageConstraints(max_size_bytes=10), ) processor = FileProcessor(constraints=constraints) - # Set mode to strict on the file file = ImageFile( source=FileBytes(data=MINIMAL_PNG, filename="test.png"), mode="strict" ) @@ -199,7 +198,6 @@ class TestFileProcessorProcess: image=ImageConstraints(max_size_bytes=10), ) processor = FileProcessor(constraints=constraints) - # Set mode to strict on the file file = ImageFile( source=FileBytes(data=MINIMAL_PNG, filename="test.png"), mode="strict" ) @@ -214,7 +212,6 @@ class TestFileProcessorProcess: image=ImageConstraints(max_size_bytes=10), ) processor = FileProcessor(constraints=constraints) - # Set mode to warn on the file file = ImageFile( source=FileBytes(data=MINIMAL_PNG, filename="test.png"), mode="warn" ) diff --git a/lib/crewai-files/tests/test_resolver.py b/lib/crewai-files/tests/test_resolver.py index 095eb4329..d0f9e3e40 100644 --- a/lib/crewai-files/tests/test_resolver.py +++ b/lib/crewai-files/tests/test_resolver.py @@ -93,14 +93,11 @@ class TestFileResolver: resolver = FileResolver(upload_cache=cache) file = ImageFile(source=FileBytes(data=MINIMAL_PNG, filename="test.png")) - # First resolution resolved1 = resolver.resolve(file, "openai") - # Second resolution (should use same base64 encoding) resolved2 = resolver.resolve(file, "openai") assert isinstance(resolved1, InlineBase64) assert isinstance(resolved2, InlineBase64) - # Data should be identical assert resolved1.data == resolved2.data def test_clear_cache(self): @@ -108,7 +105,6 @@ class TestFileResolver: cache = UploadCache() file = ImageFile(source=FileBytes(data=MINIMAL_PNG, filename="test.png")) - # Add something to cache manually cache.set(file=file, provider="gemini", file_id="test") resolver = FileResolver(upload_cache=cache) diff --git a/lib/crewai-files/tests/test_upload_cache.py b/lib/crewai-files/tests/test_upload_cache.py index 5b2bb6a47..f7d9f86a3 100644 --- a/lib/crewai-files/tests/test_upload_cache.py +++ b/lib/crewai-files/tests/test_upload_cache.py @@ -162,7 +162,6 @@ class TestUploadCache: source=FileBytes(data=MINIMAL_PNG + b"x", filename="test2.png") ) - # Add one expired and one valid entry past = datetime.now(timezone.utc) - timedelta(hours=1) future = datetime.now(timezone.utc) + timedelta(hours=24)