Skip to content

Commit e13b8dd

Browse files
daniel-jones-devJanEbbing
authored andcommitted
fix[CLI]: always include model_type in API request for show-model-type-used option, to include model_type_used in response
1 parent dde2384 commit e13b8dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

deepl/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def action_text(
8383
**kwargs,
8484
):
8585
"""Action function for the text command."""
86+
87+
if show_model_type_used and kwargs.get("model_type") is None:
88+
# specify model_type so API includes model_type_used response parameter
89+
kwargs["model_type"] = deepl.ModelType.LATENCY_OPTIMIZED
90+
8691
translation = translator.translate_text(**kwargs)
8792
output_list = (
8893
translation if isinstance(translation, List) else [translation]

0 commit comments

Comments
 (0)