pydantic_ai.ext
tool_from_langchain
tool_from_langchain(langchain_tool: LangChainTool) -> Tool
Creates a Pydantic AI tool proxy from a LangChain tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
langchain_tool
|
LangChainTool
|
The LangChain tool to wrap. |
required |
Returns:
| Type | Description |
|---|---|
Tool
|
A Pydantic AI tool that corresponds to the LangChain tool. |
Source code in pydantic_ai_slim/pydantic_ai/ext/langchain.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
LangChainToolset
Bases: FunctionToolset
A toolset that wraps LangChain tools.
Source code in pydantic_ai_slim/pydantic_ai/ext/langchain.py
67 68 69 70 71 | |