From 6491eeacdf73d91de107af7fb0bb711cfab0e86f Mon Sep 17 00:00:00 2001 From: DavdGao Date: Sun, 10 Mar 2024 08:21:09 +0800 Subject: [PATCH] fix bug in service_factory (#52) --- src/agentscope/service/service_factory.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/agentscope/service/service_factory.py b/src/agentscope/service/service_factory.py index e9e2ad891..ce45cdaf0 100644 --- a/src/agentscope/service/service_factory.py +++ b/src/agentscope/service/service_factory.py @@ -114,12 +114,15 @@ def get( } # Prepare default values - args_defaults = dict( - zip( - reversed(argsspec.args), - reversed(argsspec.defaults), # type: ignore - ), - ) + if argsspec.defaults is None: + args_defaults = {} + else: + args_defaults = dict( + zip( + reversed(argsspec.args), + reversed(argsspec.defaults), # type: ignore + ), + ) args_required = sorted( list(set(args_agent) - set(args_defaults.keys())),