From 8a95fdaee18b46b1e972b364835f23ccdff97c9d Mon Sep 17 00:00:00 2001 From: libra Date: Fri, 17 Mar 2023 12:55:44 +0800 Subject: [PATCH] Fix all the bug in init Tool in docs (#1725) Fix all the example in the docs when init `Tool` Test by render with jupyter --- docs/ecosystem/google_serper.md | 3 ++- docs/modules/agents/examples/load_from_hub.ipynb | 3 ++- docs/modules/agents/implementations/react.ipynb | 6 ++++-- .../agents/implementations/self_ask_with_search.ipynb | 3 ++- docs/modules/utils/examples/google_serper.ipynb | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/ecosystem/google_serper.md b/docs/ecosystem/google_serper.md index cb175b77..57d0d0da 100644 --- a/docs/ecosystem/google_serper.md +++ b/docs/ecosystem/google_serper.md @@ -34,7 +34,8 @@ search = GoogleSerperAPIWrapper() tools = [ Tool( name="Intermediate Answer", - func=search.run + func=search.run, + description="useful for when you need to ask with search" ) ] diff --git a/docs/modules/agents/examples/load_from_hub.ipynb b/docs/modules/agents/examples/load_from_hub.ipynb index e6232643..9e17d7bb 100644 --- a/docs/modules/agents/examples/load_from_hub.ipynb +++ b/docs/modules/agents/examples/load_from_hub.ipynb @@ -61,7 +61,8 @@ "tools = [\n", " Tool(\n", " name=\"Intermediate Answer\",\n", - " func=search.run\n", + " func=search.run,\n", + " description=\"useful for when you need to ask with search\"\n", " )\n", "]\n", "\n", diff --git a/docs/modules/agents/implementations/react.ipynb b/docs/modules/agents/implementations/react.ipynb index 8ced6b9f..031d5922 100644 --- a/docs/modules/agents/implementations/react.ipynb +++ b/docs/modules/agents/implementations/react.ipynb @@ -24,11 +24,13 @@ "tools = [\n", " Tool(\n", " name=\"Search\",\n", - " func=docstore.search\n", + " func=docstore.search,\n", + " description=\"useful for when you need to ask with search\"\n", " ),\n", " Tool(\n", " name=\"Lookup\",\n", - " func=docstore.lookup\n", + " func=docstore.lookup,\n", + " description=\"useful for when you need to ask with lookup\"\n", " )\n", "]\n", "\n", diff --git a/docs/modules/agents/implementations/self_ask_with_search.ipynb b/docs/modules/agents/implementations/self_ask_with_search.ipynb index 8a264239..6dbb01e6 100644 --- a/docs/modules/agents/implementations/self_ask_with_search.ipynb +++ b/docs/modules/agents/implementations/self_ask_with_search.ipynb @@ -52,7 +52,8 @@ "tools = [\n", " Tool(\n", " name=\"Intermediate Answer\",\n", - " func=search.run\n", + " func=search.run,\n", + " description=\"useful for when you need to ask with search\"\n", " )\n", "]\n", "\n", diff --git a/docs/modules/utils/examples/google_serper.ipynb b/docs/modules/utils/examples/google_serper.ipynb index 19354126..e71e8a67 100644 --- a/docs/modules/utils/examples/google_serper.ipynb +++ b/docs/modules/utils/examples/google_serper.ipynb @@ -121,7 +121,8 @@ "tools = [\n", " Tool(\n", " name=\"Intermediate Answer\",\n", - " func=search.run\n", + " func=search.run,\n", + " description=\"useful for when you need to ask with search\"\n", " )\n", "]\n", "\n",