Hello Vusirikala, Aishwarya,
Thank you for reaching out. It seems that the issue you're encountering is due to the API version 2024-07-31-preview
not being supported by the Azure AI Document Intelligence SDK. Here are some steps to help you get around this issue:
- Use a Supported API Version: The Azure AI Document Intelligence SDK may not yet support the
2024-07-31-preview
API version. Try using a stable, generally available (GA) API version such as 2023-07-31
or 2023-10-31
12. You can update your SDK client to target one of these supported API versions.
- Update SDK Client Library: Ensure that you are using the latest version of the Azure AI Document Intelligence SDK. You can update the SDK client library by running the following command:
pip install --upgrade azure-ai-documentintelligence#This will ensure that you have the latest features and bug fixes
- Modify API Request: Adjust your API request to use a supported API version. For example, you can modify the endpoint URL in your request to target the
2023-07-31
API version:
endpoint = "https://<your-endpoint-name>.cognitiveservices.azure.com/" api_version = "2023-07-31" url = f"{endpoint}/formrecognizer/documentModels/prebuilt-read:analyze?api-version={api_version}"
- Check Parameter Validity: Ensure that all parameters in your API request are valid for the chosen API version. The error message indicates that the parameter
CustomGenerative
is invalid for the 2024-07-31-preview
API version. Verify that you are using the correct parameters as per the API documentation3.
By following these steps, you should be able to resolve the InvalidArgument
error and successfully use the Azure AI Document Intelligence SDK. If you need further assistance, feel free to ask!
For more detailed guidance, you can refer to the official Microsoft documentation:
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Also, i think you resolve the REST endpoint you mentioned before.
Cheers