We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 843806d commit acd06bfCopy full SHA for acd06bf
dspy/adapters/types/tool.py
@@ -204,6 +204,21 @@ def from_langchain(cls, tool: "BaseTool") -> "Tool":
204
205
Returns:
206
A Tool object.
207
+
208
+ Example:
209
+ ```python
210
+ from langchain.tools import tool
211
+ import dspy
212
213
+ @tool
214
+ def add(x: int, y: int):
215
+ "Add two numbers together."
216
+ return x + y
217
218
+ tool = dspy.Tool.from_langchain(add)
219
+ print(await tool.acall(x=1, y=2))
220
+ # 3
221
+ ```
222
"""
223
from dspy.utils.langchain_tool import convert_langchain_tool
224
0 commit comments