mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
Add helpful ImportError messages for optional dependencies
When optional dependencies are missing, raise ImportError with installation instructions pointing to the relevant extras group (e.g. `[messaging]`, `[cli]`, `[mcp]`, etc.) instead of letting the import fail silently.
This commit is contained in:
parent
847ffca715
commit
850973295e
9 changed files with 81 additions and 14 deletions
|
|
@ -192,7 +192,13 @@ def _estimate_image_tokens(width: int, height: int) -> int:
|
|||
|
||||
|
||||
def _image_meta(path: Path) -> dict:
|
||||
from PIL import Image
|
||||
try:
|
||||
from PIL import Image
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Pillow is required for image metadata extraction. "
|
||||
"Install with: pip install hermes-agent[cli]"
|
||||
) from None
|
||||
|
||||
meta = {"name": path.name}
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue