diff --git a/langchain/utilities/serpapi.py b/langchain/utilities/serpapi.py index 60ceb37895..2843a7d092 100644 --- a/langchain/utilities/serpapi.py +++ b/langchain/utilities/serpapi.py @@ -143,6 +143,11 @@ class SerpAPIWrapper(BaseModel): and "game_spotlight" in res["sports_results"].keys() ): toret = res["sports_results"]["game_spotlight"] + elif ( + "shopping_results" in res.keys() + and "title" in res["shopping_results"][0].keys() + ): + toret = res["shopping_results"][:3] elif ( "knowledge_graph" in res.keys() and "description" in res["knowledge_graph"].keys()