-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat: add plugin tests #1096
base: master
Are you sure you want to change the base?
feat: add plugin tests #1096
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to cf4548c in 32 seconds
More details
- Looked at
68
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_CG7uX4Xy3xiluGET
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
"drafted. Please provide a value of type string.", | ||
"title": "Thread Id", | ||
# TODO: this seems wrong, why both type and anyof | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of both type
and anyOf
for thread_id
is inconsistent. Consider removing the type
key or ensure it aligns with the anyOf
specification.
"drafted. Please provide a value of type string.", | ||
"title": "Thread Id", | ||
# TODO: this seems wrong, why both type and anyof | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The redundant type definition here could be simplified. Since thread_id
is an optional string parameter, we could either:
- Remove the
type: string
and keep only theanyOf
definition, or - Use
type: ["string", "null"]
instead
The current implementation with both type
and anyOf
is redundant and could cause confusion in schema validation.
from composio import Action, App | ||
from composio.client.enums.base import ActionData | ||
from composio.tools.local.base import action | ||
import composio_openai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider grouping related imports together and removing unused ones:
from composio import Action, App # Action is unused
from composio.client.enums.base import ActionData # ActionData is unused
from composio.tools.local.base import action
# Group plugin imports
import composio_openai
import composio_crewai # Unused
import composio_langchain # Unused
import composio_llamaindex # Unused
This will make the imports cleaner and more maintainable.
Code Review SummaryThe PR adds valuable test coverage for input serialization in the
Suggestions for Improvement:
Overall, this is a good addition to the test suite that will help ensure consistent parameter handling across different runtime implementations. The code quality is good with room for minor improvements. |
"title": "Message Body", | ||
"type": "string", | ||
}, | ||
"thread_id": { | ||
"description": "The ID of the thread to which the reply is to be " | ||
"drafted. Please provide a value of type string.", | ||
"title": "Thread Id", | ||
# TODO: this seems wrong, why both type and anyof | ||
"type": "string", | ||
"anyOf": [ | ||
{"type": "string"}, | ||
{"type": "null"}, | ||
], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Bug Fix:
Redundant Schema Definition for 'thread_id'
The current schema definition for the 'thread_id' field uses both 'type' and 'anyOf', which is redundant and can lead to confusion in schema validation. To improve clarity and avoid potential validation errors, it's recommended to use only 'anyOf' if the intention is to allow both string and null values. This will streamline the schema and ensure consistent behavior.
🔧 Suggested Code Diff:
- "type": "string",
"anyOf": [
{"type": "string"},
{"type": "null"},
],
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"title": "Message Body", | |
"type": "string", | |
}, | |
"thread_id": { | |
"description": "The ID of the thread to which the reply is to be " | |
"drafted. Please provide a value of type string.", | |
"title": "Thread Id", | |
# TODO: this seems wrong, why both type and anyof | |
"type": "string", | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"}, | |
], | |
}, | |
{ | |
"title": "Message Body", | |
"type": "string", | |
}, | |
"thread_id": { | |
"description": "The ID of the thread to which the reply is to be drafted. Please provide a value of type string or null.", | |
"title": "Thread Id", | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"}, | |
], | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on b3d0029 in 24 seconds
More details
- Looked at
34
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. python/composio/tools/local/codeanalysis/embedder.py:51
- Draft comment:
Consider the impact of moving the 'SentenceTransformer' import inside the 'init' method. This can reduce initial load time but may delay instantiation. - Reason this comment was not posted:
Confidence changes required:33%
The import statement for 'SentenceTransformer' was moved inside the 'init' method of the 'Embedding' class. This change is beneficial for reducing the initial load time and memory usage if the 'Embedding' class is not instantiated. However, it should be noted that this can lead to a slight delay when the class is first instantiated, as the import will occur at that time.
2. python/tests/test_tools/test_plugins.py:46
- Draft comment:
Remove 'type' when using 'anyOf' to avoid redundancy. Applicable to 'thread_id' and similar cases. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_b80AZGHzjVoSl00g
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
"drafted. Please provide a value of type string.", | ||
"title": "Thread Id", | ||
# TODO: this seems wrong, why both type and anyof | ||
"type": "string", | ||
"default": None, | ||
"anyOf": [ | ||
{"type": "string"}, | ||
{"type": "null"}, | ||
], | ||
}, | ||
}, | ||
"required": [ | ||
"message_body", | ||
], | ||
"title": "CreateDraftRequest", | ||
"type": "object", | ||
}, | ||
}, | ||
"type": "function", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Bug Fix:
Redundant Type Definition in 'thread_id' Field
The current schema for the 'thread_id' field uses both 'type' and 'anyOf', which is redundant and can lead to confusion. The 'anyOf' construct already specifies that the field can be either a string or null, making the 'type' declaration unnecessary. Removing the 'type' field will simplify the schema and prevent potential validation issues. This change will ensure clarity and maintainability of the code. 🛠️
🔧 Suggested Code Diff:
- "type": "string",
"anyOf": [
{"type": "string"},
{"type": "null"},
],
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"drafted. Please provide a value of type string.", | |
"title": "Thread Id", | |
# TODO: this seems wrong, why both type and anyof | |
"type": "string", | |
"default": None, | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"}, | |
], | |
}, | |
}, | |
"required": [ | |
"message_body", | |
], | |
"title": "CreateDraftRequest", | |
"type": "object", | |
}, | |
}, | |
"type": "function", | |
}, | |
{ | |
"thread_id": { | |
"description": "The ID of the thread to which the reply is to be drafted. Please provide a value of type string.", | |
"title": "Thread Id", | |
"default": None, | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"} | |
] | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on ba782b7 in 14 seconds
More details
- Looked at
49
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. .github/workflows/common.yml:105
- Draft comment:
Consider moving the conditionif: matrix.python-version == '3.10'
to the job level for consistency with other jobs. - Reason this comment was not posted:
Confidence changes required:50%
The addition of the plugin tests in the workflow is a good step, but the condition for running them is not consistent with the rest of the workflow. The condition should be placed on the job level, not the step level, for consistency and clarity.
2. python/tox.ini:124
- Draft comment:
The installation ofplugins/langchain
is redundant here as it is already included in the[testenv:plugins]
section. Consider removing it to avoid unnecessary installations. - Reason this comment was not posted:
Confidence changes required:50%
Thetox.ini
file has a redundant installation ofplugins/langchain
in the[testenv:test]
section. This is unnecessary because the[testenv:plugins]
section already handles plugin installations.
Workflow ID: wflow_PeG3YqkBeAR35hWk
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
"drafted. Please provide a value of type string.", | ||
"title": "Thread Id", | ||
# TODO: this seems wrong, why both type and anyof | ||
"type": "string", | ||
"default": None, | ||
"anyOf": [ | ||
{"type": "string"}, | ||
{"type": "null"}, | ||
], | ||
}, | ||
}, | ||
"required": [ | ||
"message_body", | ||
], | ||
"title": "CreateDraftRequest", | ||
"type": "object", | ||
}, | ||
}, | ||
"type": "function", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Bug Fix:
Redundant Schema Definition in 'CreateDraftRequest'
The current schema definition for 'CreateDraftRequest' includes both a 'type' field and an 'anyOf' field, which is redundant and can lead to confusion in validation logic. If the intention is to allow both strings and null values, the 'type' field should be removed, and 'anyOf' should be used exclusively. Alternatively, if only strings are allowed, the 'anyOf' field should be removed. This will ensure clarity and correctness in the schema definition.
🔧 Suggested Code Diff:
- "type": "string",
+ // Remove the 'type' field if allowing both strings and null values
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"drafted. Please provide a value of type string.", | |
"title": "Thread Id", | |
# TODO: this seems wrong, why both type and anyof | |
"type": "string", | |
"default": None, | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"}, | |
], | |
}, | |
}, | |
"required": [ | |
"message_body", | |
], | |
"title": "CreateDraftRequest", | |
"type": "object", | |
}, | |
}, | |
"type": "function", | |
}, | |
{ | |
"CreateDraftRequest": { | |
"type": "object", | |
"properties": { | |
"message_body": { | |
"anyOf": [ | |
{"type": "string"}, | |
{"type": "null"} | |
], | |
"default": None | |
} | |
}, | |
"required": [ | |
"message_body" | |
], | |
"title": "CreateDraftRequest" | |
} | |
} |
|
||
; TODO: Extract plugin tests separately | ||
; Installing separately because of the dependency conflicts | ||
uv pip install plugins/langchain --no-deps | ||
uv pip install plugins/langchain | ||
|
||
pytest -vvv -rfE --doctest-modules composio/ tests/ swe/tests --junitxml=junit.xml --cov=composio --cov=examples --cov=swe --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} | ||
pytest -vvv -rfE --doctest-modules composio/ tests/ swe/tests --ignore tests/test_tools/test_plugins.py --junitxml=junit.xml --cov=composio --cov=examples --cov=swe --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} | ||
|
||
; uv pip install plugins/autogen | ||
; uv pip install plugins/claude | ||
; uv pip install plugins/crew_ai | ||
; uv pip install plugins/griptape | ||
; uv pip install plugins/julep | ||
; uv pip install plugins/lyzr | ||
; uv pip install plugins/openai | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Comprehensive Test Coverage for Excluded Test File
The recent change excludes tests/test_tools/test_plugins.py
from the main test suite, which could lead to gaps in test coverage. It's crucial to ensure that this test file is included in a new dedicated job for plugin tests, especially under Python 3.10. This will help maintain comprehensive test coverage and prevent potential bugs from going unnoticed.
Actionable Steps:
- Verify that
tests/test_tools/test_plugins.py
is included in a separate test job. - Ensure that the new job runs under Python 3.10 to maintain compatibility and coverage.
- Regularly review test coverage reports to confirm no tests are omitted inadvertently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on e93a7f6 in 10 seconds
More details
- Looked at
36
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. python/tests/test_tools/test_plugins.py:1
- Draft comment:
Remove unused imports to clean up the code.composio_crewai
,composio_langchain
, andcomposio_llamaindex
are not used in this file. - Reason this comment was not posted:
Confidence changes required:50%
The import statements for unused modules intest_plugins.py
should be removed to clean up the code.
Workflow ID: wflow_Qj9d71JEQRYgNIkg
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 7425b2f in 7 seconds
More details
- Looked at
15
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. python/tox.ini:134
- Draft comment:
Combine plugin installations into a single command to improve performance and reduce redundancy. - Reason this comment was not posted:
Confidence changes required:50%
Thetox.ini
file has been updated to include environment variables for theplugins
test environment, which is a good practice for managing configurations. However, thedeps
section can be optimized by combining the plugin installations into a single command to improve performance.
Workflow ID: wflow_c8wdNMY7z9PIs7EG
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Add test for input serialization in
get_tools()
and optimizeSentenceTransformer
import for lazy loading.test_openai_toolset()
intest_plugins.py
to test input serialization inget_tools()
ofComposioToolSet
.create_draft
action with parametersmessage_body
andthread_id
.SentenceTransformer
import insideEmbedding.__init__()
inembedder.py
for lazy loading.tox.ini
to install multiple plugins in a single command.This description was created by for 7425b2f. It will automatically update as commits are pushed.