I'm trying to integrate the Document AI into a project. The requests worked last week inside of Insomnia, but they are not working this week. Unfortunately, the error message is not helpful for telling me what's invalid. This is the response that I get.
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
And the body of the request looks like this.
{
"skipHumanReview": true,
"rawDocument": {
"mimeType": "application/pdf",
"content": "JVBERi0xLjcKCjQgMCBvYmoKPDwKL0JpdHNQZXJDb21wb25lbnQgOAovQ29sb3..."
}
}
What is the invalid argument? I've verified that the base64 string that I've sent is indeed a valid PDF since I can open it as a PDF with some testing code. If I take the same PDF and run it through the Console, it works just fine and the document is parsed.
The error message is not helping me figure out what's wrong. Could it be some kind of configuration with my Document AI in the console that's preventing this from working? Any ideas as to why I get this error message? All the arguments look correct according to the documentation here.
https://cloud.google.com/document-ai/docs/send-request#documentai_process_document-drest
Same here, i "fixed" this temporarily using the stable version of processor google pretrained-foundation-model-v1.0-2023-08-22 , but i think this not the best solution because the news versions are better.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |