Skip to content

Commit 9ffe304

Browse files
authored
Updated constructor/class name
1 parent 7569239 commit 9ffe304

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

samples/search/image_search_samples.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
import os
2+
13
from azure.cognitiveservices.search.imagesearch import ImageSearchClient
24
from azure.cognitiveservices.search.imagesearch.models import ImageType, ImageAspect, ImageInsightModule
35
from msrest.authentication import CognitiveServicesCredentials
46

5-
SUBSCRIPTION_KEY = "IMAGESEARCH_SUBSCRIPTION_KEY"
6-
7+
SUBSCRIPTION_KEY = os.environ["BING_IMAGE_SEARCH_SUBSCRIPTION_KEY"]
8+
ENDPOINT = os.environ['BING_IMAGE_SEARCH_ENDPOINT']
79

810
def image_search(subscription_key):
911
"""ImageSearch.
1012
1113
This will search images for (canadian rockies) then verify number of results and print out first image result, pivot suggestion, and query expansion.
1214
"""
1315
client = ImageSearchClient(
14-
endpoint="https://api.cognitive.microsoft.com",
16+
endpoint=ENDPOINT,
1517
credentials=CognitiveServicesCredentials(subscription_key)
1618
)
1719

0 commit comments

Comments
 (0)