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

Remove isinstance check from FunctionTool (#3987) #4056

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

gziz
Copy link
Contributor

@gziz gziz commented Nov 4, 2024

Why are these changes needed?

The following PR includes:

  • Removed the isinstance check from the FunctionTool class, allowing users to wrap functions that return lists or other subscripted generics, which was previously not possible. I have added a test for a function that returns a list; this would have failed with the previous implementation (see image 1).
  • Added a FunctionTool docstring, including an example (see image 2).
  • Expanded the documentation for Custom Function Tools to emphasize the importance of providing a clear description and type annotations when wrapping a function (see image 3).

Image 1

Image 2

Image 3

Related issue number

Closes #3987

Checks

@ekzhu ekzhu merged commit eca8a95 into microsoft:main Nov 5, 2024
38 checks passed
@gz1z gz1z deleted the remove-isinstance-in-FunctionTool branch November 5, 2024 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Function Tools Cannot Return a List
2 participants