Skip to content

Conversation

@aledelunap
Copy link
Contributor

Fixes #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.

@vercel
Copy link

vercel bot commented Jun 20, 2023

@aledelunap is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jun 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jun 21, 2023 5:58pm

Copy link
Contributor

@vowelparrot vowelparrot left a 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)

@vowelparrot vowelparrot merged commit 980c865 into langchain-ai:master Jun 23, 2023
This was referenced Jun 25, 2023
@aledelunap aledelunap deleted the fix/tools-schema branch June 28, 2023 20:04
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.

Tools: Inconsistent callbacks/run_manager parameter

2 participants