Skip to content

Commit e73876a

Browse files
a7m-1sta7m-1stJINO-ROHIT
authored
enhance: serpapi (PR #3489) (#3558)
Co-authored-by: a7m-1st <[email protected]> Co-authored-by: JINO ROHIT <[email protected]>
1 parent d86bbf8 commit e73876a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

camel/toolkits/search_toolkit.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,7 @@ def search_metaso(
13441344
except Exception as e:
13451345
return {"error": f"Metaso search failed: {e}"}
13461346

1347+
@dependencies_required("google-search-results")
13471348
@api_keys_required([(None, 'SERPAPI_KEY')])
13481349
def search_serpapi(
13491350
self,
@@ -1414,7 +1415,7 @@ def search_serpapi(
14141415
"filter": filter,
14151416
}
14161417

1417-
if custom_params:
1418+
if custom_params is not None:
14181419
params.update(custom_params)
14191420
try:
14201421
search = SerpApiClient(params)
@@ -1439,10 +1440,6 @@ def search_serpapi(
14391440

14401441
return {"results": formatted_results}
14411442

1442-
except ImportError:
1443-
return {
1444-
"error": "serpapi library not installed. Install with: pip install google-search-results"
1445-
}
14461443
except Exception as e:
14471444
return {"error": f"SerpApi search failed: {e!s}"}
14481445

0 commit comments

Comments
 (0)