Skip to content

Commit e3bc659

Browse files
authored
Updated constructor/class name
1 parent f206cf3 commit e3bc659

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

samples/search/web_search_samples.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
from azure.cognitiveservices.search.websearch import WebSearchAPI
1+
import os
2+
3+
from azure.cognitiveservices.search.websearch import WebSearchClient
24
from azure.cognitiveservices.search.websearch.models import SafeSearch
35
from msrest.authentication import CognitiveServicesCredentials
46

57
# Add your Bing Search V7 subscription key to your environment variables.
68
SUBSCRIPTION_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
912
logger = 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

0 commit comments

Comments
 (0)