Skip to content

Commit

Permalink
Update error message for optional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed May 23, 2024
1 parent 65a67f9 commit ad5c2d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Default the value of `azure_deployment` on all Azure Drivers to the model the Driver is using.
- Field `azure_ad_token` on all Azure Drivers is no longer serializable.
- Error message to be more helpful when importing optional dependencies.

## [0.25.1] - 2024-05-15

Expand Down
5 changes: 4 additions & 1 deletion griptape/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def import_optional_dependency(name: str) -> Optional[ModuleType]:
package_name = INSTALL_MAPPING.get(name)
install_name = package_name if package_name is not None else name

msg = f"Missing optional dependency: '{install_name}'. " f"Use poetry or pip to install '{install_name}'."
msg = (
f"Missing optional dependency: '{install_name}'. "
f"Please install the appropriate extra: https://docs.griptape.ai/stable/griptape-framework/#extras."
)
try:
module = import_module(name)
except ImportError:
Expand Down

0 comments on commit ad5c2d7

Please sign in to comment.