File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1- from azure .cognitiveservices .search .websearch import WebSearchAPI
1+ import os
2+
3+ from azure .cognitiveservices .search .websearch import WebSearchClient
24from azure .cognitiveservices .search .websearch .models import SafeSearch
35from msrest .authentication import CognitiveServicesCredentials
46
57# Add your Bing Search V7 subscription key to your environment variables.
68SUBSCRIPTION_KEY = os .environ ['BING_SEARCH_V7_SUBSCRIPTION_KEY' ]
9+ ENDPOINT = os .environ ['BING_SEARCH_V7_ENDPOINT' ]
710
811# Comment this logging mute out, if you want to include logging
912logger = logging .getLogger () # get the default logger
@@ -15,7 +18,7 @@ def result_types_lookup(subscription_key):
1518
1619 This will look up a single query (Xbox) and print out name and url for first web, image, news and videos results.
1720 """
18- client = WebSearchAPI ( CognitiveServicesCredentials (subscription_key ))
21+ client = WebSearchClient ( ENDPOINT , CognitiveServicesCredentials (subscription_key ))
1922
2023 try :
2124
You can’t perform that action at this time.
0 commit comments