mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 05:38:12 +00:00
fix: raise value error on no file support
This commit is contained in:
@@ -1984,7 +1984,16 @@ class LLM(BaseLLM):
|
||||
Returns:
|
||||
Messages with files formatted into content blocks.
|
||||
"""
|
||||
if not HAS_CREWAI_FILES or not self.supports_multimodal():
|
||||
if not HAS_CREWAI_FILES:
|
||||
return messages
|
||||
|
||||
if not self.supports_multimodal():
|
||||
if any(msg.get("files") for msg in messages):
|
||||
raise ValueError(
|
||||
f"Model '{self.model}' does not support multimodal input, "
|
||||
"but files were provided via 'input_files'. "
|
||||
"Use a vision-capable model or remove the file inputs."
|
||||
)
|
||||
return messages
|
||||
|
||||
provider = getattr(self, "provider", None) or self.model
|
||||
@@ -2026,7 +2035,16 @@ class LLM(BaseLLM):
|
||||
Returns:
|
||||
Messages with files formatted into content blocks.
|
||||
"""
|
||||
if not HAS_CREWAI_FILES or not self.supports_multimodal():
|
||||
if not HAS_CREWAI_FILES:
|
||||
return messages
|
||||
|
||||
if not self.supports_multimodal():
|
||||
if any(msg.get("files") for msg in messages):
|
||||
raise ValueError(
|
||||
f"Model '{self.model}' does not support multimodal input, "
|
||||
"but files were provided via 'input_files'. "
|
||||
"Use a vision-capable model or remove the file inputs."
|
||||
)
|
||||
return messages
|
||||
|
||||
provider = getattr(self, "provider", None) or self.model
|
||||
|
||||
@@ -601,7 +601,16 @@ class BaseLLM(ABC):
|
||||
Returns:
|
||||
Messages with files formatted into content blocks.
|
||||
"""
|
||||
if not HAS_CREWAI_FILES or not self.supports_multimodal():
|
||||
if not HAS_CREWAI_FILES:
|
||||
return messages
|
||||
|
||||
if not self.supports_multimodal():
|
||||
if any(msg.get("files") for msg in messages):
|
||||
raise ValueError(
|
||||
f"Model '{self.model}' does not support multimodal input, "
|
||||
"but files were provided via 'input_files'. "
|
||||
"Use a vision-capable model or remove the file inputs."
|
||||
)
|
||||
return messages
|
||||
|
||||
provider = getattr(self, "provider", None) or getattr(self, "model", "openai")
|
||||
|
||||
Reference in New Issue
Block a user