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: remove callbacks arg from Tool and StructuredTool inferred schema #6483
Conversation
@aledelunap is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
tool and structured tool
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
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.
Thank you for making this fix! I had two minor suggestions (in addition to any linting fixes)
langchain-ai#6483) Fixes langchain-ai#5456 This PR removes the `callbacks` argument from a tool's schema when creating a `Tool` or `StructuredTool` with the `from_function` method and `infer_schema` is set to `True`. The `callbacks` argument is now removed in the `create_schema_from_function` and `_get_filtered_args` methods. As suggested by @vowelparrot, this fix provides a straightforward solution that minimally affects the existing implementation. A test was added to verify that this change enables the expected use of `Tool` and `StructuredTool` when using a `CallbackManager` and inferring the tool's schema. - @hwchase17
langchain-ai#6483) Fixes langchain-ai#5456 This PR removes the `callbacks` argument from a tool's schema when creating a `Tool` or `StructuredTool` with the `from_function` method and `infer_schema` is set to `True`. The `callbacks` argument is now removed in the `create_schema_from_function` and `_get_filtered_args` methods. As suggested by @vowelparrot, this fix provides a straightforward solution that minimally affects the existing implementation. A test was added to verify that this change enables the expected use of `Tool` and `StructuredTool` when using a `CallbackManager` and inferring the tool's schema. - @hwchase17
Fixes #5456
This PR removes the
callbacks
argument from a tool's schema when creating aTool
orStructuredTool
with thefrom_function
method andinfer_schema
is set toTrue
. Thecallbacks
argument is now removed in thecreate_schema_from_function
and_get_filtered_args
methods. As suggested by @vowelparrot, this fix provides a straightforward solution that minimally affects the existing implementation.A test was added to verify that this change enables the expected use of
Tool
andStructuredTool
when using aCallbackManager
and inferring the tool's schema.