Add convenience method to use LangChain community tools
Merged
MA
1y ago+494+494+012345678901234567890123456789-8-8-0123456789
References #1831
This does work however the style and approach are very much open for discussion. In particular:
- this creates a function just so it can be inspected, as part of that it has a very bad mapping from json schema types back to python.
- the
pydantic_ai.tool.Toolclass has no base class that describes the desired behaviour. - the LangChain BaseTool defines json schemas for the args and similar which could more directly be translated to the
pydantic_ai.tool.Toolclass. - future integrations of this type might benefit from a similar approach.
To make my PR simple I have introduced a minimal change. I think it would be good to discuss a more maintainable and extensible approach.