diff --git a/docs/docs/integrations/tools/requests.ipynb b/docs/docs/integrations/tools/requests.ipynb index 0f41f8ea989..b0a9ec5ad9d 100644 --- a/docs/docs/integrations/tools/requests.ipynb +++ b/docs/docs/integrations/tools/requests.ipynb @@ -12,38 +12,40 @@ }, { "cell_type": "code", - "execution_count": 3, - "id": "5d8764ba", + "execution_count": null, + "id": "8a84d1fd", "metadata": {}, "outputs": [], "source": [ - "from langchain.agents import load_tools\n", - "\n", - "requests_tools = load_tools([\"requests_all\"])" + "%pip install --upgrade --quiet langchain-community" ] }, { "cell_type": "code", - "execution_count": 6, - "id": "bc5edde2", + "execution_count": 3, + "id": "5d8764ba", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[RequestsGetTool(name='requests_get', description='A portal to the internet. Use this when you need to get specific content from a website. Input should be a url (i.e. https://www.google.com). The output will be the text response of the GET request.', args_schema=None, return_direct=False, verbose=False, callbacks=None, callback_manager=None, requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None)),\n", - " RequestsPostTool(name='requests_post', description='Use this when you want to POST to a website.\\n Input should be a json string with two keys: \"url\" and \"data\".\\n The value of \"url\" should be a string, and the value of \"data\" should be a dictionary of \\n key-value pairs you want to POST to the url.\\n Be careful to always use double quotes for strings in the json string\\n The output will be the text response of the POST request.\\n ', args_schema=None, return_direct=False, verbose=False, callbacks=None, callback_manager=None, requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None)),\n", - " RequestsPatchTool(name='requests_patch', description='Use this when you want to PATCH to a website.\\n Input should be a json string with two keys: \"url\" and \"data\".\\n The value of \"url\" should be a string, and the value of \"data\" should be a dictionary of \\n key-value pairs you want to PATCH to the url.\\n Be careful to always use double quotes for strings in the json string\\n The output will be the text response of the PATCH request.\\n ', args_schema=None, return_direct=False, verbose=False, callbacks=None, callback_manager=None, requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None)),\n", - " RequestsPutTool(name='requests_put', description='Use this when you want to PUT to a website.\\n Input should be a json string with two keys: \"url\" and \"data\".\\n The value of \"url\" should be a string, and the value of \"data\" should be a dictionary of \\n key-value pairs you want to PUT to the url.\\n Be careful to always use double quotes for strings in the json string.\\n The output will be the text response of the PUT request.\\n ', args_schema=None, return_direct=False, verbose=False, callbacks=None, callback_manager=None, requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None)),\n", - " RequestsDeleteTool(name='requests_delete', description='A portal to the internet. Use this when you need to make a DELETE request to a URL. Input should be a specific url, and the output will be the text response of the DELETE request.', args_schema=None, return_direct=False, verbose=False, callbacks=None, callback_manager=None, requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None))]" + "[RequestsGetTool(requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),\n", + " RequestsPostTool(requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),\n", + " RequestsPatchTool(requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),\n", + " RequestsPutTool(requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),\n", + " RequestsDeleteTool(requests_wrapper=TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True)]" ] }, - "execution_count": 6, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "from langchain_community.agent_toolkits.load_tools import load_tools\n", + "\n", + "requests_tools = load_tools([\"requests_all\"], allow_dangerous_tools=True)\n", + "\n", "requests_tools" ] }, @@ -60,17 +62,17 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "id": "c56d4678", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "TextRequestsWrapper(headers=None, aiosession=None)" + "TextRequestsWrapper(headers=None, aiosession=None, auth=None, response_content_type='text', verify=True)" ] }, - "execution_count": 8, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -80,28 +82,16 @@ "requests_tools[0].requests_wrapper" ] }, - { - "cell_type": "code", - "execution_count": 4, - "id": "81aae09e", - "metadata": {}, - "outputs": [], - "source": [ - "from langchain_community.utilities import TextRequestsWrapper\n", - "\n", - "requests = TextRequestsWrapper()" - ] - }, { "cell_type": "code", "execution_count": 5, - "id": "fd210142", + "id": "81aae09e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'