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

Fix description duplication #773

Merged
merged 2 commits into from
Oct 25, 2024
Merged
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
27 changes: 27 additions & 0 deletions python/tests/test_tools/test_toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
from unittest import mock

from composio.tools.base.runtime import action
import pytest

from composio import Action, App
Expand Down Expand Up @@ -265,3 +266,29 @@ def test_check_connected_accounts_flag() -> None:
check_connected_accounts=False,
)
mocked.assert_not_called()


def test_get_action_schemas_description_for_runtime_tool() -> None:

@action(toolname="runtime")
def some_action(name: str) -> str:
"""
Some action

:param name: Name of the user
:return message: Message for user
"""
return f"Hello, {name}"

toolset = ComposioToolSet()
(schema_0,) = toolset.get_action_schemas(actions=[some_action])
assert (
schema_0.parameters.properties["name"]["description"]
== "Name of the user. Please provide a value of type string. This parameter is required."
)

(schema_1,) = toolset.get_action_schemas(actions=[some_action])
angrybayblade marked this conversation as resolved.
Show resolved Hide resolved
assert (
schema_1.parameters.properties["name"]["description"]
== "Name of the user. Please provide a value of type string. This parameter is required."
)
Loading