docs: update documentation of stackexchange component (#18486)

**Description:** Update documentation of the StackExchange component
**Issue:** None
**Dependencies:** None
This commit is contained in:
aditya thomas 2024-03-05 00:15:29 +05:30 committed by GitHub
parent 5c387a173f
commit 7803b973c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,11 +6,19 @@
"source": [ "source": [
"# StackExchange\n", "# StackExchange\n",
"\n", "\n",
"This notebook goes over how to use the stack exchange component.\n", ">[Stack Exchange](https://stackexchange.com/) is a network of question-and-answer (Q&A) websites on topics in diverse fields, each site covering a specific topic, where questions, answers, and users are subject to a reputation award process. The reputation system allows the sites to be self-moderating.\n",
"\n", "\n",
"All you need to do is install stackapi:\n", "The ``StackExchange`` component integrates the StackExchange API into LangChain allowing access to the [StackOverflow](https://stackoverflow.com/) site of the Stack Excchange network. Stack Overflow focuses on computer programming.\n",
"1. pip install stackapi\n", "\n",
"\n" "\n",
"This notebook goes over how to use the ``StackExchange`` component."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We first have to install the python package stackapi which implements the Stack Exchange API."
] ]
}, },
{ {
@ -19,25 +27,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"pip install stackapi" "pip install --upgrade stackapi"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.utilities import StackExchangeAPIWrapper"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"stackexchange = StackExchangeAPIWrapper()"
] ]
}, },
{ {
@ -46,13 +36,17 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"from langchain_community.utilities import StackExchangeAPIWrapper\n",
"\n",
"stackexchange = StackExchangeAPIWrapper()\n",
"\n",
"stackexchange.run(\"zsh: command not found: python\")" "stackexchange.run(\"zsh: command not found: python\")"
] ]
} }
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@ -66,7 +60,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.8" "version": "3.9.6"
} }
}, },
"nbformat": 4, "nbformat": 4,