Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsAgent TypesConversationalOpenAI functionsOpenAI Multi Functions AgentReActReAct document storeSelf-ask with searchStructured tool chatXML AgentHow-toToolsToolkitsCallbacksModulesSecurityGuidesMoreModulesAgentsAgent TypesOpenAI Multi Functions AgentOn this pageOpenAI Multi Functions AgentThis notebook showcases using an agent that uses the OpenAI functions ability to respond to the prompts of the user using a Large Language Model.Install openai, google-search-results packages which are required as the LangChain packages call them internally.pip install openai google-search-resultsfrom langchain.utilities import SerpAPIWrapperfrom langchain.agents import initialize_agent, Toolfrom langchain.agents import AgentTypefrom langchain.chat_models import ChatOpenAIThe agent is given the ability to perform search functionalities with the respective toolSerpAPIWrapper:This initializes the SerpAPIWrapper for search functionality (search).import getpassimport osos.environ["SERPAPI_API_KEY"] = getpass.getpass()    ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑# Initialize the OpenAI language model# Replace <your_api_key> in openai_api_key="<your_api_key>" with your actual OpenAI key.llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo-0613")# Initialize the SerpAPIWrapper for search functionality# Replace <your_api_key> in serpapi_api_key="<your_api_key>" with your actual SerpAPI key.search = SerpAPIWrapper()# Define a list of tools offered by the agenttools = [    Tool(        name="Search",        func=search.run,        description="Useful when you need to answer questions about current events. You should ask targeted questions.",    ),]mrkl = initialize_agent(    tools, llm,
This notebook showcases using an agent that uses the OpenAI functions ability to respond to the prompts of the user using a Large Language Model.
This notebook showcases using an agent that uses the OpenAI functions ability to respond to the prompts of the user using a Large Language Model. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsAgent TypesConversationalOpenAI functionsOpenAI Multi Functions AgentReActReAct document storeSelf-ask with searchStructured tool chatXML AgentHow-toToolsToolkitsCallbacksModulesSecurityGuidesMoreModulesAgentsAgent TypesOpenAI Multi Functions AgentOn this pageOpenAI Multi Functions AgentThis notebook showcases using an agent that uses the OpenAI functions ability to respond to the prompts of the user using a Large Language Model.Install openai, google-search-results packages which are required as the LangChain packages call them internally.pip install openai google-search-resultsfrom langchain.utilities import SerpAPIWrapperfrom langchain.agents import initialize_agent, Toolfrom langchain.agents import AgentTypefrom langchain.chat_models import ChatOpenAIThe agent is given the ability to perform search functionalities with the respective toolSerpAPIWrapper:This initializes the SerpAPIWrapper for search functionality (search).import getpassimport osos.environ["SERPAPI_API_KEY"] = getpass.getpass()    ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑# Initialize the OpenAI language model# Replace <your_api_key> in openai_api_key="<your_api_key>" with your actual OpenAI key.llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo-0613")# Initialize the SerpAPIWrapper for search functionality# Replace <your_api_key> in serpapi_api_key="<your_api_key>" with your actual SerpAPI key.search = SerpAPIWrapper()# Define a list of tools offered by the agenttools = [    Tool(        name="Search",        func=search.run,        description="Useful when you need to answer questions about current events. You should ask targeted questions.",    ),]mrkl = initialize_agent(    tools, llm,