diff --git a/libs/community/langchain_community/utilities/bing_search.py b/libs/community/langchain_community/utilities/bing_search.py index 52c9935261..807f4858a3 100644 --- a/libs/community/langchain_community/utilities/bing_search.py +++ b/libs/community/langchain_community/utilities/bing_search.py @@ -5,6 +5,10 @@ import requests from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator from langchain_core.utils import get_from_dict_or_env +# BING_SEARCH_ENDPOINT is the default endpoint for Bing Search API and is normally +# invariant to users. +BING_SEARCH_ENDPOINT = "https://api.bing.microsoft.com/v7.0/search" + class BingSearchAPIWrapper(BaseModel): """Wrapper for Bing Search API.""" @@ -52,7 +56,7 @@ class BingSearchAPIWrapper(BaseModel): values, "bing_search_url", "BING_SEARCH_URL", - # default="https://api.bing.microsoft.com/v7.0/search", + default=BING_SEARCH_ENDPOINT, ) values["bing_search_url"] = bing_search_url