def serpapi_search(query: str):
    """
    Perform a SerpApi search and return the JSON results.
    """

    response = requests.get("https://serpapi.com/search", params=_get_params(query))
    response.raise_for_status()

    result_json = response.json()

    filter = os.getenv("SERPAPI_RESULT_FILTER") or "organic_results(title,link,snippet)"
    return _filter_results(result_json, filter)

    Perform a SerpApi search and return the JSON results.
    
src/autogpt_plugins/serpapi/serpapi_search.py