Translation
Translate user message or conversation to a target language
/service/translation
Translate user message or chat
Rest
POST /service/translation
Input query parameters
role
required
Predefined role used to run the AI service
message
required
Required if chat parameters is missing. User message
chat
required
Required if message parameters is missing. Full chat or conversation
language
required
Language in ISO-639 format to translate into
Example of chat assist message:
curl https://{{ tenant }}.lightenup.ai/service/translation\
--request POST \
--header "Authorization: Bearer xyz" \
--header "Content-Type: application/json" \
--data @- << EOF
{
"role": "order_management_assistant",
"message": "How can I buy tickets for the next fc barcelona game?",
"language": "en-US",
}
EOF
Outputs
Response Code
200
This API returns an array of Policies in JSON format:
role
The role used to translate the message or conversation
message
The original message to be summarized. If any,
name
The original message to be summarized. If any,
language
Target translation language in ISO-639 format
output
The response from the AI service following the JSON format:
"{
"results": [ {
service":"translation",
"message":"message translated"
}]
}"
"{
"results": [ {
service":"translation",
"message":"message translated"
}]
}"
Response example:
{
"action": "message",
"service": "translation",
"state": "completed",
"connectionId": "T1lsTcMtIAMCLgQ=",
"messageId": "T1lsqcNHIAMCLgQ=",
"statusCode": "200",
"message": "{\"results\":[{\"service\":\"transalation\",\"message\":\"message translated\"}]}"
}
Response Code
400
Error message in JSON format:
message
Error message
Response exdmple:
{
"message": "Missing parameters",
}
Response Code
500
Error message in JSON format:
message
Error message
Response exdmple:
{
"message": "Internal server error",
}