From ee1d488c036a3c65c799a90318977e54907e107f Mon Sep 17 00:00:00 2001 From: Shuqian Date: Thu, 6 Jul 2023 00:47:50 +0800 Subject: [PATCH] fix: rename the invalid function name of GoogleSerperResults Tool for OpenAIFunctionCall (#7176) - Description: rename the invalid function name of GoogleSerperResults Tool for OpenAIFunctionCall - Tag maintainer: @hinthornw When I use the GoogleSerperResults in OpenAIFunctionCall agent, the following error occurs: ```shell openai.error.InvalidRequestError: 'Google Serrper Results JSON' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'functions.0.name' ``` So I rename the GoogleSerperResults's property "name" from "Google Serrper Results JSON" to "google_serrper_results_json" just like GoogleSerperRun's name: "google_serper", and it works. I guess this should be reasonable. --- langchain/tools/google_serper/tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/tools/google_serper/tool.py b/langchain/tools/google_serper/tool.py index 18d584085e..a874e871e5 100644 --- a/langchain/tools/google_serper/tool.py +++ b/langchain/tools/google_serper/tool.py @@ -44,7 +44,7 @@ class GoogleSerperResults(BaseTool): """Tool that has capability to query the Serper.dev Google Search API and get back json.""" - name = "Google Serrper Results JSON" + name = "google_serrper_results_json" description = ( "A low-cost Google Search API." "Useful for when you need to answer questions about current events."