Skip to main content

Migrating from Truebar 2.x to 3.x

Truebar 3.x introduced pipelines: every request supplies the full sequence of stages (ASR, NLP, TTS, …) together with their parameters. This section highlights what changed from 2.x and provides concrete steps for bringing older integrations forward.

What changed#

  • No stored configuration – The /api/client/configuration endpoint is gone. Each streaming session or offline job submits its own pipeline definition.
  • Unified schema – Streaming (WebSocket) and offline (HTTP) APIs now share the same pipeline JSON structure.
  • Richer roles – Access control maps directly to stages (STAGE_ASR, STAGE_TTS, STAGE_NLP_TN, …) instead of broad β€œrecognition/synthesis” scopes.
  • Session lifecycle – Clients send an explicit EOS message to finish streaming sessions. Sessions can be resumed later by id.

Migrating offline jobs#

Old flow (2.x):

  1. PATCH /api/client/configuration – store ASR/NLP/TTS preferences on the server.
  2. POST /api/client/upload?async=true|false – upload media and rely on the stored configuration.

New flow (3.x):

  1. Build a pipeline definition locally (list of stages with tags & parameters).
  2. POST /api/pipelines/process?async=<true|false> – send the pipeline as JSON plus the binary/text payload.

Example conversion#

2.x
curl --location --request PATCH "$TRUEBAR_API_BASE_URL/api/client/configuration" \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/json" \  --data-raw '{    "stt": {      "framework": "NEMO",      "language": "sl-SI",      "domain": "COL",      "model": "20221208-0800",      "enableInterims": true    },    "nlp": {      "punctuation": {        "enabled": {          "value": true,          "enableRealFinals": true        }      }    }  }'
curl --location --request POST "$TRUEBAR_API_BASE_URL/api/client/upload?async=true" \  --header "Authorization: Bearer $TOKEN" \  --form 'file=@/path/to/audio.wav'
curl --location --request POST "$TRUEBAR_API_BASE_URL/api/pipelines/process?async=true"   --header "Authorization: Bearer $TOKEN"   --form 'pipeline=[    {      "task": "ASR",      "exceptionHandlingPolicy": "THROW",      "config": {        "tag": "NEMO_ASR:sl-SI:COL:20221208-0800",        "parameters": { "enableInterims": true }      }    },    {      "task": "NLP_pc",      "exceptionHandlingPolicy": "SKIP",      "config": {        "tag": "NEMO_PUNCTUATOR:sl-SI:*:*",        "parameters": { "enableSplitToSentences": true }      }    }  ];type=application/json'   --form 'data=@/path/to/audio.wav'

Migrating streaming clients#

Old flow (2.x):

  • Open WebSocket.
  • Stream binary audio frames.
  • Send an empty binary message to signal end-of-stream.
  • Server closed the socket automatically.

New flow (3.x):

  1. Open WebSocket with Authorization: Bearer <token> header (preferable) or ?access_token=.
  2. Wait for the first STATUS message (INITIALIZED), then send a text CONFIG message containing the pipeline.
  3. Stream audio (ASR) or TEXT_SEGMENT payloads (TTS) as before.
  4. Send {"type":"EOS","lockSession":false} to finish the session. Set lockSession:true if you intend to resume later.
  5. Read STATUS: FINISHED and close the socket from the client side.

CONFIG message structure#

{  "type": "CONFIG",  "sessionId": 12345,          // optional: resume existing session  "pipeline": [    {      "task": "ASR",      "exceptionHandlingPolicy": "THROW",      "config": {        "tag": "KALDI:sl-SI:COL:20221208-0800",        "parameters": { "enableInterims": true }      }    }  ]}

Message types to handle#

  • STATUS – INITIALIZED, CONFIGURED, FINISHED, plus warnings and errors.
  • TEXT_SEGMENT – transcripts (STT) or acknowledgement of processed text (TTS).
  • ERROR – terminal condition; log the payload and reconnect with a new session.
  • WARNING – non-critical issues (e.g., nearing quotas).

Role mapping#

2.x concept3.x equivalent
RECOGNITIONSTAGE_ASR + PIPELINE_ONLINE_API / PIPELINE_OFFLINE_API
SYNTHESISSTAGE_TTS (+ relevant STAGE_NLP_* for multi-stage voices)
HISTORYsame endpoint, but permissions tied to the session owner and group

Grant the narrowest set of roles needed for each service account to reduce blast radius.

Tips for a smooth upgrade#

  • Centralise pipeline builders – wrap pipeline JSON generation in helper functions so multiple microservices reuse the same definitions.
  • Log sessionId – retain the ID returned by streaming sessions; it lets you look up diagnostics later via the History API.
  • Validate stage availability – call /api/pipelines/stages at startup to ensure required tags exist in the current tenant.
  • Monitor errors – capture the id and message from error responses to accelerate support requests.

See also#