In my script, I have the following:
response = requests.get(list_url[0], allow_redirects=True)
s = io.BytesIO()
s.write(response.content)
s.seek(0)
mimetype="application/octet-stream"
document = {'file': s.read(), 'mime': mimetype}
request = {"name": name, "document": document}
However, when I send a request to the server:
result = client.process_document(request=request)
I get ValueError: Protocol message Document has no "file" field
.
Is this due because google docAI doesn't accept octet-stream?