@Danny Zhang Thanks for getting back nd clarifying your ask. This api-version
is supported 2024-02-01. However the SDK is not yet updated to use this new version and it is still using older version 2023-10-01
.
.
So, if you want to use this 2024-02-01 api-version, try directly invoking it from the REST API as shown below:
POST https://XXXX.cognitiveservices.azure.com/computervision/imageanalysis:analyze?features=caption%2Cread&api-version=2024-02-01&gender-neutral-caption=true
Content-Type: application/json
Ocp-Apim-Subscription-Key: 337e4XXXXXXX4633cd7f
Request Body:
{"url":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}
.
.
So, if you want to use this 2024-02-01
api-version, try directly invoking it from the Python code via REST API as shown below:
import requests
# Define the endpoint and parameters
url = "https://XXXX.cognitiveservices.azure.com/computervision/imageanalysis:analyze"
params = {
'features': 'caption,read',
'api-version': '2024-02-01',
'gender-neutral-caption': 'true'
}
# Define the headers
headers = {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '337e4XXXXXXX4633cd7f'
}
# Define the request body
data = {
'url': 'https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png'
}
# Make the POST request
response = requests.post(url, headers=headers, params=params, json=data)
# Print the response
print(response.status_code)
print(response.json())
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
** Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.