Skip to content

Commit

Permalink
Add sorted function in required fields to avoid randomness
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Feb 26, 2024
1 parent 4d4899b commit 8e8ea2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/agentscope/service/service_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def get(
),
)

args_required = list(set(args_agent) - set(args_defaults.keys()))
args_required = sorted(
list(set(args_agent) - set(args_defaults.keys())),
)

# Prepare types of the arguments, remove the return type
args_types = {
Expand Down
2 changes: 1 addition & 1 deletion tests/service_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def func( # type: ignore
"b": {},
"a": {"type": "string"},
},
"required": ["b", "a"],
"required": ["a", "b"],
},
},
},
Expand Down

0 comments on commit 8e8ea2c

Please sign in to comment.