diff --git a/setup.py b/setup.py index 15b370647..41bd33459 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ ] service_requires = [ - "docstring_parser", "docker", "pymongo", "pymysql", @@ -46,6 +45,7 @@ # released requires minimal_requires = [ + "docstring_parser", "loguru", "tiktoken", "Pillow", diff --git a/src/agentscope/service/service_factory.py b/src/agentscope/service/service_factory.py index ce45cdaf0..95a5b51cc 100644 --- a/src/agentscope/service/service_factory.py +++ b/src/agentscope/service/service_factory.py @@ -98,6 +98,13 @@ def get( argsspec = inspect.getfullargspec(service_func) # Construct the mapping from arguments to their typings + if parse is None: + raise ImportError( + "Missing required package `docstring_parser`" + "Please install it by " + "`pip install docstring_parser`.", + ) + docstring = parse(service_func.__doc__) # Function description