Skip to content

Commit df781f0

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

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

samples/search/custom_search_samples.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
import os
2+
13
from azure.cognitiveservices.search.customsearch import CustomSearchClient
24
from msrest.authentication import CognitiveServicesCredentials
35

46
SUBSCRIPTION_KEY = os.environ['BING_CUSTOM_SEARCH_SUBSCRIPTION_KEY']
7+
ENDPOINT = os.environ['BING_CUSTOM_SEARCH_ENDPOINT']
58

69
def custom_search_web_page_result_lookup(subscription_key):
710
"""CustomSearch.
811
912
This will look up a single query (Xbox) and print out name and url for first web result.
1013
"""
1114

12-
client = CustomSearchClient(CognitiveServicesCredentials(subscription_key))
15+
client = CustomSearchClient(
16+
endpoint=ENDPOINT,
17+
credentials=CognitiveServicesCredentials(subscription_key))
1318

1419
try:
1520
web_data = client.custom_instance.search(query="xbox", custom_config=1)

0 commit comments

Comments
 (0)