Skip to content

Commit

Permalink
Merge pull request #129 from ComposioHQ/kaavee/important_tags_actions
Browse files Browse the repository at this point in the history
Handle important tags
  • Loading branch information
utkarsh-dixit authored Jun 8, 2024
2 parents 3ddaf59 + 16c0dbf commit 0b82871
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions composio/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,16 @@ def get( # type: ignore

if len(tags) > 0:
required_tags = [tag.name if isinstance(tag, Tag) else tag for tag in tags]
should_not_filter_using_tags = (
len(items) < 15
and len(required_tags) == 1
and required_tags[0] == "important"
)
only_important_tag = (required_tags == ["important"])
should_not_filter_using_tags = (len(items) < 15 and only_important_tag)
if not should_not_filter_using_tags:
items = [
filtered_items = [
item
for item in items
if any(tag in required_tags for tag in item.tags)
]
if len(filtered_items) > 0 or not only_important_tag:
items = filtered_items

if len(local_apps) > 0 or len(local_actions) > 0:
local_items = self.local_handler.get_list_of_action_schemas(
Expand Down

0 comments on commit 0b82871

Please sign in to comment.