Skip to content

The agent engineering platform.

args_schema type hint on subclassing (#3323)

Daniel Chalef61e09229c8a1
diff --git a/docs/modules/agents/tools/custom_tools.ipynb b/docs/modules/agents/tools/custom_tools.ipynb
index 2e2fa6f7f8..b34cd90d2a 100644
--- a/docs/modules/agents/tools/custom_tools.ipynb
+++ b/docs/modules/agents/tools/custom_tools.ipynb
@@ -191,6 +191,8 @@
},
"outputs": [],
"source": [
+ "from typing import Type\n",
+ "\n",
"class CustomSearchTool(BaseTool):\n",
" name = \"Search\"\n",
" description = \"useful for when you need to answer questions about current events\"\n",
@@ -206,7 +208,7 @@
"class CustomCalculatorTool(BaseTool):\n",
" name = \"Calculator\"\n",
" description = \"useful for when you need to answer questions about math\"\n",
- " args_schema=CalculatorInput\n",
+ " args_schema: Type[BaseModel] = CalculatorInput\n",
"\n",
" def _run(self, query: str) -> str:\n",
" \"\"\"Use the tool.\"\"\"\n",