I am testing with the GPT4 OCR Vision (model version: gpt-4 vision preview),
- use postman send API with OCR enhancement body like the API document claimed "enhancements":{ "ocr":{"enabled":true}, "grounding":{"enabled":true} }, "dataSources":[ { "type":"AzureComputerVision", "parameters":{ "endpoint":"https://xyz.cognitiveservices.azure.com", "key":"xyz" } } ]However, I got 400 model error "message": "1 validation error for Requestnbody -> enhancementsn extra fields not permitted (type=value_error.extra)", "type": "invalid_request_error",Azure OpenAI Service REST API reference – Azure OpenAI | Microsoft Learn
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#example-request-2
Can you please help with the OCR enhancement with API?
2
Answers
You can use the the following URI path {base_url}/extensions/chat/completions for OCR enhancements.
I’m using the sample below (python) and it’s working properly!!!
https://learn.microsoft.com/en-us/azure/ai-services/openai/gpt-v-quickstart?tabs=image&pivots=rest-api
I can able to reproduce your issue by simply removing the
extensions
in the URL. Even i did the same mistake in the first try 🙂One can easily make this mistake for
Enhanced chat with vision
which requires a different endpoint which isextensions
on top ofchat/completions
So the correct endpoint to call this feature is
https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/extensions/chat/completions?api-version=2023-12-01-preview
Make sure you add extensions