From ec0ebb76f22fac452f3a2612a6c110e80cf45461 Mon Sep 17 00:00:00 2001 From: Terry Tan Date: Thu, 23 Jan 2025 23:03:01 +0800 Subject: [PATCH] community: fix Google Scholar tool errors (#29371) Resolve https://github.com/langchain-ai/langchain/issues/27557 --- libs/community/langchain_community/utilities/google_scholar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/community/langchain_community/utilities/google_scholar.py b/libs/community/langchain_community/utilities/google_scholar.py index ffc94848a61..6dd966921a6 100644 --- a/libs/community/langchain_community/utilities/google_scholar.py +++ b/libs/community/langchain_community/utilities/google_scholar.py @@ -45,6 +45,7 @@ class GoogleScholarAPIWrapper(BaseModel): hl: str = "en" lr: str = "lang_en" serp_api_key: Optional[str] = None + google_scholar_engine: Any = None model_config = ConfigDict( extra="forbid", @@ -55,7 +56,7 @@ class GoogleScholarAPIWrapper(BaseModel): def validate_environment(cls, values: Dict) -> Any: """Validate that api key and python package exists in environment.""" serp_api_key = get_from_dict_or_env(values, "serp_api_key", "SERP_API_KEY") - values["SERP_API_KEY"] = serp_api_key + values["serp_api_key"] = serp_api_key try: from serpapi import GoogleScholarSearch