Releases: intento/intento-nodejs
Releases · intento/intento-nodejs
support `provider_parameters` option
- add provider_parameters param d7ca7b3
v1.0.2
V1.0.1
- Fixed bug then using POST /ai/text/translate request. Promise will resolve beyond the number of times that code calls API
- More options to run server-side examples
- Language detect examples
- Custom models support example
- Bump minimist from 1.2.2 to 1.2.3 in /samples/cli
v1.0.0
Translate via async now is a default behavior.
The default response format differs now
client.ai.text.translate
.fulfill({ text: "How's it going?", to: 'es' })
.then(console.log)
The response contains the translated text, service information, and meta-information (i.e., detected language):
{
"id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"done": true,
"response": [
{
"results": [
"¿Cómo va todo?"
],
"meta": {
"detected_source_language": [
"en"
]
},
"service": {
"provider": {
"id": "ai.text.translate.deepl.api",
"name": "DeepL API",
"vendor": "DeepL",
"description": "API",
"logo": "https://inten.to/static/img/api/deepl_translate.png"
}
}
}
],
"meta": {
// information about initial request
},
"error": null
}
To get the old behavior set async: false
client.ai.text.translate
.fulfill({ text: "How's it going?", to: 'es' , async: false })
.then(console.log)
{
"results": [
"¿Cómo va todo?"
],
"meta": {
"detected_source_language": [
"en"
],
"timing": {
"total": 0.391781,
"providers": 0.356072
},
"routing": {
"id": "best"
}
},
"service": {
"provider": {
"id": "ai.text.translate.deepl.api",
"name": "DeepL API",
"timing": {
"provider": 0.356072
}
}
}
}
To use async mode but get the operation id set awaitAsync: false
client.ai.text.translate
.fulfill({ text: "How's it going?", to: 'es' , awaitAsync: false })
.then(console.log)
{
"id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}
v0.10.0
v0.7.0
v0.6.0
v0.5.0
v0.4.2
[BROKEN] v0.4.1
Don't use it