Skip to content

Document ai.params barge interactions; condition multilingual hints on Deepgram - #990

Open
Devon-White wants to merge 2 commits into
mainfrom
devon/swml/ai-params-barge-multilingual
Open

Devon-White wants to merge 2 commits into
mainfrom
devon/swml/ai-params-barge-multilingual

Conversation

@Devon-White

@Devon-White Devon-White commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #924
Refs #925

What changed

#924: ai.params barge-in and related behavior

Edited in ai_params/index.mdx and specs/swml/calling/Methods/ai/ai_params.tsp. The regenerated SWML schema and the REST and Relay OpenAPI output are committed with them.

  • barge_match_string
    • Setting it turns transparent_barge off, even when transparent_barge: true is also set. transparent_barge now links back to it.
    • When it is combined with barge_min_words, either condition triggers barge (OR).
  • barge_min_words
    • Allowed values are 0 (off, the default) or 1-99. Any other value is ignored.
    • The schema's minValue is now 0, so the documented default validates.
  • static_greeting_no_barge
    • With true, the caller's speech is held and answered after the greeting. DTMF and interrupt_on_noise still cut the greeting.
    • With false, the greeting stops when the caller finishes speaking over it. That stop ignores barge_min_words, barge_match_string and enable_barge.
  • interrupt_on_noise
    • Triggered by about a second of sustained sound, not recognized words.
    • Ignores enable_barge, barge_min_words and barge_match_string.
    • Interrupts a static greeting even with static_greeting_no_barge.
  • double_turn_model
    • New param.
    • Takes priority over utility_model for planning.
    • An unrecognized model skips planning.
    • double_turns now states the full precedence chain.
  • tts_number_format
    • Adds generic.
    • An unrecognized value is ignored, and e164 stays.
    • Opening sentence rewritten.
  • attention_timeout
    • A nonzero value below end_of_speech_timeout is raised to end_of_speech_timeout + 1000 ms.

#925: multilingual hints

ai.multilingual always runs speech recognition in code-switching mode, so recognition hints are not used in that mode whatever the engine or provider settings. The existing wording on the multilingual and Server SDK pages already says this and is unchanged. The ai.hints description (ai/index.mdx and main.tsp) now scopes only the languages case to Deepgram: a languages entry with code: multi drops hints on Deepgram, and outside code-switching mode every engine receives hints.

Notes for reviewers

  • Multilingual: hints are dropped only on the Deepgram path; openai_asr_engine default differs from code #925 stays open (Refs, not Closes): the openai_asr_engine default is unconfirmed. ai_params/index.mdx still says deepgram:nova-3. The platform default is set per deployment, and I couldn't confirm the production value. Someone with deployment access should confirm it before the default is changed.
  • generic example is not tested live. With text normalization on (the default), longer digit strings get a second formatting pass that may fall back to E.164, so the 234 567 8901 example may not match every call.
  • barge_match_string case sensitivity is left undocumented. The match is a regular expression and case-sensitive by default. Whether inline case-insensitive flags work on the platform wasn't confirmed.
  • The attention_timeout auto-correction also emits an error event. It is left out because I didn't confirm whether customers receive it.
  • double_turn_prompt is also accepted in params and is undocumented. It is out of scope here.

…s on Deepgram

- barge_match_string turns transparent_barge off and is OR'd with barge_min_words
- barge_min_words defaults to 0 (off); values outside 1-99 are ignored
- static_greeting_no_barge: DTMF and interrupt_on_noise still interrupt; without it,
  speech over the greeting bypasses barge filters
- interrupt_on_noise ignores enable_barge and the word/match filters
- add double_turn_model, which takes priority over utility_model for planning
- tts_number_format accepts generic
- attention_timeout below end_of_speech_timeout is raised to it plus 1000 ms
- recognition hints are dropped only on Deepgram code-switching, not every multilingual engine
@Devon-White Devon-White self-assigned this Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

@Manny-r31

Copy link
Copy Markdown
Collaborator

The #924 half checks out against the source code. The barge, greeting, double_turn_model, tts_number_format, and attention_timeout claims all match. The #925 half needs another pass, because the new "Deepgram, the default engine" wording implies a multilingual setup that keeps hints, and I couldn't find one. The PR description also needs a cleanup before merge, covered under Other.

Technical

1. Multilingual mode drops hints no matter which engine settings you pick. In the referenced source code, ai.multilingual always runs code-switching on Deepgram speech recognition, and hints are dropped there whatever ai.multilingual.provider is set to. The other engines openai_asr_engine accepts aren't code-switching recognizers, and I couldn't confirm multilingual mode works on them at all. So "Deepgram, the default engine" and "Other speech recognition engines still receive them" send readers toward a configuration that won't keep hints. The old unconditional wording was accurate for multilingual mode. Suggested fixes:

  • fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx line 25. Revert to "In multilingual mode, speech recognition hints added with add_hints() or add_dynamic_hints() are not used, and no error is returned." That also puts it back in sync with the TypeScript page, so this page no longer has to wait on Cover set_multilingual in the Server SDK voice and language guide #964.
  • fern/products/server-sdks/pages/reference/{python,typescript}/agents/function-result/add-dynamic-hints.mdx line 17. Revert the Note to the original.
  • fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx line 173, multilingual column. Revert to "Not used; rewrite rules still apply".
  • fern/products/swml/pages/reference/methods/calling/ai/index.mdx lines 76-80 and specs/swml/calling/Methods/ai/main.tsp lines 94-97. The languages half is right, since code: multi on a non-Deepgram engine does keep hints. Scope only that half to Deepgram, for example: "When speech recognition runs in code-switching mode, because ai.multilingual is set or a languages entry's code is multi on Deepgram, recognition hints are not used. That covers string entries and hint values, and no error is returned. Outside code-switching mode, every engine receives hints. Rewrite rules still apply to the transcript in every mode." The current "set with Deepgram, its default engine, or a languages entry's..." also reads as a three-item list, which makes the sentence hard to parse.

With that change, #925 can probably close here, leaving only the openai_asr_engine default question you raised.

2. barge_min_words contradicts itself. ai_params/index.mdx line 335 and ai_params.tsp line 220 say "Allowed values from 1-99" and then call 0 the default. Suggest "Allowed values: 0 to turn the word count off, or 1-99. Any other value is ignored." In the .tsp, "0, the default" and the trailing "Default: 0" repeat each other, so drop one.

3. interrupt_on_noise example. ai_params/index.mdx line 347 and ai_params.tsp line 433. A cough rarely lasts the full second the threshold needs, so it's a misleading example. Suggest "so sustained sound, such as background conversation or music, can interrupt the agent."

The rest of #924 matches the source code. That covers the barge_match_string override of transparent_barge, the OR between barge_min_words and barge_match_string, both static_greeting_no_barge modes including DTMF and noise, what interrupt_on_noise ignores, the double_turn_model precedence and skip on an unknown model, generic with the e164 fallback, and the attention_timeout floor.

Style

  • params.transparent_barge at line 358 doesn't mention that setting barge_match_string turns it off, so the cross-reference only goes one way. I'd add a sentence there linking back to barge_match_string.
  • The new prose has no em dashes, and every #params... anchor you added resolves on the page.

Other

  • The PR description is public. The "Source anchors" table and parts of "Notes for reviewers" cite internal source files and line numbers, environment variable names, and deployment config paths. This repo is public, so please edit the description to keep the conclusions and drop those references.
  • Generated output is consistent. fern/apis/relay-server/relay-server.yaml is emitted from specs/relay, which imports the SWML models, the same way the REST openapi.yaml is. Its diff and the SWMLObject.json diff contain only what the two .tsp edits explain.
  • Pre-existing, not from this PR. tts_number_format still opens with "The format of the number the AI will reference the phone number", which doesn't parse. Something like "How the agent formats phone numbers when it speaks them" would fix it while you're in there.

- Multilingual mode always runs code-switching recognition, so hints are
  dropped there on every configuration. Revert the Deepgram-only wording on
  the Python set_multilingual page, both add_dynamic_hints Notes, and the
  multilingual comparison table. Scope only the `languages` `multi` case to
  Deepgram in ai.hints (MDX and main.tsp).
- barge_min_words: allowed values are 0 (off) or 1-99; drop the duplicate
  default from the prose.
- interrupt_on_noise: the example is sustained sound, not a cough.
- transparent_barge links back to barge_match_string, which turns it off.
- tts_number_format: rewrite the opening sentence.
- Regenerate SWML schema and REST/Relay OpenAPI output.
@Devon-White

Copy link
Copy Markdown
Collaborator Author

Addressed at aeac44b.

  • Multilingual hints: Agreed. Multilingual mode always runs code-switching recognition, and hints are dropped there with any provider. Reverted the Python set_multilingual page, both add_dynamic_hints Notes, and the comparison table cell. ai.hints in the MDX and main.tsp now uses your wording, with only the languages multi case scoped to Deepgram.
  • barge_min_words: 0 is valid and turns the word count off; anything outside 1-99 is ignored. Used your wording, and dropped the prose default in the .tsp (kept the **Default:** line, matching the other fields).
  • interrupt_on_noise: The threshold is about a second of continuous sound. Swapped in the sustained-sound example in both files.
  • transparent_barge: Added the back-reference to barge_match_string, and the same sentence in the .tsp.
  • tts_number_format: Opening sentence is now "How the agent formats phone numbers when it speaks them." in both files.
  • PR description: Rewritten without source anchors, environment variables, or deployment paths.

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.

ai.params reference: barge-in parameter interactions, barge_min_words default, three undocumented behaviors

2 participants