more than 30 minutes, return only 1 results")Web requestsURL requests are such a common use-case that we have the LLMRequestsChain, which makes an HTTP GET request. from langchain.llms import OpenAIfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMRequestsChain, LLMChaintemplate = """Between >>> and <<< are the raw search result text from google.Extract the answer to the question '{query}' or say "not found" if the information is not contained.Use the formatExtracted:<answer or "not found">>>> {requests_result} <<<Extracted:"""PROMPT = PromptTemplate(    input_variables=["query", "requests_result"],    template=template,)chain = LLMRequestsChain(llm_chain=LLMChain(llm=OpenAI(temperature=0), prompt=PROMPT))question = "What are the Three (3) biggest countries, and their respective sizes?"inputs = {    "query": question,    "url": "https://www.google.com/search?q=" + question.replace(" ", "+"),}chain(inputs)    {'query': 'What are the Three (3) biggest countries, and their respective sizes?',     'url': 'https://www.google.com/search?q=What+are+the+Three+(3)+biggest+countries,+and+their+respective+sizes?',     'output': ' Russia (17,098,242 km¬≤), Canada (9,984,670 km¬≤), China (9,706,961 km¬≤)'}PreviousRetrieve from vector stores directlyNextChatbotsUse caseOverviewQuickstartFunctionsAPI ChainGoing deeperCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Open In Colab
Open In Colab ->: more than 30 minutes, return only 1 results")Web requestsURL requests are such a common use-case that we have the LLMRequestsChain, which makes an HTTP GET request. from langchain.llms import OpenAIfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMRequestsChain, LLMChaintemplate = """Between >>> and <<< are the raw search result text from google.Extract the answer to the question '{query}' or say "not found" if the information is not contained.Use the formatExtracted:<answer or "not found">>>> {requests_result} <<<Extracted:"""PROMPT = PromptTemplate(    input_variables=["query", "requests_result"],    template=template,)chain = LLMRequestsChain(llm_chain=LLMChain(llm=OpenAI(temperature=0), prompt=PROMPT))question = "What are the Three (3) biggest countries, and their respective sizes?"inputs = {    "query": question,    "url": "https://www.google.com/search?q=" + question.replace(" ", "+"),}chain(inputs)    {'query': 'What are the Three (3) biggest countries, and their respective sizes?',     'url': 'https://www.google.com/search?q=What+are+the+Three+(3)+biggest+countries,+and+their+respective+sizes?',     'output': ' Russia (17,098,242 km¬≤), Canada (9,984,670 km¬≤), China (9,706,961 km¬≤)'}PreviousRetrieve from vector stores directlyNextChatbotsUse caseOverviewQuickstartFunctionsAPI ChainGoing deeperCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.