Skip to content

Commit 6b779f0

Browse files
committed
Add support for alt_translations parameter
1 parent 942b1f9 commit 6b779f0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/modernmt/modernmt.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def translate(self, source, target, q, hints=None, context_vector=None, options=
6161
data["timeout"] = options["timeout"]
6262
if "format" in options:
6363
data["format"] = options["format"]
64+
if "alt_translations" in options:
65+
data["alt_translations"] = options["alt_translations"]
6466

6567
res = self.__send("get", "/translate", data=data)
6668

@@ -222,7 +224,14 @@ def __str__(self):
222224

223225
class Translation(_Model):
224226
def __init__(self, data) -> None:
225-
super().__init__(data, ["translation", "contextVector", "characters", "billedCharacters", "detectedLanguage"])
227+
super().__init__(data, [
228+
"translation",
229+
"contextVector",
230+
"characters",
231+
"billedCharacters",
232+
"detectedLanguage",
233+
"altTranslations"
234+
])
226235

227236

228237
class Memory(_Model):

0 commit comments

Comments
 (0)