Skip to content

Commit 6b8f763

Browse files
committed
fixed image search samples by updating endpoint
1 parent dc1dadb commit 6b8f763

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

samples/search/image_search_samples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def image_search(subscription_key):
1010
This will search images for (canadian rockies) then verify number of results and print out first image result, pivot suggestion, and query expansion.
1111
"""
1212
client = ImageSearchClient(
13-
endpoint="https://api.cognitive.microsoft.com/bing/v7.0",
13+
endpoint="https://api.cognitive.microsoft.com",
1414
credentials=CognitiveServicesCredentials(subscription_key)
1515
)
1616

@@ -66,7 +66,7 @@ def image_search_with_filters(subscription_key):
6666
This will search images for (studio ghibli), filtered for animated gifs and wide aspect, then verify number of results and print out insightsToken, thumbnail url and web url of first result.
6767
"""
6868
client = ImageSearchClient(
69-
endpoint="https://api.cognitive.microsoft.com/bing/v7.0",
69+
endpoint="https://api.cognitive.microsoft.com",
7070
credentials=CognitiveServicesCredentials(subscription_key)
7171
)
7272

@@ -97,7 +97,7 @@ def image_trending(subscription_key):
9797
This will search for trending images then verify categories and tiles.
9898
"""
9999
client = ImageSearchClient(
100-
endpoint="https://api.cognitive.microsoft.com/bing/v7.0",
100+
endpoint="https://api.cognitive.microsoft.com",
101101
credentials=CognitiveServicesCredentials(subscription_key)
102102
)
103103

@@ -130,7 +130,7 @@ def image_detail(subscription_key):
130130
This will search images for (degas) and then search for image details of the first image.
131131
"""
132132
client = ImageSearchClient(
133-
endpoint="https://api.cognitive.microsoft.com/bing/v7.0",
133+
endpoint="https://api.cognitive.microsoft.com",
134134
credentials=CognitiveServicesCredentials(subscription_key)
135135
)
136136

@@ -209,5 +209,5 @@ def image_detail(subscription_key):
209209
if __name__ == "__main__":
210210
import sys, os.path
211211
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
212-
from tools import execute_samples
212+
from samples.tools import execute_samples
213213
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

0 commit comments

Comments
 (0)