The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Fix failing serpapi response processing for Google Maps API (#14817)
Evgenii Molovb4ec340fb34a
diff --git a/libs/community/langchain_community/utilities/serpapi.py b/libs/community/langchain_community/utilities/serpapi.pyindex f78b4afc90..2404df9bcf 100644--- a/libs/community/langchain_community/utilities/serpapi.py+++ b/libs/community/langchain_community/utilities/serpapi.py@@ -211,9 +211,14 @@ class SerpAPIWrapper(BaseModel):if "buying_guide" in res.keys():snippets.append(res["buying_guide"])- if "local_results" in res.keys() and "places" in res["local_results"].keys():+ if "local_results" in res and isinstance(res["local_results"], list):+ snippets += res["local_results"]+ if (+ "local_results" in res.keys()+ and isinstance(res["local_results"], dict)+ and "places" in res["local_results"].keys()+ ):snippets.append(res["local_results"]["places"])-if len(snippets) > 0:return str(snippets)else: