Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed May 15, 2024
1 parent 593bede commit c564cde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/agentscope/parsers/parser_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def to_metadata(
def _filter_content_by_names(
self,
parsed_response: dict,
keys: Union[str, Sequence[str]],
keys: Union[str, bool, Sequence[str]],
allow_missing: bool = False,
) -> Union[str, dict, None]:
"""Filter the parsed response by keys. If only one key is provided, the
Expand All @@ -167,7 +167,7 @@ def _filter_content_by_names(
their corresponding values.
Args:
keys (`Union[str, Sequence[str]]`):
keys (`Union[str, bool, Sequence[str]]`):
The key or keys to be filtered. If it's
- `False`, `None` will be returned in the `to_content` method
- `str`, the corresponding value will be returned
Expand Down
2 changes: 1 addition & 1 deletion tests/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def test_multitaggedcontentparser(self) -> None:
)

def test_DictFilterMixin_default_value(self) -> None:
"""Test the default value of the DictFilterMixin class"""
mixin = DictFilterMixin(
keys_to_memory=True,
keys_to_content=True,
Expand All @@ -204,6 +205,5 @@ def test_DictFilterMixin_default_value(self) -> None:
self.assertEqual(mixin.to_metadata(self.gt_dict), None)



if __name__ == "__main__":
unittest.main()

0 comments on commit c564cde

Please sign in to comment.