I’m using native pdfs, so I’d like to enable the isTranslateNativePdfOnly field to raise my page limit to 300.
document_input_config = {
"content": document_content,
"mime_type": mine_type,
}
response = client.translate_document(
request={
"parent": parent,
"target_language_code": "en",
"document_input_config": document_input_config,
"isTranslateNativePdfOnly": True,
}
)
This field doesn’t seem to be recognized…
(baseenv) ubuntu@ip-172-31-73-230:~/revrec-dev$ python base_image/services/translation_service/google/doc_to_doc_translation.py ../docs/test_larger.pdf
2023-07-17 21:13:30 DEBUG Checking None for explicit credentials as part of auth process...
2023-07-17 21:13:30 DEBUG Checking Cloud SDK credentials as part of auth process...
Traceback (most recent call last):
File "base_image/services/translation_service/google/doc_to_doc_translation.py", line 78, in <module>
translate_document(file_path)
File "base_image/services/translation_service/google/doc_to_doc_translation.py", line 50, in translate_document
"isTranslateNativePdfOnly": True,
File "/home/ubuntu/anaconda3/envs/baseenv/lib/python3.6/site-packages/google/cloud/translate_v3/services/translation_service/client.py", line 974, in translate_document
request = translation_service.TranslateDocumentRequest(request)
File "/home/ubuntu/anaconda3/envs/baseenv/lib/python3.6/site-packages/proto/message.py", line 566, in __init__
"Unknown field for {}: {}".format(self.__class__.__name__, key)
ValueError: Unknown field for TranslateDocumentRequest: isTranslateNativePdfOnly
Any advice? Same issue occurs on version 3.11.2 on Python 3.11.