From 630ffee1edb93018d60fbb5273911e6031c83de2 Mon Sep 17 00:00:00 2001 From: Serper Date: Fri, 16 Jun 2023 01:01:59 +0100 Subject: [PATCH] Replaced search tool with google-serper --- notebooks/pe-lecture.ipynb | 4 ++-- notebooks/react.ipynb | 4 ++-- pages/techniques/react.ca.mdx | 4 ++-- pages/techniques/react.en.mdx | 4 ++-- pages/techniques/react.fi.mdx | 2 +- pages/techniques/react.ru.mdx | 4 ++-- pages/techniques/react.zh.mdx | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/notebooks/pe-lecture.ipynb b/notebooks/pe-lecture.ipynb index ba9ff49..24fbf44 100644 --- a/notebooks/pe-lecture.ipynb +++ b/notebooks/pe-lecture.ipynb @@ -91,7 +91,7 @@ "\n", "# for LangChain\n", "os.environ[\"OPENAI_API_KEY\"] = os.getenv(\"OPENAI_API_KEY\")\n", - "os.environ[\"SERPAPI_API_KEY\"] = os.getenv(\"SERPAPI_API_KEY\")" + "os.environ[\"SERPER_API_KEY\"] = os.getenv(\"SERPER_API_KEY\")" ] }, { @@ -910,7 +910,7 @@ "source": [ "llm = OpenAI(temperature=0)\n", "\n", - "tools = load_tools([\"serpapi\", \"llm-math\"], llm=llm)\n", + "tools = load_tools([\"google-serper\", \"llm-math\"], llm=llm)\n", "agent = initialize_agent(tools, llm, agent=\"zero-shot-react-description\", verbose=True)" ] }, diff --git a/notebooks/react.ipynb b/notebooks/react.ipynb index 4e83e76..be27ac2 100644 --- a/notebooks/react.ipynb +++ b/notebooks/react.ipynb @@ -32,7 +32,7 @@ "\n", "# load API keys; you will need to obtain these if you haven't yet\n", "os.environ[\"OPENAI_API_KEY\"] = os.getenv(\"OPENAI_API_KEY\")\n", - "os.environ[\"SERPAPI_API_KEY\"] = os.getenv(\"SERPAPI_API_KEY\")" + "os.environ[\"SERPER_API_KEY\"] = os.getenv(\"SERPER_API_KEY\")" ] }, { @@ -42,7 +42,7 @@ "outputs": [], "source": [ "llm = OpenAI(model_name=\"text-davinci-003\" ,temperature=0)\n", - "tools = load_tools([\"serpapi\", \"llm-math\"], llm=llm)\n", + "tools = load_tools([\"google-serper\", \"llm-math\"], llm=llm)\n", "agent = initialize_agent(tools, llm, agent=\"zero-shot-react-description\", verbose=True)" ] }, diff --git a/pages/techniques/react.ca.mdx b/pages/techniques/react.ca.mdx index 0bb1c20..a0945af 100644 --- a/pages/techniques/react.ca.mdx +++ b/pages/techniques/react.ca.mdx @@ -126,7 +126,7 @@ load_dotenv() # carrega les claus API; hauràs d'obtenir-les si encara no les tens os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") -os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") +os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ``` @@ -134,7 +134,7 @@ Ara podem configurar l'LLM, les eines que utilitzarem i l'agent que ens permet u ``` python llm = OpenAI(model_name="text-davinci-003" ,temperature=0) -tools = load_tools(["serpapi", "llm-math"], llm=llm) +tools = load_tools(["google-serper", "llm-math"], llm=llm) agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True) ``` diff --git a/pages/techniques/react.en.mdx b/pages/techniques/react.en.mdx index ec7707f..dcb6160 100644 --- a/pages/techniques/react.en.mdx +++ b/pages/techniques/react.en.mdx @@ -127,7 +127,7 @@ load_dotenv() # load API keys; you will need to obtain these if you haven't yet os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") -os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") +os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ``` @@ -135,7 +135,7 @@ Now we can configure the LLM, the tools we will use, and the agent that allows u ``` python llm = OpenAI(model_name="text-davinci-003" ,temperature=0) -tools = load_tools(["serpapi", "llm-math"], llm=llm) +tools = load_tools(["google-serper", "llm-math"], llm=llm) agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True) ``` diff --git a/pages/techniques/react.fi.mdx b/pages/techniques/react.fi.mdx index a1c9f06..44c264f 100644 --- a/pages/techniques/react.fi.mdx +++ b/pages/techniques/react.fi.mdx @@ -116,7 +116,7 @@ load_dotenv() # load API keys; you will need to obtain these if you haven't yet os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") -os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") +os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ``` diff --git a/pages/techniques/react.ru.mdx b/pages/techniques/react.ru.mdx index f45622f..ba84d4d 100644 --- a/pages/techniques/react.ru.mdx +++ b/pages/techniques/react.ru.mdx @@ -126,7 +126,7 @@ load_dotenv() # load API keys; you will need to obtain these if you haven't yet os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") -os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") +os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ``` @@ -134,7 +134,7 @@ os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") ``` python llm = OpenAI(model_name="text-davinci-003" ,temperature=0) -tools = load_tools(["serpapi", "llm-math"], llm=llm) +tools = load_tools(["google-serper", "llm-math"], llm=llm) agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True) ``` diff --git a/pages/techniques/react.zh.mdx b/pages/techniques/react.zh.mdx index b036f3a..f65a3ea 100644 --- a/pages/techniques/react.zh.mdx +++ b/pages/techniques/react.zh.mdx @@ -116,7 +116,7 @@ load_dotenv() # 载入 API keys; 如果没有,你需要先获取。 os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") -os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") +os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ``` @@ -124,7 +124,7 @@ os.environ["SERPAPI_API_KEY"] = os.getenv("SERPAPI_API_KEY") ``` python llm = OpenAI(model_name="text-davinci-003" ,temperature=0) -tools = load_tools(["serpapi", "llm-math"], llm=llm) +tools = load_tools(["google-serper", "llm-math"], llm=llm) agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True) ```