Skip to main content

Translation

Translation schemas manage real-time language translation sessions between participants speaking different languages. Enables cross-language communication through speech-to-text transcription, translation, and text-to-speech synthesis.

Source: src/core/conversation/translation-config.schema.ts, src/core/conversation/translation-conversation.schema.ts


TranslationServiceLogโ€‹

Complete record of a translation session including participant information, session metadata, message history, and operational status.

Schema: TranslationServiceLogSchema

Attributesโ€‹

AttributeTypeRequiredDefaultDescription
idstringโ€”โ€”Unique identifier for the translation session
organization_idstringYesโ€”ID of the organization requesting translation
partner_initiator_idstringYesโ€”Initiator identifier from external systems
statusenumNoACTIVECurrent session status. One of ACTIVE, COMPLETED, FAILED, or ABANDONED.
directionenumNoBIDIRECTIONALTranslation direction mode. One of BIDIRECTIONAL or UNIDIRECTIONAL.
project_idstringNoโ€”Associated project ID
partner_session_idstringNoโ€”External session ID for tracking
sdrtn_idstringNoโ€”WebRTC session identifier
translationConfigIdstring | nullNoโ€”Translation configuration chain ID
participantsarray<string>Noโ€”Array of participant IDs
durationInSecondsnumberNo60Session duration in seconds
transcribedConversationLogarrayNoโ€”Array of translation messages
logTranscriptionInParticipantRecordsbooleanNofalseStore messages per-participant
translationSummarystringNoโ€”AI-generated session summary
created_daystringNoโ€”Creation day in YYYY-MM-DD format
createdAtnumberโ€”โ€”Unix timestamp when created
updatedAtnumberโ€”โ€”Unix timestamp when last updated

TranslationParticipantโ€‹

Represents an individual participant in a translation session including their language preferences, authentication credentials, and role.

Schema: TranslationParticipantSchema

Attributesโ€‹

AttributeTypeRequiredDefaultDescription
idstringโ€”โ€”Unique identifier for the participant
nativeLanguagestringYesโ€”ISO 639-1 language code (2-5 chars)
participantAccessIdnumberYesโ€”Numeric ID for WebRTC authentication
participantTokenstringYesโ€”Short-lived authentication token
translationServiceLogIdstringNoโ€”ID of the parent translation session
partnerParticipantRecordIdstringNoโ€”External participant record ID
namestringNoโ€”Human-readable participant name
isAnchorbooleanNofalseWhether this is the session initiator
transcriptionsarrayNoโ€”Participant's translation messages
participantTranscribedLogsarrayNoโ€”Full conversation messages for audit
createdAtnumberโ€”โ€”Unix timestamp when created
updatedAtnumberโ€”โ€”Unix timestamp when last updated

TranslationMessageโ€‹

Individual translation message capturing the complete translation pipeline from speaker's original speech to translated output.

Schema: TranslationMessageSchema

Attributesโ€‹

AttributeTypeRequiredDescription
messageIdstringYesUnique identifier for this message
speakerParticipantIdstringYesID of the participant who spoke
targetParticipantIdstringYesID of the participant receiving translation
originalLanguageLanguageCodeYesISO 639-1 code of original language
targetLanguageLanguageCodeYesISO 639-1 code of target language
provisioningConfigIdstringYesID of the translation processing chain
timestampnumberYesUnix timestamp when processed
originalTextstringNoTranscribed text in original language
translatedTextstringNoTranslated text in target language
metadataobjectNoAdditional metadata (audio URLs, confidence)

TranslationServiceRequestโ€‹

Request payload for initiating a real-time translation session.

Schema: TranslationServiceRequestSchema

Attributesโ€‹

AttributeTypeRequiredDescription
idstringโ€”Unique identifier
initiator_idstringYesInitiator participant identifier
initiator_language_codeLanguageCodeYesInitiator's native language
participant_language_codeLanguageCodeYesOther participant's native language
session_idstring | nullNoOptional session ID for grouping
translation_config_idstring | nullNoTranslation configuration to use
createdAtnumberโ€”Unix timestamp when created
updatedAtnumberโ€”Unix timestamp when last updated

TranslationConversationConfigโ€‹

Configuration returned when a translation session is successfully initiated.

Schema: TranslationConversationConfigSchema

Attributesโ€‹

AttributeTypeRequiredDescription
channel_identifierstringYesCommunication channel identifier
initiator_access_idstringYesInitiator's WebRTC access ID
initiator_tokenstringYesInitiator's authentication token
participant_access_idstringYesParticipant's WebRTC access ID
participant_tokenstringYesParticipant's authentication token
sdrtn_idstring | nullNoWebRTC session identifier

Exampleโ€‹

Translation Service Logโ€‹

{
"id": "trans_abc123",
"organization_id": "org_xyz",
"project_id": "proj_456",
"partner_initiator_id": "customer_789",
"status": "COMPLETED",
"direction": "BIDIRECTIONAL",
"participants": ["part_001", "part_002"],
"durationInSeconds": 300,
"transcribedConversationLog": [
{
"messageId": "msg_001",
"speakerParticipantId": "part_001",
"targetParticipantId": "part_002",
"originalText": "Hello, how can I help you today?",
"translatedText": "Hola, ยฟcรณmo puedo ayudarte hoy?",
"originalLanguage": "en-US",
"targetLanguage": "es-MX",
"provisioningConfigId": "prov_trans_001",
"timestamp": 1709856000000
}
],
"createdAt": 1709856000000,
"updatedAt": 1709856300000
}

Translation Participantโ€‹

{
"id": "part_001",
"translationServiceLogId": "trans_abc123",
"name": "Support Agent",
"isAnchor": false,
"nativeLanguage": "en-US",
"participantAccessId": 12345,
"participantToken": "eyJhbG...",
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}

Translation Service Requestโ€‹

{
"initiator_id": "customer_789",
"initiator_language_code": "es-MX",
"participant_language_code": "en-US",
"session_id": "session_abc",
"translation_config_id": "config_trans_001"
}

Translation Flowโ€‹

  1. Client submits TranslationServiceRequest with participant details
  2. System creates TranslationServiceLog and TranslationParticipant records
  3. Returns TranslationConversationConfig with WebRTC credentials
  4. Real-time translation begins with bidirectional audio streaming
  5. Each utterance creates a TranslationMessage:
    • Speaker audio โ†’ STT (originalText)
    • Translation model (translatedText)
    • TTS โ†’ Target participant

Create / Update Schemasโ€‹

SchemaDescriptionOmits
CreateTranslationServiceRequestSchemaFor initiating translation requestsid, createdAt, updatedAt
CreateTranslationParticipantSchemaFor creating participantsid, createdAt, updatedAt
UpdateTranslationParticipantSchemaFor partial participant updatesAll optional except id
CreateTranslationServiceLogSchemaFor creating translation logsid, createdAt, updatedAt
UpdateTranslationServiceLogSchemaFor partial log updatesAll optional except id