Skip to content

Server SDK voice guide: align language codes with the SWML reference - #888

Merged
Devon-White merged 4 commits into
mainfrom
devon/778-align-voice-language-guide
Oct 29, 2026
Merged

Devon-White merged 4 commits into
mainfrom
devon/778-align-voice-language-guide

Conversation

@Devon-White

@Devon-White Devon-White commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Language codes: replaces the guide's hardcoded table of about 50 codes with the pointer the SWML ai.languages reference uses. The code goes to speech recognition, which defaults to Deepgram Nova-3, so use a code from Deepgram's Nova-3 table; if you pick another engine, use a code it supports. Voice languages stay on the Voices and languages page.
  • multi:
    • It transcribes whichever supported language the caller speaks, but the agent still answers in that entry's single voice.
    • For a voice per language, the guide now points to multilingual configuration.
    • I removed the fixed 10-language list for multi and the note that speech recognition hints don't work with it.
  • Examples: the examples now use codes from the Nova-3 table (es-419, fr), not es-MX and fr-FR. The multi example now uses a multilingual ElevenLabs voice, and the overview table's code row links to the Language codes section.

The live_translate half of this ticket is in #852. Its language fields now point to speech recognition support, not only the text-to-speech voices page.

Closes signalwire/docs-legacy#778.

Notes for reviewers

  • Why no code table: the platform doesn't keep its own list of language codes. It passes the code to the speech recognition engine, Deepgram Nova-3 by default. A copied table goes stale, which is how the two pages drifted apart in the first place.
  • Removed claims: I couldn't confirm in platform behavior either the 10-language multi list or "hints don't work with multi", so both are gone.
  • Inbound links: the old #language-codes-reference anchor is renamed to #language-codes. Nothing in the docs linked to it.

Verification

  • yarn fern-md-check passes.
  • Python samples pass py_compile. I rendered them with signalwire-sdk==3.4.1 and checked the emitted codes and voices. The TypeScript sample passes tsc --strict against @signalwire/sdk@2.0.5.
  • I checked the #multi-language-support and #language-codes anchors and the ai.languages, ai.multilingual, and Voices and languages links by hand.

Preview

…ence

Replace the hardcoded language code table with the pointer the SWML
ai.languages reference uses: codes go to speech recognition, which
defaults to Deepgram Nova-3. Drop the unverified 10-language list for
`multi` and the claim that hints don't work with it, and say that
`multi` keeps one voice, pointing to multilingual configuration for a
voice per language.

Refs signalwire/docs-legacy#778.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

@Manny-r31

Copy link
Copy Markdown
Collaborator

@Devon-White Nice cleanup. Pointing at the Nova-3 table the way ai.languages does is the right call, and the new multi paragraph is much clearer about what it does and doesn't do. All three internal links resolve (/docs/swml/reference/calling/ai/multilingual, /docs/swml/reference/calling/ai/languages, /docs/platform/voice/tts), and nothing else in the docs repeats the removed 10-language list or the hints note.

A few things worth fixing before merge:

  1. The "custom fillers" example uses codes that aren't in the table the page now points to. The CustomMultilingualAgent example passes es-MX and fr-FR. Deepgram's Nova-3 table lists es / es-419 and fr / fr-CA, but not es-MX or fr-FR. Before this PR there was no reference to check them against. Now the page says "use a code from Deepgram's Nova-3 language table" and then uses two codes that aren't there. I'd switch to es-419 and fr (or fr-CA).

  2. The multi example contradicts the new advice. The prose now says to "choose a voice that can speak the languages you expect," but the example right below it still uses voice="rime.spore", and its prompt section tells the agent to "Respond naturally in whatever language they speak." It's worth either using a voice that's documented as multilingual or adding a comment on the voice line, so readers don't copy an English-only voice into a multi setup.

  3. Link to the SDK method, not just SWML. This is a Server SDK guide, and the Python SDK has set_multilingual() (/docs/server-sdks/reference/python/agents/agent-base/set-multilingual), which already links through to the SWML multilingual reference. Pointing "multilingual configuration" at the SDK method, or adding it next to the SWML link, keeps SDK readers in their own reference.

Minor: the overview table at the top still describes code as "Language code for STT". That's accurate, but you could link it to the new #language-codes section so readers find the guidance from the first place they see the parameter.

… examples

Switch es-MX and fr-FR to es-419 and fr, which are in the Nova-3 table the
page points to, across every tab of both examples. Give the multi example a
multilingual ElevenLabs voice, and link the overview's code row to the
Language codes section.
@Devon-White

Copy link
Copy Markdown
Collaborator Author

@Manny-r31 Thanks for the review. All four items are handled in 54cb32b; 0c1f84a then merged main into the branch.

  1. Custom-fillers codes: fixed in 54cb32b. Speech recognition gets the code exactly as you write it. The platform doesn't map or check it against a list, so the code has to be one the recognizer accepts. The Nova-3 table has es / es-419 and fr / fr-CA, and it doesn't have es-MX or fr-FR. CustomMultilingualAgent now uses es-419 and fr. The complete voice configuration example at the bottom of the page used es-MX too, so it now uses es-419 in the Python and TypeScript tabs, including the TypeScript functionFillers language key, and in the commented-out tabs for the other languages.

  2. multi example voice: fixed in 54cb32b. The example now uses elevenlabs.Brian:eleven_multilingual_v2. That exact string is on the ElevenLabs page, and both the ElevenLabs page and Voices and languages say the multilingual models speak whatever language the text is in. A comment on the voice line says the single voice has to speak every language the agent answers in, so a reader who swaps in another voice knows why it matters. With the pinned Python SDK, add_language turns this string into engine: elevenlabs, voice: Brian, model: eleven_multilingual_v2, and the platform accepts all three.

  3. Link to the SDK method: no change. The house rule for Server SDK prose is that it stays generic: say "the Server SDKs" and don't name or link per-language methods outside code tabs. This page covers every SDK language, and its prose doesn't link any per-language reference page. There's a practical problem with the Python-only link as well. The guides pin @signalwire/sdk@2.0.5, and that TypeScript version has no setMultilingual, so a TypeScript reader sent to the SDK method would find nothing to call. Every SDK's multilingual method writes the ai.multilingual object, and the SWML page documents that object for all of them. So the link stays on the SWML page. Both SDK reference pages for the method link back to it already.

  4. code row in the overview table: fixed in 54cb32b. The description now reads "Language code for STT. See Language codes." The anchor comes from the page's ## Language codes heading.

I didn't restore the 10-language multi list. That decision is still open separately.

Checks run

  • yarn fern-md-check passes, before and after the merge.
  • Python samples: py_compile passes on every block. I rendered the multi, custom-fillers, and complete examples with signalwire-sdk==3.4.1 and confirmed the emitted code, voice, engine, and model values.
  • TypeScript sample: tsc --strict passes against @signalwire/sdk@2.0.5.
  • I checked the #language-codes anchor by hand. No other links changed.

@Devon-White
Devon-White merged commit 9cdbf64 into main Oct 29, 2026
2 checks passed
@Devon-White
Devon-White deleted the devon/778-align-voice-language-guide branch October 29, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align multiple voice languages docs

2 participants