Skip to content

Commit 7569239

Browse files
authored
Updated constructor/class name
1 parent 2aa6e90 commit 7569239

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

samples/search/image-search-quickstart.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
from azure.cognitiveservices.search.imagesearch import ImageSearchAPI
1+
from azure.cognitiveservices.search.imagesearch import ImageSearchClient
22
from msrest.authentication import CognitiveServicesCredentials
33

4-
# Add your Bing Search V7 subscription key to your environment variables.
5-
subscription_key = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
4+
# Add your Bing Search V7 subscription key and endpoint to your environment variables.
5+
SUBSCRIPTION_KEY = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
6+
ENDPOINT = os.environ['BING_ENTITY_SEARCH_ENDPOINT']
7+
68
search_term = "canadian rockies"
79

810
"""
911
This application will search images on the web with the Bing Image Search API and print out first image result.
1012
"""
1113
# create the image search client
12-
client = ImageSearchAPI(CognitiveServicesCredentials(subscription_key))
14+
client = ImageSearchClient(ENDPOINT, CognitiveServicesCredentials(SUBSCRIPTION_KEY))
1315
# send a search query to the Bing Image Search API
1416
image_results = client.images.search(query=search_term)
1517
print("Searching the web for images of: {}".format(search_term))

0 commit comments

Comments
 (0)