You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* improve tests for translate with default async
* new response format for translate requests in readme
* translate example responses
* upgrade dependencies
By default, when the provider is missing, requests are routed to a provider with the best expected price/performance ratio. This behavior may be controlled by specifying the desired routing strategy in the `routing` parameter. To set up routing for your account contact us at hello@inten.to.
249
-
250
-
```js
251
-
client.ai.text.translate
252
-
.fulfill({
253
-
text:'A sample text',
254
-
to:'es',
255
-
routing:'best-quality',
256
-
})
257
-
.then(console.log)
258
-
```
259
-
260
-
### Async mode
261
-
262
-
If the server responded with a status of 413 (Request Entity Too Large), then the request data is too large for the synchronous processing. In this case, you should switch to the asynchronous mode by adding `async: true` to the parameters. The current approach to handling the oversized requests [is described in a separate document](https://github.com/intento/intento-api/blob/master/processing-oversized-requests.md).
Add `awaitDelay` (number in milliseconds) to parameters to change how often results are requested. It does not speed up the process.
407
-
Default value is `1000`.
262
+
By default, when the provider is missing, requests are routed to a provider with the best expected price/performance ratio. This behavior may be controlled by specifying the desired routing strategy in the `routing` parameter. To set up routing for your account contact us at hello@inten.to.
408
263
409
264
```js
410
265
client.ai.text.translate
411
266
.fulfill({
412
-
text:"How's it going?",
267
+
text:'A sample text',
413
268
to:'es',
414
-
async:true,
415
-
awaitAsync:true,
416
-
awaitDelay:500
417
-
})
418
-
.then(res=> {
419
-
console.log(JSON.stringify(res, null, 4))
269
+
routing:'best-quality',
420
270
})
271
+
.then(console.log)
421
272
```
422
273
423
274
## Failover mode
@@ -452,7 +303,7 @@ In the tech proxy mode, the custom credentials are passed in the `auth` service
452
303
453
304
```js
454
305
client.ai.text.translate
455
-
.fullfill({
306
+
.fulfill({
456
307
text:"A sample text",
457
308
to:'es',
458
309
provider:'some-provider-id',
@@ -482,7 +333,7 @@ For example for google translate custom auth structure is `{ key: YOUR_GOOGLE_KE
0 commit comments