mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
community: add default value to bing_search_url (#23306)
bing_search_url is an endpoint to requests bing search resource and is normally invariant to users, we can give it the default value to simply the uesages of this utility/tool
This commit is contained in:
parent
68e0ae3286
commit
ad50702934
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user