Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle important tags #129

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading