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
Subclassing BaseTool: args_schema always None #3297
Comments
The immediate fix is that it works if you add the type hint in the subclass.
We will work to fix this behavior. It's 'by design' in pydantic and dataclasses but I even if we improve the docs here, it'll be a frequent "gotcha" if it isn't fixed. Thank you for contributing to the project! |
Thanks. That's a nasty gotcha. Just cut a pr to update the notebook with a type hint: #3323 |
vowelparrot
pushed a commit
that referenced
this issue
Apr 21, 2023
per #3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
vowelparrot
added a commit
that referenced
this issue
Apr 24, 2023
- Proactively raise error if a tool subclasses BaseTool, defines its own schema, but fails to add the type-hints - fix the auto-inferred schema of the decorator to strip the unneeded virtual kwargs from the schema dict Helps avoid silent instances of #3297
wertycn
pushed a commit
to wertycn/langchain-zh
that referenced
this issue
Apr 26, 2023
per langchain-ai/langchain#3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
vowelparrot
pushed a commit
that referenced
this issue
Apr 26, 2023
per #3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
vowelparrot
added a commit
that referenced
this issue
Apr 26, 2023
- Proactively raise error if a tool subclasses BaseTool, defines its own schema, but fails to add the type-hints - fix the auto-inferred schema of the decorator to strip the unneeded virtual kwargs from the schema dict Helps avoid silent instances of #3297
vowelparrot
pushed a commit
that referenced
this issue
Apr 28, 2023
per #3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
vowelparrot
added a commit
that referenced
this issue
Apr 28, 2023
- Proactively raise error if a tool subclasses BaseTool, defines its own schema, but fails to add the type-hints - fix the auto-inferred schema of the decorator to strip the unneeded virtual kwargs from the schema dict Helps avoid silent instances of #3297
samching
pushed a commit
to samching/langchain
that referenced
this issue
May 1, 2023
per langchain-ai#3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
samching
pushed a commit
to samching/langchain
that referenced
this issue
May 1, 2023
- Proactively raise error if a tool subclasses BaseTool, defines its own schema, but fails to add the type-hints - fix the auto-inferred schema of the decorator to strip the unneeded virtual kwargs from the schema dict Helps avoid silent instances of langchain-ai#3297
yanghua
pushed a commit
to yanghua/langchain
that referenced
this issue
May 9, 2023
per langchain-ai#3297 Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
yanghua
pushed a commit
to yanghua/langchain
that referenced
this issue
May 9, 2023
- Proactively raise error if a tool subclasses BaseTool, defines its own schema, but fails to add the type-hints - fix the auto-inferred schema of the decorator to strip the unneeded virtual kwargs from the schema dict Helps avoid silent instances of langchain-ai#3297
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following the example here, when subclassing BaseTool, args_schema is always None.
langchain 0.0.145
The text was updated successfully, but these errors were encountered: