List available translation models
curl --request GET \
--url http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/modelsimport requests
url = "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models")
.asString();require 'uri'
require 'net/http'
url = URI("http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"name": "opus-en-zh",
"display_name": "English to Chinese",
"version": "1.0.0",
"description": "Translation from English to Chinese using Opus",
"source_language": {
"code": "en",
"name": "English"
},
"target_language": {
"code": "zh",
"name": "Chinese"
},
"capabilities": {
"batch_translation": true,
"language_detection": true,
"formality_control": true
},
"parameters": {
"max_text_length": 123,
"max_batch_size": 123
}
}
]{
"error": {
"message": "Invalid request, missing 'file' parameter",
"type": "invalid_request_error",
"param": "file",
"code": null
}
}List available translation models
Returns available translation models with supported language pairs and parameters.
GET
/
translations
/
models
List available translation models
curl --request GET \
--url http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/modelsimport requests
url = "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models")
.asString();require 'uri'
require 'net/http'
url = URI("http://{device-ip}:{device-port}/audio-analytics/v1/api/translations/models")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"name": "opus-en-zh",
"display_name": "English to Chinese",
"version": "1.0.0",
"description": "Translation from English to Chinese using Opus",
"source_language": {
"code": "en",
"name": "English"
},
"target_language": {
"code": "zh",
"name": "Chinese"
},
"capabilities": {
"batch_translation": true,
"language_detection": true,
"formality_control": true
},
"parameters": {
"max_text_length": 123,
"max_batch_size": 123
}
}
]{
"error": {
"message": "Invalid request, missing 'file' parameter",
"type": "invalid_request_error",
"param": "file",
"code": null
}
}Response
List of available translation models
Unique model identifier
Example:
"opus-en-zh"
Human-readable model name
Example:
"English to Chinese"
Model version
Example:
"1.0.0"
Model description
Example:
"Translation from English to Chinese using Opus"
Source language information
Show child attributes
Show child attributes
Target language information
Show child attributes
Show child attributes
Model capabilities
Show child attributes
Show child attributes
Model parameters and constraints
Show child attributes
Show child attributes
Was this page helpful?
⌘I

