{ "cells": [ { "cell_type": "markdown", "id": "f34864b5", "metadata": {}, "source": [ "# Requests\n", "\n", "The web contains a lot of information that LLMs do not have access to. In order to easily let LLMs interact with that information, we provide a wrapper around the Python Requests module that takes in a URL and fetches data from that URL." ] }, { "cell_type": "code", "execution_count": 3, "id": "81aae09e", "metadata": {}, "outputs": [], "source": [ "from langchain.utilities import TextRequestsWrapper" ] }, { "cell_type": "code", "execution_count": 4, "id": "fd210142", "metadata": {}, "outputs": [], "source": [ "requests = TextRequestsWrapper()" ] }, { "cell_type": "code", "execution_count": 5, "id": "29a77bb2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Google
Search Images Maps Play YouTube News Gmail Drive More »
Web History | Settings | Sign in

\"International

 

Advanced search

Celebrate International Women\\'s Day with Google

© 2023 - Privacy - Terms

'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "requests.get(\"https://www.google.com\")" ] }, { "cell_type": "code", "execution_count": null, "id": "3f27ee3d", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.1" } }, "nbformat": 4, "nbformat_minor": 5 }