Skip to content

Commit

Permalink
Merge pull request #73 from SamparkAI/fx-tags-actions-filter
Browse files Browse the repository at this point in the history
fix: actions tags filter
  • Loading branch information
shubhras01 committed May 31, 2024
2 parents 9ee0ede + 9436f96 commit 4be2a41
Show file tree
Hide file tree
Showing 3 changed files with 2,397 additions and 5,490 deletions.
9 changes: 8 additions & 1 deletion composio/cli/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ def _update(context: Context, beta: bool = False) -> None:
key=lambda x: x.appKey,
)
if not beta:
apps = [app for app in apps if not app.name.lower().endswith("beta")]
c = []
for app in apps:
if app.name.lower().endswith("beta"):
continue
c.append(app)
apps = c
# apps = list(set([app for app in apps if not app.name.lower().endswith("beta")]))

enum_module = MODULE_TEMPLATE.format(
tag_enum=_get_tag_enum(apps=apps, actions=actions),
app_enum=_get_app_enum(apps=apps),
Expand Down
14 changes: 8 additions & 6 deletions composio/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,14 +703,16 @@ def get( # type: ignore
items = [item for item in items if item.name in required_triggers]

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

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

0 comments on commit 4be2a41

Please sign in to comment.