From 68cbbd898622b642e40341c736d318aab2238618 Mon Sep 17 00:00:00 2001 From: Devon-White Date: Mon, 23 Nov 2026 11:24:51 -0500 Subject: [PATCH 1/2] Document ai.params barge interactions and condition multilingual hints 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 --- fern/apis/relay-server/relay-server.yaml | 108 ++++++++++++++---- fern/apis/signalwire-rest/openapi.yaml | 54 +++++++-- .../agents/agent-base/set-multilingual.mdx | 5 +- .../function-result/add-dynamic-hints.mdx | 4 +- .../function-result/add-dynamic-hints.mdx | 4 +- .../methods/calling/ai/ai_params/index.mdx | 23 +++- .../reference/methods/calling/ai/index.mdx | 9 +- .../methods/calling/ai/multilingual/index.mdx | 2 +- specs/swml/calling/Methods/ai/ai_params.tsp | 55 +++++++-- specs/swml/calling/Methods/ai/main.tsp | 7 +- .../@typespec/json-schema/SWMLObject.json | 30 +++-- 11 files changed, 229 insertions(+), 72 deletions(-) diff --git a/fern/apis/relay-server/relay-server.yaml b/fern/apis/relay-server/relay-server.yaml index b78b473bf6..b728f96377 100644 --- a/fern/apis/relay-server/relay-server.yaml +++ b/fern/apis/relay-server/relay-server.yaml @@ -17042,9 +17042,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When speech recognition - runs in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on - Deepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error is returned. + One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition + runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. Rewrite rules still apply to the transcript in every mode. examples: - - pizza @@ -17131,7 +17132,9 @@ components: - type: integer enum: - 0 - description: "Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. **Default:** `5000` ms." + description: |- + Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. + A nonzero value lower than `end_of_speech_timeout` is raised to `end_of_speech_timeout` plus 1,000 ms. **Default:** `5000` ms. examples: - 30000 attention_timeout_prompt: @@ -17206,11 +17209,20 @@ components: Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is - `utility_model` if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. - To cover the wait, set `double_turn_fillers` on each entry in `languages`. + `double_turn_model` if set, otherwise `utility_model` if set, otherwise `ai_model`. Billed separately + from the agent's per-minute rate. To cover the wait, set `double_turn_fillers` on each entry in `languages`. default: false examples: - true + double_turn_model: + type: string + description: |- + The model that plans each reply when `double_turns` is enabled. It takes priority over `utility_model` + for planning, so you can plan with one model and run background tasks with another. If the model isn't + recognized, the planning step is skipped and the agent replies without a plan. Has no effect unless + `double_turns` is `true`. + examples: + - gpt-4.1-mini enable_inner_dialog: type: boolean description: |- @@ -17267,13 +17279,21 @@ components: description: |- Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word 'hippopotamus' is input. + Setting this param turns off `transparent_barge`, even when `transparent_barge` is set to `true`. + When `barge_min_words` is also set, either condition is enough: the caller interrupts the agent by + saying at least that many words or by saying something that matches this string. examples: - Cancel order barge_min_words: type: integer - description: Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - minimum: 1 + description: |- + Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + When `barge_match_string` is also set, either condition is enough to interrupt the agent. + **Default:** `0`. + minimum: 0 maximum: 99 + default: 0 examples: - 3 barge_functions: @@ -17543,7 +17563,11 @@ components: - 2000 interrupt_on_noise: type: boolean - description: When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. **Default:** `false`. + description: |- + When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. + The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static + greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: - true interrupt_prompt: @@ -17692,7 +17716,12 @@ components: - Hello! Welcome to our customer service. How can I help you today? static_greeting_no_barge: type: boolean - description: If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + description: |- + If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + With `true`, what the caller says during the greeting is kept and answered after the greeting finishes. + A DTMF key press still interrupts the greeting, and so does `interrupt_on_noise`. + With `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores + `barge_min_words`, `barge_match_string`, and `enable_barge`, which apply only after the greeting. default: false examples: - true @@ -17887,15 +17916,18 @@ components: - e164 - international - national + - generic description: |- The format for the AI agent to reference phone numbers. - Allowed values are `e164`, `international`, and `national`. + Allowed values are `e164`, `international`, `national`, and `generic`. + An unrecognized value is ignored and `e164` is used. **Default:** `e164`. **Example:** - `e164`: `+12345678901` - `international`: `+1 234-567-8901` - `national`: `(234) 567-8901` + - `generic`: `234 567 8901` default: e164 examples: - national @@ -21552,9 +21584,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When speech recognition - runs in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on - Deepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error is returned. + One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition + runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. Rewrite rules still apply to the transcript in every mode. examples: - - pizza @@ -21641,7 +21674,9 @@ components: - type: integer enum: - 0 - description: "Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. **Default:** `5000` ms." + description: |- + Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. + A nonzero value lower than `end_of_speech_timeout` is raised to `end_of_speech_timeout` plus 1,000 ms. **Default:** `5000` ms. examples: - 30000 attention_timeout_prompt: @@ -21716,11 +21751,20 @@ components: Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is - `utility_model` if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. - To cover the wait, set `double_turn_fillers` on each entry in `languages`. + `double_turn_model` if set, otherwise `utility_model` if set, otherwise `ai_model`. Billed separately + from the agent's per-minute rate. To cover the wait, set `double_turn_fillers` on each entry in `languages`. default: false examples: - true + double_turn_model: + type: string + description: |- + The model that plans each reply when `double_turns` is enabled. It takes priority over `utility_model` + for planning, so you can plan with one model and run background tasks with another. If the model isn't + recognized, the planning step is skipped and the agent replies without a plan. Has no effect unless + `double_turns` is `true`. + examples: + - gpt-4.1-mini enable_inner_dialog: type: boolean description: |- @@ -21777,13 +21821,21 @@ components: description: |- Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word 'hippopotamus' is input. + Setting this param turns off `transparent_barge`, even when `transparent_barge` is set to `true`. + When `barge_min_words` is also set, either condition is enough: the caller interrupts the agent by + saying at least that many words or by saying something that matches this string. examples: - Cancel order barge_min_words: type: integer - description: Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - minimum: 1 + description: |- + Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + When `barge_match_string` is also set, either condition is enough to interrupt the agent. + **Default:** `0`. + minimum: 0 maximum: 99 + default: 0 examples: - 3 barge_functions: @@ -22053,7 +22105,11 @@ components: - 2000 interrupt_on_noise: type: boolean - description: When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. **Default:** `false`. + description: |- + When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. + The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static + greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: - true interrupt_prompt: @@ -22202,7 +22258,12 @@ components: - Hello! Welcome to our customer service. How can I help you today? static_greeting_no_barge: type: boolean - description: If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + description: |- + If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + With `true`, what the caller says during the greeting is kept and answered after the greeting finishes. + A DTMF key press still interrupts the greeting, and so does `interrupt_on_noise`. + With `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores + `barge_min_words`, `barge_match_string`, and `enable_barge`, which apply only after the greeting. default: false examples: - true @@ -22397,15 +22458,18 @@ components: - e164 - international - national + - generic description: |- The format for the AI agent to reference phone numbers. - Allowed values are `e164`, `international`, and `national`. + Allowed values are `e164`, `international`, `national`, and `generic`. + An unrecognized value is ignored and `e164` is used. **Default:** `e164`. **Example:** - `e164`: `+12345678901` - `international`: `+1 234-567-8901` - `national`: `(234) 567-8901` + - `generic`: `234 567 8901` default: e164 examples: - national diff --git a/fern/apis/signalwire-rest/openapi.yaml b/fern/apis/signalwire-rest/openapi.yaml index 3779812695..c94906b2eb 100644 --- a/fern/apis/signalwire-rest/openapi.yaml +++ b/fern/apis/signalwire-rest/openapi.yaml @@ -39463,9 +39463,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When speech recognition - runs in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on - Deepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error is returned. + One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition + runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. Rewrite rules still apply to the transcript in every mode. examples: - - pizza @@ -39597,7 +39598,9 @@ components: - type: number enum: - 0 - description: 'Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. **Default:** `5000` ms.' + description: |- + Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. + A nonzero value lower than `end_of_speech_timeout` is raised to `end_of_speech_timeout` plus 1,000 ms. **Default:** `5000` ms. examples: - 30000 attention_timeout_prompt: @@ -39672,11 +39675,20 @@ components: Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is - `utility_model` if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. - To cover the wait, set `double_turn_fillers` on each entry in `languages`. + `double_turn_model` if set, otherwise `utility_model` if set, otherwise `ai_model`. Billed separately + from the agent's per-minute rate. To cover the wait, set `double_turn_fillers` on each entry in `languages`. examples: - true default: false + double_turn_model: + type: string + description: |- + The model that plans each reply when `double_turns` is enabled. It takes priority over `utility_model` + for planning, so you can plan with one model and run background tasks with another. If the model isn't + recognized, the planning step is skipped and the agent replies without a plan. Has no effect unless + `double_turns` is `true`. + examples: + - gpt-4.1-mini enable_inner_dialog: type: boolean description: |- @@ -39727,15 +39739,23 @@ components: description: |- Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word 'hippopotamus' is input. + Setting this param turns off `transparent_barge`, even when `transparent_barge` is set to `true`. + When `barge_min_words` is also set, either condition is enough: the caller interrupts the agent by + saying at least that many words or by saying something that matches this string. examples: - Cancel order barge_min_words: type: integer - minimum: 1 + minimum: 0 maximum: 99 - description: Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + description: |- + Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + When `barge_match_string` is also set, either condition is enough to interrupt the agent. + **Default:** `0`. examples: - 3 + default: 0 barge_functions: type: boolean description: If `true`, allows functions to be executed while the AI is being interrupted. **Default:** `false`. @@ -39995,7 +40015,11 @@ components: default: 2000 interrupt_on_noise: type: boolean - description: When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. **Default:** `false`. + description: |- + When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. + The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static + greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: - true interrupt_prompt: @@ -40144,7 +40168,12 @@ components: - Hello! Welcome to our customer service. How can I help you today? static_greeting_no_barge: type: boolean - description: If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + description: |- + If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + With `true`, what the caller says during the greeting is kept and answered after the greeting finishes. + A DTMF key press still interrupts the greeting, and so does `interrupt_on_noise`. + With `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores + `barge_min_words`, `barge_match_string`, and `enable_barge`, which apply only after the greeting. examples: - true default: false @@ -40331,15 +40360,18 @@ components: - 'e164' - international - national + - generic description: |- The format for the AI agent to reference phone numbers. - Allowed values are `e164`, `international`, and `national`. + Allowed values are `e164`, `international`, `national`, and `generic`. + An unrecognized value is ignored and `e164` is used. **Default:** `e164`. **Example:** - `e164`: `+12345678901` - `international`: `+1 234-567-8901` - `national`: `(234) 567-8901` + - `generic`: `234 567 8901` examples: - national default: 'e164' diff --git a/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx b/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx index 74fbfe9d69..40634f0204 100644 --- a/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx +++ b/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx @@ -22,8 +22,9 @@ This is mutually exclusive with [`set_languages()`][set-languages] and [`add_language()`][add-language]. If both are set, the platform uses `multilingual` and ignores `languages`. -In multilingual mode, speech recognition hints added with [`add_hints()`][add-hints] or -[`add_dynamic_hints()`][add-dynamic-hints] are not used, and no error is returned. +When multilingual mode runs on Deepgram speech recognition, the default engine, hints added with +[`add_hints()`][add-hints] or [`add_dynamic_hints()`][add-dynamic-hints] are not used, and no error +is returned. Other speech recognition engines still receive them. Pattern hints from [`add_pattern_hint()`][add-pattern-hint] still rewrite what the agent hears. ## Parameters diff --git a/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx b/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx index b628d55d82..18e093e0a6 100644 --- a/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx +++ b/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx @@ -14,8 +14,8 @@ hint can be a simple string or a pronunciation pattern object that maps misrecognized speech to the correct text. -When the agent runs in multilingual mode ([`set_multilingual()`][set-multilingual]), string hints -are not passed to speech recognition. Pattern objects still rewrite the transcript. +When the agent runs in multilingual mode ([`set_multilingual()`][set-multilingual]) on Deepgram +speech recognition, the default engine, string hints are not passed to speech recognition. Pattern objects still rewrite the transcript. ## **Parameters** diff --git a/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx b/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx index 72990e5306..3956178d4d 100644 --- a/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx +++ b/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx @@ -14,8 +14,8 @@ hint can be a simple string or a pronunciation pattern object that maps misrecognized speech to the correct text. -When the agent runs in multilingual mode ([`setMultilingual()`][set-multilingual]), string hints -are not passed to speech recognition. Pattern objects still rewrite the transcript. +When the agent runs in multilingual mode ([`setMultilingual()`][set-multilingual]) on Deepgram +speech recognition, the default engine, string hints are not passed to speech recognition. Pattern objects still rewrite the transcript. ## **Parameters** diff --git a/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx index 1a9d19e759..c948de0bb4 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx @@ -90,7 +90,12 @@ These parameters control the fundamental behavior and capabilities of the AI age - Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is [`utility_model`](#paramsutility_model) if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. To cover the wait, set [`double_turn_fillers`](/docs/swml/reference/calling/ai/languages#languagesdouble_turn_fillers) on each entry in `languages`. + Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is [`double_turn_model`](#paramsdouble_turn_model) if set, otherwise [`utility_model`](#paramsutility_model) if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. To cover the wait, set [`double_turn_fillers`](/docs/swml/reference/calling/ai/languages#languagesdouble_turn_fillers) on each entry in `languages`. + + + + + The model that plans each reply when [`double_turns`](#paramsdouble_turns) is enabled. It takes priority over [`utility_model`](#paramsutility_model) for planning, so you can plan with one model and run background tasks with another. If the model isn't recognized, the planning step is skipped and the agent replies without a plan. Has no effect unless `double_turns` is `true`. @@ -270,7 +275,7 @@ Customize the AI agent's voice output, including volume control, voice character - The format of the number the AI will reference the phone number. Valid values: `e164` (e.g. +12345678901), `international` (e.g. +1 234-567-8901), or `national` (e.g. (234) 567-8901). + The format of the number the AI will reference the phone number. Valid values: `e164` (e.g. +12345678901), `international` (e.g. +1 234-567-8901), `national` (e.g. (234) 567-8901), or `generic` (e.g. 234 567 8901). An unrecognized value is ignored and `e164` is used. @@ -321,11 +326,13 @@ Manage how the AI agent handles interruptions when users speak over it, includin Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word "hippopotamus" is input. + + Setting this param turns off [`transparent_barge`](#paramstransparent_barge), even when `transparent_barge` is set to `true`. When [`barge_min_words`](#paramsbarge_min_words) is also set, either condition is enough: the caller interrupts the agent by saying at least that many words or by saying something that matches this string. - - Defines the number of words that must be input before triggering barge behavior. Allowed values from `1`-`99`. + + Defines the number of words that must be input before triggering barge behavior. Allowed values from `1`-`99`. `0`, the default, turns the word count off, and any value outside `1`-`99` is ignored. When [`barge_match_string`](#paramsbarge_match_string) is also set, either condition is enough to interrupt the agent. @@ -336,6 +343,8 @@ Manage how the AI agent handles interruptions when users speak over it, includin When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. + + The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. This interruption ignores [`enable_barge`](#paramsenable_barge), [`barge_min_words`](#paramsbarge_min_words), and [`barge_match_string`](#paramsbarge_match_string), and it interrupts a static greeting even when [`static_greeting_no_barge`](#paramsstatic_greeting_no_barge) is `true`. @@ -361,7 +370,7 @@ Manage how the AI agent handles interruptions when users speak over it, includin Set various timing parameters that control wait times, response delays, and session limits to optimize the conversation flow and prevent dead air. - Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000`-`600,000`. + Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000`-`600,000`. A nonzero value lower than [`end_of_speech_timeout`](#paramsend_of_speech_timeout) is raised to `end_of_speech_timeout` plus 1,000 ms. @@ -451,6 +460,10 @@ Control background audio, hold music, and greeting messages to enhance the calle If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + + With `true`, what the caller says during the greeting is kept and answered after the greeting finishes. A DTMF key press still interrupts the greeting, and so does [`interrupt_on_noise`](#paramsinterrupt_on_noise). + + With `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores [`barge_min_words`](#paramsbarge_min_words), [`barge_match_string`](#paramsbarge_match_string), and [`enable_barge`](#paramsenable_barge), which apply only after the greeting. diff --git a/fern/products/swml/pages/reference/methods/calling/ai/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/index.mdx index 25be041f7a..8327531088 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/index.mdx @@ -73,10 +73,11 @@ it is recommended to read the [prompt engineering][prompt-engineering] guide. **Hints as objects:** Each object is a recognition hint (`hint`), a rewrite rule applied to the text the agent hears before the AI reads it (`pattern` with `replace`), or both. - One hint list covers every language the agent uses; there are no per-language hints. When speech recognition - runs in code-switching mode, because [`ai.multilingual`][multilingual] is set or a [`languages`][languages] entry's - `code` is `multi` on Deepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error - is returned. Rewrite rules still apply to the transcript in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition + runs in code-switching mode, because [`ai.multilingual`][multilingual] is set with Deepgram, its default engine, or a + [`languages`][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. Other speech recognition engines receive hints in every mode. + Rewrite rules still apply to the transcript in every mode. diff --git a/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx index cc5db0a702..461e7613a5 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx @@ -170,7 +170,7 @@ Both configure voices, but the shape and the behavior differ: | Entry key | `code`, plus a human-readable `name` | `language`, or `default` for the catch-all | | Catch-all entry | None | The `default` entry, or the first listed language | | ASR configuration | [`params.openai_asr_engine`][openai-asr-engine] | `engine`, `model`, and `provider` on this object | -| Recognition hints from [`ai.hints`][ai-hints] | Used, except in code-switching mode (`multi` on Deepgram) | Not used; rewrite rules still apply | +| Recognition hints from [`ai.hints`][ai-hints] | Used, except in code-switching mode (`multi` on Deepgram) | Not used on Deepgram, the default engine; rewrite rules still apply | The two `languages` arrays are not interchangeable. An `ai.multilingual.languages` entry is flat — `language` and `voice`, plus an optional `model` and `params` — and takes no `name`, diff --git a/specs/swml/calling/Methods/ai/ai_params.tsp b/specs/swml/calling/Methods/ai/ai_params.tsp index 42a985ec04..c1eab9d9d2 100644 --- a/specs/swml/calling/Methods/ai/ai_params.tsp +++ b/specs/swml/calling/Methods/ai/ai_params.tsp @@ -90,7 +90,10 @@ model AIParams { @example(true) asr_smart_format?: boolean; - @doc("Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. **Default:** `5000` ms.") + @doc(""" + Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. + A nonzero value lower than `end_of_speech_timeout` is raised to `end_of_speech_timeout` plus 1,000 ms. **Default:** `5000` ms. + """) @example(30000) attention_timeout?: AttentionTimeout | 0; @@ -148,12 +151,21 @@ model AIParams { Before each reply, a smaller planning model reviews the conversation and the available functions, then gives the agent a short directive on how to respond. This can improve function use and coherence. The reply waits for the plan, which adds latency to every turn. The planning model is - `utility_model` if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate. - To cover the wait, set `double_turn_fillers` on each entry in `languages`. + `double_turn_model` if set, otherwise `utility_model` if set, otherwise `ai_model`. Billed separately + from the agent's per-minute rate. To cover the wait, set `double_turn_fillers` on each entry in `languages`. """) @example(true) double_turns?: boolean = false; + @doc(""" + The model that plans each reply when `double_turns` is enabled. It takes priority over `utility_model` + for planning, so you can plan with one model and run background tasks with another. If the model isn't + recognized, the planning step is skipped and the agent replies without a plan. Has no effect unless + `double_turns` is `true`. + """) + @example("gpt-4.1-mini") + double_turn_model?: string; + @doc(""" Enables the inner dialog feature, which runs a separate AI process in the background that analyzes the conversation and provides real-time insights to the main AI agent. @@ -197,15 +209,23 @@ model AIParams { @doc(""" Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word 'hippopotamus' is input. + Setting this param turns off `transparent_barge`, even when `transparent_barge` is set to `true`. + When `barge_min_words` is also set, either condition is enough: the caller interrupts the agent by + saying at least that many words or by saying something that matches this string. """) @example("Cancel order") barge_match_string?: string; - @doc("Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`.") - @minValue(1) + @doc(""" + Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. + `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + When `barge_match_string` is also set, either condition is enough to interrupt the agent. + **Default:** `0`. + """) + @minValue(0) @maxValue(99) @example(3) - barge_min_words?: integer; + barge_min_words?: integer = 0; @doc("If `true`, allows functions to be executed while the AI is being interrupted. **Default:** `false`.") @example(true) @@ -408,7 +428,12 @@ model AIParams { @example(2000) input_poll_freq?: integer = 2000; - @doc("When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. **Default:** `false`.") + @doc(""" + When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. + The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static + greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. + """) @example(true) interrupt_on_noise?: boolean; @@ -534,7 +559,13 @@ model AIParams { @example("Hello! Welcome to our customer service. How can I help you today?") static_greeting?: string; - @doc("If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting.") + @doc(""" + If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. + With `true`, what the caller says during the greeting is kept and answered after the greeting finishes. + A DTMF key press still interrupts the greeting, and so does `interrupt_on_noise`. + With `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores + `barge_min_words`, `barge_match_string`, and `enable_barge`, which apply only after the greeting. + """) @example(true) static_greeting_no_barge?: boolean = false; @@ -680,16 +711,18 @@ model AIParams { @doc(""" The format for the AI agent to reference phone numbers. - Allowed values are `e164`, `international`, and `national`. + Allowed values are `e164`, `international`, `national`, and `generic`. + An unrecognized value is ignored and `e164` is used. **Default:** `e164`. - + **Example:** - `e164`: `+12345678901` - `international`: `+1 234-567-8901` - `national`: `(234) 567-8901` + - `generic`: `234 567 8901` """) @example("national") - tts_number_format?: "e164" | "international" | "national" = "e164"; + tts_number_format?: "e164" | "international" | "national" | "generic" = "e164"; @doc("Has no effect and can be omitted.") verbose_logs?: boolean; diff --git a/specs/swml/calling/Methods/ai/main.tsp b/specs/swml/calling/Methods/ai/main.tsp index 39639175ff..0681a7ddad 100644 --- a/specs/swml/calling/Methods/ai/main.tsp +++ b/specs/swml/calling/Methods/ai/main.tsp @@ -91,9 +91,10 @@ model AIObject { ${aiHintsDescription} An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When speech recognition - runs in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on - Deepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error is returned. + One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition + runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. Rewrite rules still apply to the transcript in every mode. """) @example(#["pizza", "pepperoni"]) diff --git a/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json b/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json index 8139a548ba..35491b386f 100644 --- a/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json +++ b/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json @@ -2842,7 +2842,7 @@ "pepperoni" ] ], - "description": "Words and phrases that help the agent understand what the caller says. Each string is passed to speech\nrecognition as a hint, making that word or phrase more likely to be recognized.\nHints don't change how the agent speaks; use `pronounce` for that.\nAn object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent\nhears before the AI reads it, or both.\nOne hint list covers every language the agent uses; there are no per-language hints. When speech recognition\nruns in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on\nDeepgram speech recognition, recognition hints are not used. That covers string entries and `hint` values, and no error is returned.\nRewrite rules still apply to the transcript in every mode." + "description": "Words and phrases that help the agent understand what the caller says. Each string is passed to speech\nrecognition as a hint, making that word or phrase more likely to be recognized.\nHints don't change how the agent speaks; use `pronounce` for that.\nAn object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent\nhears before the AI reads it, or both.\nOne hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition\nruns in code-switching mode, because `multilingual` is set with Deepgram, its default engine, or a `languages` entry's\n`code` is `multi` on Deepgram, recognition hints are not used. That covers string entries and `hint` values, and no error\nis returned. Other speech recognition engines receive hints in every mode.\nRewrite rules still apply to the transcript in every mode." }, "languages": { "type": "array", @@ -6060,7 +6060,7 @@ "examples": [ 30000 ], - "description": "Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`. **Default:** `5000` ms." + "description": "Amount of time, in ms, to wait before prompting the user to respond. Allowed values: `0` (to disable) or `1,000` - `600,000`.\nA nonzero value lower than `end_of_speech_timeout` is raised to `end_of_speech_timeout` plus 1,000 ms. **Default:** `5000` ms." }, "attention_timeout_prompt": { "type": "string", @@ -6153,7 +6153,14 @@ "examples": [ true ], - "description": "Before each reply, a smaller planning model reviews the conversation and the available functions,\nthen gives the agent a short directive on how to respond. This can improve function use and\ncoherence. The reply waits for the plan, which adds latency to every turn. The planning model is\n`utility_model` if set, otherwise `ai_model`. Billed separately from the agent's per-minute rate.\nTo cover the wait, set `double_turn_fillers` on each entry in `languages`." + "description": "Before each reply, a smaller planning model reviews the conversation and the available functions,\nthen gives the agent a short directive on how to respond. This can improve function use and\ncoherence. The reply waits for the plan, which adds latency to every turn. The planning model is\n`double_turn_model` if set, otherwise `utility_model` if set, otherwise `ai_model`. Billed separately\nfrom the agent's per-minute rate. To cover the wait, set `double_turn_fillers` on each entry in `languages`." + }, + "double_turn_model": { + "type": "string", + "examples": [ + "gpt-4.1-mini" + ], + "description": "The model that plans each reply when `double_turns` is enabled. It takes priority over `utility_model`\nfor planning, so you can plan with one model and run background tasks with another. If the model isn't\nrecognized, the planning step is skipped and the agent replies without a plan. Has no effect unless\n`double_turns` is `true`." }, "enable_inner_dialog": { "type": "boolean", @@ -6204,16 +6211,17 @@ "examples": [ "Cancel order" ], - "description": "Takes a string, including a regular expression, defining barge behavior.\nFor example, this param can direct the AI to stop when the word 'hippopotamus' is input." + "description": "Takes a string, including a regular expression, defining barge behavior.\nFor example, this param can direct the AI to stop when the word 'hippopotamus' is input.\nSetting this param turns off `transparent_barge`, even when `transparent_barge` is set to `true`.\nWhen `barge_min_words` is also set, either condition is enough: the caller interrupts the agent by\nsaying at least that many words or by saying something that matches this string." }, "barge_min_words": { "type": "integer", + "default": 0, "examples": [ 3 ], - "minimum": 1, + "minimum": 0, "maximum": 99, - "description": "Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`." + "description": "Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`.\n`0`, the default, turns the word count off, and any value outside `1-99` is ignored.\nWhen `barge_match_string` is also set, either condition is enough to interrupt the agent.\n**Default:** `0`." }, "barge_functions": { "type": "boolean", @@ -6551,7 +6559,7 @@ "examples": [ true ], - "description": "When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. **Default:** `false`." + "description": "When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed.\nThe sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent.\nThis interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static\ngreeting even when `static_greeting_no_barge` is `true`. **Default:** `false`." }, "interrupt_prompt": { "type": "string", @@ -6714,7 +6722,7 @@ "examples": [ true ], - "description": "If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting." + "description": "If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting.\nWith `true`, what the caller says during the greeting is kept and answered after the greeting finishes.\nA DTMF key press still interrupts the greeting, and so does `interrupt_on_noise`.\nWith `false`, the greeting stops once the caller finishes speaking over it. This interruption ignores\n`barge_min_words`, `barge_match_string`, and `enable_barge`, which apply only after the greeting." }, "summary_mode": { "anyOf": [ @@ -6921,13 +6929,17 @@ { "type": "string", "const": "national" + }, + { + "type": "string", + "const": "generic" } ], "default": "e164", "examples": [ "national" ], - "description": "The format for the AI agent to reference phone numbers.\nAllowed values are `e164`, `international`, and `national`.\n**Default:** `e164`.\n\n**Example:**\n- `e164`: `+12345678901`\n- `international`: `+1 234-567-8901`\n- `national`: `(234) 567-8901`" + "description": "The format for the AI agent to reference phone numbers.\nAllowed values are `e164`, `international`, `national`, and `generic`.\nAn unrecognized value is ignored and `e164` is used.\n**Default:** `e164`.\n\n**Example:**\n- `e164`: `+12345678901`\n- `international`: `+1 234-567-8901`\n- `national`: `(234) 567-8901`\n- `generic`: `234 567 8901`" }, "verbose_logs": { "type": "boolean", From aeac44bf80bee8b702fabff9538197a509cf643f Mon Sep 17 00:00:00 2001 From: Devon-White Date: Mon, 23 Nov 2026 14:49:55 -0500 Subject: [PATCH 2/2] Address review: multilingual hints, barge_min_words, interrupt_on_noise - 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. --- fern/apis/relay-server/relay-server.yaml | 34 ++++++++++--------- fern/apis/signalwire-rest/openapi.yaml | 17 +++++----- .../agents/agent-base/set-multilingual.mdx | 5 ++- .../function-result/add-dynamic-hints.mdx | 4 +-- .../function-result/add-dynamic-hints.mdx | 4 +-- .../methods/calling/ai/ai_params/index.mdx | 8 +++-- .../reference/methods/calling/ai/index.mdx | 10 +++--- .../methods/calling/ai/multilingual/index.mdx | 2 +- specs/swml/calling/Methods/ai/ai_params.tsp | 9 ++--- specs/swml/calling/Methods/ai/main.tsp | 8 ++--- .../@typespec/json-schema/SWMLObject.json | 10 +++--- 11 files changed, 58 insertions(+), 53 deletions(-) diff --git a/fern/apis/relay-server/relay-server.yaml b/fern/apis/relay-server/relay-server.yaml index b728f96377..ede0ff32d0 100644 --- a/fern/apis/relay-server/relay-server.yaml +++ b/fern/apis/relay-server/relay-server.yaml @@ -17042,10 +17042,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition - runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When speech recognition + runs in code-switching mode, because `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. examples: - - pizza @@ -17287,8 +17287,8 @@ components: barge_min_words: type: integer description: |- - Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + Defines the number of words that must be input before triggering barge behavior. + Allowed values: `0` to turn the word count off, or `1-99`. Any other value is ignored. When `barge_match_string` is also set, either condition is enough to interrupt the agent. **Default:** `0`. minimum: 0 @@ -17565,7 +17565,7 @@ components: type: boolean description: |- When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. - The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + The sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent. This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: @@ -17810,6 +17810,7 @@ components: When enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs. + Setting `barge_match_string` turns this param off, even when it is set to `true`. **Default:** `true`. default: true examples: @@ -17918,7 +17919,7 @@ components: - national - generic description: |- - The format for the AI agent to reference phone numbers. + How the agent formats phone numbers when it speaks them. Allowed values are `e164`, `international`, `national`, and `generic`. An unrecognized value is ignored and `e164` is used. **Default:** `e164`. @@ -21584,10 +21585,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition - runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When speech recognition + runs in code-switching mode, because `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. examples: - - pizza @@ -21829,8 +21830,8 @@ components: barge_min_words: type: integer description: |- - Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + Defines the number of words that must be input before triggering barge behavior. + Allowed values: `0` to turn the word count off, or `1-99`. Any other value is ignored. When `barge_match_string` is also set, either condition is enough to interrupt the agent. **Default:** `0`. minimum: 0 @@ -22107,7 +22108,7 @@ components: type: boolean description: |- When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. - The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + The sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent. This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: @@ -22352,6 +22353,7 @@ components: When enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs. + Setting `barge_match_string` turns this param off, even when it is set to `true`. **Default:** `true`. default: true examples: @@ -22460,7 +22462,7 @@ components: - national - generic description: |- - The format for the AI agent to reference phone numbers. + How the agent formats phone numbers when it speaks them. Allowed values are `e164`, `international`, `national`, and `generic`. An unrecognized value is ignored and `e164` is used. **Default:** `e164`. diff --git a/fern/apis/signalwire-rest/openapi.yaml b/fern/apis/signalwire-rest/openapi.yaml index c94906b2eb..a89e9ef226 100644 --- a/fern/apis/signalwire-rest/openapi.yaml +++ b/fern/apis/signalwire-rest/openapi.yaml @@ -39463,10 +39463,10 @@ components: Hints don't change how the agent speaks; use `pronounce` for that. An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition - runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When speech recognition + runs in code-switching mode, because `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. examples: - - pizza @@ -39749,8 +39749,8 @@ components: minimum: 0 maximum: 99 description: |- - Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + Defines the number of words that must be input before triggering barge behavior. + Allowed values: `0` to turn the word count off, or `1-99`. Any other value is ignored. When `barge_match_string` is also set, either condition is enough to interrupt the agent. **Default:** `0`. examples: @@ -40017,7 +40017,7 @@ components: type: boolean description: |- When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. - The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + The sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent. This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. examples: @@ -40254,6 +40254,7 @@ components: When enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs. + Setting `barge_match_string` turns this param off, even when it is set to `true`. **Default:** `true`. examples: - true @@ -40362,7 +40363,7 @@ components: - national - generic description: |- - The format for the AI agent to reference phone numbers. + How the agent formats phone numbers when it speaks them. Allowed values are `e164`, `international`, `national`, and `generic`. An unrecognized value is ignored and `e164` is used. **Default:** `e164`. diff --git a/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx b/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx index 40634f0204..74fbfe9d69 100644 --- a/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx +++ b/fern/products/server-sdks/pages/reference/python/agents/agent-base/set-multilingual.mdx @@ -22,9 +22,8 @@ This is mutually exclusive with [`set_languages()`][set-languages] and [`add_language()`][add-language]. If both are set, the platform uses `multilingual` and ignores `languages`. -When multilingual mode runs on Deepgram speech recognition, the default engine, hints added with -[`add_hints()`][add-hints] or [`add_dynamic_hints()`][add-dynamic-hints] are not used, and no error -is returned. Other speech recognition engines still receive them. +In multilingual mode, speech recognition hints added with [`add_hints()`][add-hints] or +[`add_dynamic_hints()`][add-dynamic-hints] are not used, and no error is returned. Pattern hints from [`add_pattern_hint()`][add-pattern-hint] still rewrite what the agent hears. ## Parameters diff --git a/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx b/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx index 18e093e0a6..b628d55d82 100644 --- a/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx +++ b/fern/products/server-sdks/pages/reference/python/agents/function-result/add-dynamic-hints.mdx @@ -14,8 +14,8 @@ hint can be a simple string or a pronunciation pattern object that maps misrecognized speech to the correct text. -When the agent runs in multilingual mode ([`set_multilingual()`][set-multilingual]) on Deepgram -speech recognition, the default engine, string hints are not passed to speech recognition. Pattern objects still rewrite the transcript. +When the agent runs in multilingual mode ([`set_multilingual()`][set-multilingual]), string hints +are not passed to speech recognition. Pattern objects still rewrite the transcript. ## **Parameters** diff --git a/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx b/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx index 3956178d4d..72990e5306 100644 --- a/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx +++ b/fern/products/server-sdks/pages/reference/typescript/agents/function-result/add-dynamic-hints.mdx @@ -14,8 +14,8 @@ hint can be a simple string or a pronunciation pattern object that maps misrecognized speech to the correct text. -When the agent runs in multilingual mode ([`setMultilingual()`][set-multilingual]) on Deepgram -speech recognition, the default engine, string hints are not passed to speech recognition. Pattern objects still rewrite the transcript. +When the agent runs in multilingual mode ([`setMultilingual()`][set-multilingual]), string hints +are not passed to speech recognition. Pattern objects still rewrite the transcript. ## **Parameters** diff --git a/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx index c948de0bb4..0025571811 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx @@ -275,7 +275,7 @@ Customize the AI agent's voice output, including volume control, voice character - The format of the number the AI will reference the phone number. Valid values: `e164` (e.g. +12345678901), `international` (e.g. +1 234-567-8901), `national` (e.g. (234) 567-8901), or `generic` (e.g. 234 567 8901). An unrecognized value is ignored and `e164` is used. + How the agent formats phone numbers when it speaks them. Valid values: `e164` (e.g. +12345678901), `international` (e.g. +1 234-567-8901), `national` (e.g. (234) 567-8901), or `generic` (e.g. 234 567 8901). An unrecognized value is ignored and `e164` is used. @@ -332,7 +332,7 @@ Manage how the AI agent handles interruptions when users speak over it, includin - Defines the number of words that must be input before triggering barge behavior. Allowed values from `1`-`99`. `0`, the default, turns the word count off, and any value outside `1`-`99` is ignored. When [`barge_match_string`](#paramsbarge_match_string) is also set, either condition is enough to interrupt the agent. + Defines the number of words that must be input before triggering barge behavior. Allowed values: `0` to turn the word count off, or `1`-`99`. Any other value is ignored. When [`barge_match_string`](#paramsbarge_match_string) is also set, either condition is enough to interrupt the agent. @@ -344,7 +344,7 @@ Manage how the AI agent handles interruptions when users speak over it, includin When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. - The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. This interruption ignores [`enable_barge`](#paramsenable_barge), [`barge_min_words`](#paramsbarge_min_words), and [`barge_match_string`](#paramsbarge_match_string), and it interrupts a static greeting even when [`static_greeting_no_barge`](#paramsstatic_greeting_no_barge) is `true`. + The sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent. This interruption ignores [`enable_barge`](#paramsenable_barge), [`barge_min_words`](#paramsbarge_min_words), and [`barge_match_string`](#paramsbarge_match_string), and it interrupts a static greeting even when [`static_greeting_no_barge`](#paramsstatic_greeting_no_barge) is `true`. @@ -357,6 +357,8 @@ Manage how the AI agent handles interruptions when users speak over it, includin When enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs. + + Setting [`barge_match_string`](#paramsbarge_match_string) turns this param off, even when it is set to `true`. diff --git a/fern/products/swml/pages/reference/methods/calling/ai/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/index.mdx index 8327531088..9bfc5013d8 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/index.mdx @@ -73,11 +73,11 @@ it is recommended to read the [prompt engineering][prompt-engineering] guide. **Hints as objects:** Each object is a recognition hint (`hint`), a rewrite rule applied to the text the agent hears before the AI reads it (`pattern` with `replace`), or both. - One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition - runs in code-switching mode, because [`ai.multilingual`][multilingual] is set with Deepgram, its default engine, or a - [`languages`][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. Other speech recognition engines receive hints in every mode. - Rewrite rules still apply to the transcript in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When speech recognition + runs in code-switching mode, because [`ai.multilingual`][multilingual] is set or a [`languages`][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. diff --git a/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx b/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx index 461e7613a5..cc5db0a702 100644 --- a/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx +++ b/fern/products/swml/pages/reference/methods/calling/ai/multilingual/index.mdx @@ -170,7 +170,7 @@ Both configure voices, but the shape and the behavior differ: | Entry key | `code`, plus a human-readable `name` | `language`, or `default` for the catch-all | | Catch-all entry | None | The `default` entry, or the first listed language | | ASR configuration | [`params.openai_asr_engine`][openai-asr-engine] | `engine`, `model`, and `provider` on this object | -| Recognition hints from [`ai.hints`][ai-hints] | Used, except in code-switching mode (`multi` on Deepgram) | Not used on Deepgram, the default engine; rewrite rules still apply | +| Recognition hints from [`ai.hints`][ai-hints] | Used, except in code-switching mode (`multi` on Deepgram) | Not used; rewrite rules still apply | The two `languages` arrays are not interchangeable. An `ai.multilingual.languages` entry is flat — `language` and `voice`, plus an optional `model` and `params` — and takes no `name`, diff --git a/specs/swml/calling/Methods/ai/ai_params.tsp b/specs/swml/calling/Methods/ai/ai_params.tsp index c1eab9d9d2..a0509d8ba0 100644 --- a/specs/swml/calling/Methods/ai/ai_params.tsp +++ b/specs/swml/calling/Methods/ai/ai_params.tsp @@ -217,8 +217,8 @@ model AIParams { barge_match_string?: string; @doc(""" - Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. - `0`, the default, turns the word count off, and any value outside `1-99` is ignored. + Defines the number of words that must be input before triggering barge behavior. + Allowed values: `0` to turn the word count off, or `1-99`. Any other value is ignored. When `barge_match_string` is also set, either condition is enough to interrupt the agent. **Default:** `0`. """) @@ -430,7 +430,7 @@ model AIParams { @doc(""" When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed. - The sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent. + The sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent. This interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static greeting even when `static_greeting_no_barge` is `true`. **Default:** `false`. """) @@ -616,6 +616,7 @@ model AIParams { When enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs. + Setting `barge_match_string` turns this param off, even when it is set to `true`. **Default:** `true`. """) @example(true) @@ -710,7 +711,7 @@ model AIParams { turn_filler_min_ms?: integer = 0; @doc(""" - The format for the AI agent to reference phone numbers. + How the agent formats phone numbers when it speaks them. Allowed values are `e164`, `international`, `national`, and `generic`. An unrecognized value is ignored and `e164` is used. **Default:** `e164`. diff --git a/specs/swml/calling/Methods/ai/main.tsp b/specs/swml/calling/Methods/ai/main.tsp index 0681a7ddad..0f93145abc 100644 --- a/specs/swml/calling/Methods/ai/main.tsp +++ b/specs/swml/calling/Methods/ai/main.tsp @@ -91,10 +91,10 @@ model AIObject { ${aiHintsDescription} An object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent hears before the AI reads it, or both. - One hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition - runs in code-switching mode, because `multilingual` is set with Deepgram, its default engine, 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. Other speech recognition engines receive hints in every mode. + One hint list covers every language the agent uses; there are no per-language hints. When speech recognition + runs in code-switching mode, because `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. """) @example(#["pizza", "pepperoni"]) diff --git a/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json b/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json index 35491b386f..15dbb12721 100644 --- a/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json +++ b/specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json @@ -2842,7 +2842,7 @@ "pepperoni" ] ], - "description": "Words and phrases that help the agent understand what the caller says. Each string is passed to speech\nrecognition as a hint, making that word or phrase more likely to be recognized.\nHints don't change how the agent speaks; use `pronounce` for that.\nAn object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent\nhears before the AI reads it, or both.\nOne hint list covers every language the agent uses; there are no per-language hints. When Deepgram speech recognition\nruns in code-switching mode, because `multilingual` is set with Deepgram, its default engine, or a `languages` entry's\n`code` is `multi` on Deepgram, recognition hints are not used. That covers string entries and `hint` values, and no error\nis returned. Other speech recognition engines receive hints in every mode.\nRewrite rules still apply to the transcript in every mode." + "description": "Words and phrases that help the agent understand what the caller says. Each string is passed to speech\nrecognition as a hint, making that word or phrase more likely to be recognized.\nHints don't change how the agent speaks; use `pronounce` for that.\nAn object can set a `hint`, a `pattern` and `replace` pair that rewrites matching text in what the agent\nhears before the AI reads it, or both.\nOne hint list covers every language the agent uses; there are no per-language hints. When speech recognition\nruns in code-switching mode, because `multilingual` is set or a `languages` entry's `code` is `multi` on\nDeepgram, recognition hints are not used. That covers string entries and `hint` values, and no error is returned.\nOutside code-switching mode, every engine receives hints.\nRewrite rules still apply to the transcript in every mode." }, "languages": { "type": "array", @@ -6221,7 +6221,7 @@ ], "minimum": 0, "maximum": 99, - "description": "Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`.\n`0`, the default, turns the word count off, and any value outside `1-99` is ignored.\nWhen `barge_match_string` is also set, either condition is enough to interrupt the agent.\n**Default:** `0`." + "description": "Defines the number of words that must be input before triggering barge behavior.\nAllowed values: `0` to turn the word count off, or `1-99`. Any other value is ignored.\nWhen `barge_match_string` is also set, either condition is enough to interrupt the agent.\n**Default:** `0`." }, "barge_functions": { "type": "boolean", @@ -6559,7 +6559,7 @@ "examples": [ true ], - "description": "When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed.\nThe sound doesn't need to be recognized as words, so a cough, background conversation, or music can interrupt the agent.\nThis interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static\ngreeting even when `static_greeting_no_barge` is `true`. **Default:** `false`." + "description": "When enabled, barges agent upon any sound interruption longer than 1 second. The 1-second threshold can't be changed.\nThe sound doesn't need to be recognized as words, so sustained sound, such as background conversation or music, can interrupt the agent.\nThis interruption ignores `enable_barge`, `barge_min_words`, and `barge_match_string`, and it interrupts a static\ngreeting even when `static_greeting_no_barge` is `true`. **Default:** `false`." }, "interrupt_prompt": { "type": "string", @@ -6844,7 +6844,7 @@ "examples": [ true ], - "description": "When enabled, the AI will not respond to the user's input when the user is speaking over the agent.\nThe agent will wait for the user to finish speaking before responding.\nAdditionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs.\n**Default:** `true`." + "description": "When enabled, the AI will not respond to the user's input when the user is speaking over the agent.\nThe agent will wait for the user to finish speaking before responding.\nAdditionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs.\nSetting `barge_match_string` turns this param off, even when it is set to `true`.\n**Default:** `true`." }, "transparent_barge_max_time": { "type": "integer", @@ -6939,7 +6939,7 @@ "examples": [ "national" ], - "description": "The format for the AI agent to reference phone numbers.\nAllowed values are `e164`, `international`, `national`, and `generic`.\nAn unrecognized value is ignored and `e164` is used.\n**Default:** `e164`.\n\n**Example:**\n- `e164`: `+12345678901`\n- `international`: `+1 234-567-8901`\n- `national`: `(234) 567-8901`\n- `generic`: `234 567 8901`" + "description": "How the agent formats phone numbers when it speaks them.\nAllowed values are `e164`, `international`, `national`, and `generic`.\nAn unrecognized value is ignored and `e164` is used.\n**Default:** `e164`.\n\n**Example:**\n- `e164`: `+12345678901`\n- `international`: `+1 234-567-8901`\n- `national`: `(234) 567-8901`\n- `generic`: `234 567 8901`" }, "verbose_logs": { "type": "boolean",