chore(crewai-files): drop self-explanatory comments

This commit is contained in:
Greyson LaLonde
2026-05-26 15:01:22 -07:00
committed by GitHub
parent 952c84c195
commit 07569f04ee
5 changed files with 0 additions and 12 deletions

View File

@@ -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"

View File

@@ -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} "

View File

@@ -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"
)

View File

@@ -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)

View File

@@ -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)