New tag_handling_version parameter not supported
The DeepL API now supports the tag_handling_version parameter. However, this parameter is not yet supported by this package.
Sorry we have not documented this well yet (in progress). You can use it as follows:
import deepl
auth_key = "f63c02c5-f056-..." # Replace with your key
deepl_client = deepl.DeepLClient(auth_key)
deepl_client.translate_text("<div>How are you?</div>", target_lang="DE", tag_handling="xml", model_type="quality_optimized", extra_body_parameters={"tag_handling_version": "v2"})
This might not be a permanent parameter in our API, so I'm hesitant to add it to our client libraries.
Thank you for the clarification. Is your hesitation because the improved tag handling might become default in the future, making this version setting obsolete?
Yes exactly, that is our intention.
Perfect. For now I'm going to use the extra_body_parameters method, since I see some weird behavior on line breaks when using the default tag handler.