MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/tools/bing_search/api.py:32–45  ·  view source on GitHub ↗

Initialize the BingSearch instance with the given subscription key. Parameters ---------- subscription_key : str The subscription key to use for the Bing API.

(self, subscription_key : str)

Source from the content-addressed store, hash-verified

30 Load the detailed page of the search result at the given index.
31 """
32 def __init__(self, subscription_key : str) -> None:
33 """
34 Initialize the BingSearch instance with the given subscription key.
35
36 Parameters
37 ----------
38 subscription_key : str
39 The subscription key to use for the Bing API.
40 """
41 self._headers = {
42 'Ocp-Apim-Subscription-Key': subscription_key
43 }
44 self._endpoint = "https://api.bing.microsoft.com/v7.0/search"
45 self._mkt = 'en-US'
46
47 def search(self, key_words : str, max_retry : int = 3):
48 for _ in range(max_retry):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected