Skip to content

Improve tool decorator ergonomics#163

Open
soufianeamini wants to merge 5 commits into
mainfrom
improve-tool-decorator
Open

Improve tool decorator ergonomics#163
soufianeamini wants to merge 5 commits into
mainfrom
improve-tool-decorator

Conversation

@soufianeamini
Copy link
Copy Markdown
Member

Using the tool decorator is not very ergonomic due to how the function signature is defined.
This PR adds overloads and tests to ensure that using it doesn't yield false positives while typechecking.

image

@soufianeamini soufianeamini requested a review from a team May 20, 2026 10:52
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 20, 2026


def test_tool_decorator_result_type_is_correct() -> None:
tool_one = tool("tool_one")
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.

hmmm, I am not sure to understand this use case.
What is supposed to happen in this case?
The tool is not invocable really is it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm preserving whatever semantics already existed, the general use-case is to use it to rename a tool. I added more comments to the tests to clarify things.

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.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants