|
|
@ -191,6 +191,8 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"outputs": [],
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"from typing import Type\n",
|
|
|
|
|
|
|
|
"\n",
|
|
|
|
"class CustomSearchTool(BaseTool):\n",
|
|
|
|
"class CustomSearchTool(BaseTool):\n",
|
|
|
|
" name = \"Search\"\n",
|
|
|
|
" name = \"Search\"\n",
|
|
|
|
" description = \"useful for when you need to answer questions about current events\"\n",
|
|
|
|
" description = \"useful for when you need to answer questions about current events\"\n",
|
|
|
@ -206,7 +208,7 @@
|
|
|
|
"class CustomCalculatorTool(BaseTool):\n",
|
|
|
|
"class CustomCalculatorTool(BaseTool):\n",
|
|
|
|
" name = \"Calculator\"\n",
|
|
|
|
" name = \"Calculator\"\n",
|
|
|
|
" description = \"useful for when you need to answer questions about math\"\n",
|
|
|
|
" description = \"useful for when you need to answer questions about math\"\n",
|
|
|
|
" args_schema=CalculatorInput\n",
|
|
|
|
" args_schema: Type[BaseModel] = CalculatorInput\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
" def _run(self, query: str) -> str:\n",
|
|
|
|
" def _run(self, query: str) -> str:\n",
|
|
|
|
" \"\"\"Use the tool.\"\"\"\n",
|
|
|
|
" \"\"\"Use the tool.\"\"\"\n",
|
|
|
|