File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 9999
100100# mypy
101101.mypy_cache /
102+
103+ # idea
104+ .idea /
Original file line number Diff line number Diff line change 11azure-cognitiveservices-language-luis
22azure-cognitiveservices-language-spellcheck
33azure-cognitiveservices-language-textanalytics
4- azure-cognitiveservices-search-autosuggest
4+ azure-cognitiveservices-search-autosuggest >= 1.0
55azure-cognitiveservices-search-customsearch
66azure-cognitiveservices-search-entitysearch
77azure-cognitiveservices-search-imagesearch
Original file line number Diff line number Diff line change 1- from azure .cognitiveservices .search .autosuggest import AutoSuggestSearchAPI
1+ from azure .cognitiveservices .search .autosuggest import AutoSuggestClient
22from azure .cognitiveservices .search .autosuggest .models import (
33 Suggestions ,
44 SuggestionsSuggestionGroup ,
@@ -14,7 +14,10 @@ def autosuggest_lookup(subscription_key):
1414
1515 This will look up a single query (Xbox) and print out name and url for first web result.
1616 """
17- client = AutoSuggestSearchAPI (CognitiveServicesCredentials (subscription_key ))
17+ client = AutoSuggestClient (
18+ endpoint = "https://api.cognitive.microsoft.com" ,
19+ credentials = CognitiveServicesCredentials (subscription_key )
20+ )
1821
1922 try :
2023 suggestions = client .auto_suggest (query = "Satya Nadella" ) # type: Suggestions
@@ -41,7 +44,10 @@ def error(subscription_key):
4144 """
4245
4346 # Breaking the subscription key on purpose
44- client = AutoSuggestSearchAPI (CognitiveServicesCredentials (subscription_key + "1" ))
47+ client = AutoSuggestClient (
48+ endpoint = "https://api.cognitive.microsoft.com" ,
49+ credentials = CognitiveServicesCredentials (subscription_key + "1" )
50+ )
4551
4652 try :
4753 suggestions = client .auto_suggest (query = "Satya Nadella" , market = "no-ty" )
You can’t perform that action at this time.
0 commit comments