Skip to content

Commit 0e13caf

Browse files
authored
Updated constructor/class name
1 parent 1658a3a commit 0e13caf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

samples/search/custom_image_search_samples.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
from azure.cognitiveservices.search.customimagesearch import CustomImageSearchAPI
1+
import os
2+
3+
from azure.cognitiveservices.search.customimagesearch import CustomImageSearchClient
24
from msrest.authentication import CognitiveServicesCredentials
35

46
# Add your Bing Custom Search subscription key to your environment variables.
57
SUBSCRIPTION_KEY = os.environ['BING_CUSTOM_SEARCH_SUBSCRIPTION_KEY']
8+
ENDPOINT = os.environ['BING_CUSTOM_SEARCH_ENDPOINT']
69

710
def custom_image_search_result_lookup(subscription_key):
811
"""CustomImageSearchResultLookup.
912
1013
This will look up a single query (Xbox) and print out number of results, insights token, thumbnail url, content url for the first image result
1114
"""
1215

13-
client = CustomImageSearchAPI(
16+
client = CustomImageSearchClient(
17+
endpoint=ENDPOINT,
1418
credentials=CognitiveServicesCredentials(subscription_key))
1519
try:
1620
image_results = client.custom_instance.image_search(

0 commit comments

Comments
 (0)