Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ dependencies = [
"yfinance==0.2.50",
"wolframalpha==5.1.3",
"astra-assistants[tools]>=2.2.13,<3.0.0",
"composio==0.8.5",
"composio-langchain==0.8.5",
"composio==0.9.2",
"composio-langchain==0.9.2",
"spider-client==0.1.24",
"nltk==3.9.1",
"lark==1.2.2",
Expand Down
59 changes: 53 additions & 6 deletions src/lfx/src/lfx/base/composio/composio_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,17 @@
if parameters_schema is None:
logger.warning(f"Parameters schema is None for action key: {action_key}")
# Still add the action but with empty fields
# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 476 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:476:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": [],
"file_upload_fields": set(),
"version": version,
"available_versions": available_versions,
}
Comment on lines +473 to 484

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix trailing whitespace on blank lines.

Multiple blank lines contain trailing whitespace (lines 476, 500, 549, 566, 649, 664), which causes the Ruff style check to fail. Remove the trailing whitespace to pass CI.

Apply this fix to remove trailing whitespace from blank lines:

                 version = tool_dict.get("version")
                 available_versions = tool_dict.get("available_versions", [])
-                
+
                 self._action_schemas[action_key] = tool_dict

Repeat this fix for all affected blank lines (476, 500, 549, 566, 649, 664, 2550, 2557, 2561).

Also applies to: 497-508, 546-557, 563-574, 646-657, 661-672

🧰 Tools
🪛 GitHub Actions: Ruff Style Check

[error] 476-476: Ruff: W293 Blank line contains whitespace.

🪛 GitHub Check: Ruff Style Check (3.13)

[failure] 476-476: Ruff (W293)
src/lfx/src/lfx/base/composio/composio_base.py:476:1: W293 Blank line contains whitespace

🤖 Prompt for AI Agents
In src/lfx/src/lfx/base/composio/composio_base.py around lines 473-484 (and
additionally at lines 476, 500, 549, 566, 649, 664, 2550, 2557, 2561 plus the
ranges 497-508, 546-557, 563-574, 646-657, 661-672), remove trailing whitespace
from all blank lines; ensure blank lines contain no spaces or tabs so Ruff style
checks pass, then save the file and run the linter to confirm no remaining
trailing whitespace errors.

continue

Expand All @@ -488,11 +494,17 @@
parameters_schema = parameters_schema.__dict__
else:
logger.warning(f"Cannot process parameters schema for {action_key}, skipping")
# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 500 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:500:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": [],
"file_upload_fields": set(),
"version": version,
"available_versions": available_versions,
}
continue

Expand Down Expand Up @@ -531,22 +543,34 @@
elif field_name in original_descriptions:
field_schema["description"] = original_descriptions[field_name]
except (KeyError, TypeError, ValueError):
# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 549 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:549:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": [],
"file_upload_fields": set(),
"version": version,
"available_versions": available_versions,
}
continue

if flat_schema is None:
logger.warning(f"Flat schema is None for action key: {action_key}")
# Still add the action but with empty fields so the UI doesn't break
# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 566 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:566:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": [],
"file_upload_fields": set(),
"version": version,
"available_versions": available_versions,
}
continue

Expand Down Expand Up @@ -619,20 +643,32 @@
clean_field_name = p_name.replace("[0]", "")
self._bool_variables.add(clean_field_name)

# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 649 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:649:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": action_fields,
"file_upload_fields": file_upload_fields,
"version": version,
"available_versions": available_versions,
}

except (KeyError, TypeError, ValueError) as flatten_error:
logger.error(f"flatten_schema failed for {action_key}: {flatten_error}")
# Extract version information from the tool
version = tool_dict.get("version")
available_versions = tool_dict.get("available_versions", [])

Check failure on line 664 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:664:1: W293 Blank line contains whitespace
self._action_schemas[action_key] = tool_dict
self._actions_data[action_key] = {
"display_name": display_name,
"action_fields": [],
"file_upload_fields": set(),
"version": version,
"available_versions": available_versions,
}
continue

Expand Down Expand Up @@ -2507,12 +2543,23 @@

arguments[final_field_name] = value

# Execute using new SDK
result = composio.tools.execute(
slug=action_key,
arguments=arguments,
user_id=self.entity_id,
)
# Get the version from the action data
version = self._actions_data.get(action_key, {}).get("version")
if version:
logger.info(f"Executing {action_key} with version: {version}")

Check failure on line 2550 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:2550:1: W293 Blank line contains whitespace
# Execute using new SDK with version parameter
execute_params = {
"slug": action_key,
"arguments": arguments,
"user_id": self.entity_id,
}

Check failure on line 2557 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:2557:1: W293 Blank line contains whitespace
# Only add version if it's available
if version:
execute_params["version"] = version

Check failure on line 2561 in src/lfx/src/lfx/base/composio/composio_base.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.13)

Ruff (W293)

src/lfx/src/lfx/base/composio/composio_base.py:2561:1: W293 Blank line contains whitespace
result = composio.tools.execute(**execute_params)

if isinstance(result, dict) and "successful" in result:
if result["successful"]:
Expand Down
22 changes: 11 additions & 11 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading