Package ai.nexconn.chat.params
Class TranslateTextsParams
-
- All Implemented Interfaces:
public final class TranslateTextsParamsParameters for batch text translation.
Contains a list of texts and a translation mode for batch translation requests.
Usage Example:
val params = TranslateTextsParams( listOf( TranslateTextParam("Hello, world!"), TranslateTextParam("How are you?").apply { targetLanguage = "zh" } ) ).apply { mode = TranslateMode.INTELLIGENT } NCEngine.translate.translateTexts(params) { error -> if (error == null) { } } }
-
-
Field Summary
Fields Modifier and Type Field Description private TranslateModemodeprivate final List<TranslateTextParam>list
-
Constructor Summary
Constructors Constructor Description TranslateTextsParams(List<TranslateTextParam> list)
-
Method Summary
Modifier and Type Method Description final TranslateModegetMode()Translation mode. final UnitsetMode(TranslateMode mode)Translation mode. final List<TranslateTextParam>getList()-
-
Constructor Detail
-
TranslateTextsParams
TranslateTextsParams(List<TranslateTextParam> list)
- Parameters:
list- List of text items to translate.
-
-
Method Detail
-
getMode
final TranslateMode getMode()
Translation mode.
Defaults to TranslateMode.MECHANICAL (mechanical translation).
-
setMode
final Unit setMode(TranslateMode mode)
Translation mode.
Defaults to TranslateMode.MECHANICAL (mechanical translation).
-
getList
final List<TranslateTextParam> getList()
-
-
-
-