mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-09 20:42:35 +00:00
fix: resolve mypy errors in crewai-files and add all packages to CI type checks
This commit is contained in:
2
.github/workflows/type-checker.yml
vendored
2
.github/workflows/type-checker.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
run: uv sync --all-groups --all-extras
|
||||
|
||||
- name: Run type checks
|
||||
run: uv run mypy lib/crewai/src/crewai/ lib/crewai-tools/src/crewai_tools/
|
||||
run: uv run mypy lib/
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
|
||||
@@ -122,7 +122,7 @@ def format_multimodal_content(
|
||||
return content_blocks
|
||||
|
||||
# Use API-specific constraints for OpenAI
|
||||
constraints_key = provider_type
|
||||
constraints_key: str = provider_type
|
||||
if api == "responses" and "openai" in provider_type.lower():
|
||||
constraints_key = "openai_responses"
|
||||
|
||||
@@ -187,7 +187,7 @@ async def aformat_multimodal_content(
|
||||
return content_blocks
|
||||
|
||||
# Use API-specific constraints for OpenAI
|
||||
constraints_key = provider_type
|
||||
constraints_key: str = provider_type
|
||||
if api == "responses" and "openai" in provider_type.lower():
|
||||
constraints_key = "openai_responses"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ from crewai_files.core.types import (
|
||||
ProviderName = Literal[
|
||||
"anthropic",
|
||||
"openai",
|
||||
"openai_responses",
|
||||
"gemini",
|
||||
"bedrock",
|
||||
"azure",
|
||||
|
||||
@@ -120,7 +120,7 @@ def optimize_image(
|
||||
|
||||
with Image.open(io.BytesIO(content)) as img:
|
||||
if img.mode in ("RGBA", "LA", "P"):
|
||||
img = img.convert("RGB")
|
||||
img = img.convert("RGB") # type: ignore[assignment]
|
||||
output_format = "JPEG"
|
||||
else:
|
||||
output_format = img.format or "JPEG"
|
||||
|
||||
@@ -85,7 +85,7 @@ def _get_audio_duration(content: bytes, filename: str | None = None) -> float |
|
||||
Duration in seconds or None if tinytag unavailable.
|
||||
"""
|
||||
try:
|
||||
from tinytag import TinyTag # type: ignore[import-untyped]
|
||||
from tinytag import TinyTag
|
||||
except ImportError:
|
||||
logger.warning(
|
||||
"tinytag not installed - cannot validate audio duration. "
|
||||
|
||||
Reference in New Issue
Block a user