Skip to content

Commit

Permalink
args_schema type hint on subclassing (#3323)
Browse files Browse the repository at this point in the history
per #3297

Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
  • Loading branch information
2 people authored and vowelparrot committed Apr 26, 2023
1 parent beb0f6f commit 6a0abcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/modules/agents/tools/custom_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 6a0abcc

Please sign in to comment.