improved arxiv (#3495)

Improved `arxiv/tool.py` by adding more specific information to the
`description`. It would help with selecting `arxiv` tool between other
tools.
Improved `arxiv.ipynb` with more useful descriptions.
This commit is contained in:
leo-gan 2023-04-25 08:09:17 -07:00 committed by GitHub
parent 29f321046e
commit 6b28cbe058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 19 deletions

View File

@ -40,15 +40,19 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": 3, "id": "c89c110c-96ac-4fe1-ba3e-6056543d1a59",
"id": "2a50dd27", "metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [ "source": [
"arxiv = ArxivAPIWrapper()" "Run a query to get information about some `scientific article`/articles. The query text is limited to 300 characters.\n",
"\n",
"It returns these article fields:\n",
"- Publishing date\n",
"- Title\n",
"- Authors\n",
"- Summary\n",
"\n",
"Next query returns information about one article with arxiv Id equal \"1605.08386\". "
] ]
}, },
{ {
@ -75,6 +79,16 @@
"docs" "docs"
] ]
}, },
{
"cell_type": "markdown",
"id": "840f70c9-8f80-4680-bb38-46198e931bcf",
"metadata": {},
"source": [
"Now, we want to get information about one author, `Caprice Stanley`.\n",
"\n",
"This query returns information about three articles. By default, query returns information only about three top articles."
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 5,
@ -99,6 +113,14 @@
"docs" "docs"
] ]
}, },
{
"cell_type": "markdown",
"id": "2d9b6292-a47d-4f99-9827-8e9f244bf887",
"metadata": {},
"source": [
"Now, we are trying to find information about non-existing article. In this case, the response is \"No good Arxiv Result was found\""
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 6,
@ -122,14 +144,6 @@
"docs = arxiv.run(\"1605.08386WWW\")\n", "docs = arxiv.run(\"1605.08386WWW\")\n",
"docs" "docs"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4f4e9602",
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {
@ -148,7 +162,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.9.1" "version": "3.10.6"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -9,8 +9,11 @@ class ArxivQueryRun(BaseTool):
name = "Arxiv" name = "Arxiv"
description = ( description = (
"A wrapper around Arxiv. " "A wrapper around Arxiv.org "
"Useful for getting summary of articles from arxiv.org. " "Useful for when you need to answer questions about Physics, Mathematics, "
"Computer Science, Quantitative Biology, Quantitative Finance, Statistics, "
"Electrical Engineering, and Economics "
"from scientific articles on arxiv.org. "
"Input should be a search query." "Input should be a search query."
) )
api_wrapper: ArxivAPIWrapper api_wrapper: ArxivAPIWrapper