Skip to content

AI agent release: SWML ai, events, and Python SDK 3.7.1–3.15.3 - #993

Draft
Devon-White wants to merge 4 commits into
mainfrom
devon/docs/ai-agent-release
Draft

Devon-White wants to merge 4 commits into
mainfrom
devon/docs/ai-agent-release

Conversation

@Devon-White

Copy link
Copy Markdown
Collaborator

Docs for the upcoming AI agent release (SWML ai verb) and Python SDK 3.7.1 to 3.15.3. Draft: merge when the release is deployed. Every new shape is opt-in, but several defaults change for existing agents (listed below), and on today's platform a voice array or "1.5s" duration doesn't work yet.

Summary

SWML ai reference + TypeSpec

  • Params: a new ## Duration values section ("1.5s", "20m", "1h30m", "1:30"). Every millisecond param, plus hard_stop_time, is now typed integer | duration.
    • New params: ignore_backchannels, noisy_line_ms, tts_pause_cap_ms, turn_filler_volume, text_normalization_show_heard, enable_end_call, unavailable_function_response, background_sounds, semantic_gate_dialogue, rescue_model, and the heygen_* params.
    • Rewritten: the transparent_barge window and enable_barge cancelling on partials. redact_prompt lists what it now masks.
    • Doc corrections: tts_number_format, inactivity_timeout, outbound_attention_timeout, initial_sleep_ms, save_conversation, summary_mode.
  • Prompt, steps and gather:
    • History modes isolate and spoken, with a comparison table; hide now keeps the exchange that entered the step.
    • expected_answer, gather say_questions and per-question say, and gather_submit waiting for the caller's answer.
    • valid_steps and valid_contexts are enforced. change_step to the current step restarts it.
  • Models: the supported list adds gpt-6-luna, drops gpt-4.1-nano, and shows OpenAI's shutdown dates.
    • Also documented: the model@provider rule, substitution with model_substituted, reasoning_effort and verbosity on prompt/post_prompt, failover, and context consolidation.
  • Voices: every voice field takes an array of up to 8, and a new top-level fallback_voice follows it.
    • Also documented: the order voices are tried in, Cartesia Kurt as the last-resort voice, and the default_voice SWML variable.
    • Multilingual language hints, and expressiveness_boost for HeyGen.
  • SWAIG:
    • New actions: no_barge_next_response, semantic_gate_mark, back_to_back_functions, extensive_data, change_voice (array), add_dynamic_hints/clear_dynamic_hints, end_of_speech_timeout/speech_event_timeout, wait_for_user.
    • hold takes durations. settings merges instead of replacing.
    • A say is now interruptible and reaches the model.
    • Function requests carry tool_call_id, step, context, language, model and turn.
    • New "How the agent calls functions" section: the 18-call limit, repeated blocked calls, and tool calls written as text.
  • Gates: unclear/on_unclear, dialogue/history/since, filled-in on_fail, and the new fields the decision model reads and the call records.
  • live_translate / live_transcribe:
    • Translation and summary model default to gpt-6-luna; live_transcribe gets ai_model.
    • from_voice/to_voice take arrays, and speech_timeout/vad_silence_ms take durations.
    • Applied across the SWML, REST Calling API and Relay models.

Events and webhooks (Relay + REST specs)

  • New calling.ai.response_heard and calling.ai.manual_say events.
  • speech_detect gains words; partial_result gains barged; both transparent_barge payload shapes are documented; stop times are in microseconds.
  • calling.ai.post_prompt removed (no longer sent).
  • calling.error documents the voice-recovery fields (including fallback_index/fallback_source), model_substituted, invalid_semantic_gate and webhook_drain_timeout.
  • Post-prompt webhook: call_ended_by enum, and gate records gain dialogue, choice, unclear_limit and unclear. swaig_log gains superseded.

Platform guides

  • Semantic gates guide: a confirm-before-it-runs flow (proposal dialogue, three-way gate, marks).
  • Content redaction guide and diagram updated for the wider masking.
  • New HeyGen Voice TTS page; Grok page lists all 28 voices and custom voice IDs.

Python SDK reference (3.7.1 to 3.15.3)

  • Context builder: history modes, set_expected_answer, gather say_questions/say, render-time warnings.
  • AgentBase:
    • voices: set_default_voice, set_agent_voice, set_fallback_voice
    • tools: define_tool(vouched=, nullable_optional=, middleware=, needs_conversation=), define_native_tool, tool middleware, set_unavailable_function_response
    • events: on_call_start, on_ai_event, speech_finals
  • FunctionResult: back_to_back_functions, no_barge_next_response, set_semantic_gate_mark, refresh_step, change_voice, plus duration strings.
  • New sections: ToolRefusal; signalwire.patterns (Proposal, RequestList); speech helpers; testing (CallSimulator, RequestRecorder); signalwire.operations with task packs, FrontDeskAgent and PersonalAssistantAgent.
  • SWML builder and service: positional bodies, return_(), validation when a verb is added, sleep validation.
  • Relay and CLI: Call.ring(), SIGNALWIRE_RELAY_HOST, search --query-stopwords/rank_weight, sw-pydocs.
  • ConciergeAgent, ReceptionistAgent and FAQBotAgent marked deprecated.

Defaults that change for existing agents

Backchannels are ignored over the agent's speech. The noisy-line notice is on at 4000 ms. Pauses inside the agent's speech are capped at 300 ms. Turn fillers play 6 dB quieter. The transparent barge window is now measured from the caller's last statement. next_step/change_context are validated. Responses API models default to verbosity: low. rescue_model defaults to gpt-6-luna. The last-resort voice is Cartesia Kurt. Duration strings are read with their units. calling.ai.post_prompt is no longer sent. Function requests carry new fields.

Notes for reviewers

Not documented on purpose (internal or not public)

  • Models that need account access, realtime-model release items, debug-webhook events, and pricing/SKUs.
  • event_webhook_url has no page anywhere in the docs, so events only mention it.

Needs engineering confirmation

  1. save_conversation: the release notes say the next call POSTs agent.load_conversation, but the existing docs and spec say fetch_conversation. The action name is left out.
  2. Prompt token caps: the notes give max_completion_tokens (1 to 2048) for gpt-6-luna, which conflicts with the existing max_tokens (0 to 4096). Consolidation reserves max_response_tokens, which the params page says has no effect on reply length. None of this was changed.
  3. temperature range for gpt-6-luna: the notes say 0 to 2, the documented range is 0 to 1.5. Left unchanged.
  4. gpt-5.4 is listed among the Responses-API models but not on the supported list. Only supported models are documented.
  5. @anthropic is a valid provider suffix, but no public model uses it, so only openai and azure-openai are named. OpenAI's suggested replacements are omitted because gpt-6.1-terra isn't supported.
  6. REST Calling API and Relay live_translate/live_transcribe are assumed to accept voice arrays and duration strings like SWML does.
    • REST translation_model/ai_model weren't added; we couldn't confirm those paths accept them.
    • The Relay from_voice/to_voice default changed from josh to Azure en-US-RyanMultilingualNeural, per the notes.
  7. Grok custom voice IDs: the notes say an ID "that isn't one of the account's custom voices plays nothing". It's unclear whose xAI account that means, since there's no customer key param.
  8. languages[].voice and multilingual.languages are now optional in the schema, because default_voice can fill them.
  9. The notes say gates can attach to SWAIG.hooks, but no such key exists in the spec, so it isn't documented.
  10. Action shapes that come only from the Python SDK:
    • wait_for_user is typed boolean; the SDK also sends a number or "answer_first".
    • add_dynamic_hints items reuse the ai.hints form.
    • clear_dynamic_hints takes {}.
  11. Redaction:
    • Is say action text masked in the call log, now that manual_say masks it?
    • Is transparent_barge combined_text masked?
    • Should the post-prompt "blocked calls" enum include unclear?
  12. Python SDK:
    • Payments currency is validated at setup per the notes, but only the language is checked per the source. The page follows the source.
    • Operations.confirm_gates() returns one gate (agreed), not three. The page follows the source.
    • Call.ring() accepts **kwargs, but its parameters aren't documented.
    • pay(ai_response=None) sends null; the old "disables it" claim was removed.
  13. Params undocumented before and still undocumented, because the notes give only ranges: min_utterance_ms, escalate_after_ms, function_filler_sequence_gap_ms, double_turn_wait_ms, double_turn_filler_min_ms.

Scope gaps / follow-ups

  • TypeScript SDK reference is not updated, since these are Python SDK releases.
  • fern/products/server-sdks/sdk-source-sync.json is not bumped. Only the release items were synced, not a full audit against v3.15.3.
  • Pages that use the deprecated prefabs weren't touched: multi-agent.mdx and call-transfer.mdx.
    • call-flow.mdx still shows {"sleep": {"time": 500}} in its generated-SWML block and TypeScript tab.
  • translate-calls.mdx doesn't yet mention voice arrays or translation_model.
  • The Grok VoiceWidget data likely still lists five voices, and HeyGen has no widget data.
  • Stale gpt-4.1-nano mentions remain in ai_sidecar and in the thinking_model/utility_model/vision_model docs.

Draft changelog entry. This is not committed: CLAUDE.md dates changelog files to the day the change reaches customers. Add it as fern/products/platform/changelog/<deploy-date>.mdx on deploy day.

---
tags: ["ai", "sdks", "swml", "tts"]
---

## calling.ai.post_prompt event removed

Read an AI agent's post-prompt report from your [`post_prompt_url`](/docs/swml/reference/calling/ai) webhook: the `calling.ai.post_prompt` event is no longer sent over Relay or to `event_webhook_url`.

<Warning title="Breaking change for post-prompt event consumers">
Integrations that read the post-prompt from the `calling.ai.post_prompt` event must switch to `post_prompt_url`.
</Warning>

## Backup voice lists added to AI agents

Give any AI agent voice field a list of voices, and add a shared [`fallback_voice`](/docs/swml/reference/calling/ai) list: when a voice fails, the agent carries on with the next one instead of going silent. The SWML variable `default_voice` sets voices for every agent in a script, and the last-resort voice is now Cartesia's Kurt.

## Backchannels no longer interrupt AI agents

A bare "okay" or "mm-hmm" said over the agent's speech no longer cuts it off. Agents also warn callers on a noisy line, cap long pauses in their speech, and play turn fillers more quietly. Each has a [param](/docs/swml/reference/calling/ai/params) to restore the previous behaviour.

## Step history modes isolate and spoken added

Use `history: "isolate"` to show the model only the current step while it lasts, or `"spoken"` to drop earlier tool traffic but keep the conversation. Gather can now speak its questions word for word. See [steps and history modes](/docs/swml/reference/calling/ai/prompt).

## Semantic gates accept unclear answers

Let a [semantic gate](/docs/platform/ai/semantic-gates) answer unclear and ask the caller again, and judge only what was said since a proposal or a mark you set.

## Timing params accept durations like "1.5s" and "20m"

Write any AI timing param as a [duration](/docs/swml/reference/calling/ai/params#duration-values). `hard_stop_time` and the `hold` action now read their units, so `"20m"` is 20 minutes rather than 20 seconds.

## gpt-6-luna added and gpt-4.1-nano removed

Pick [`gpt-6-luna`](/docs/swml/reference/calling/ai/prompt) as an AI agent's model. It is also the new default for live translation and transcription summaries. `gpt-4.1-nano` runs as `gpt-4o-mini`, because OpenAI has shut it down.

## HeyGen Voice added as a TTS engine

Use [HeyGen Voice](/docs/platform/voice/tts/heygen) voices in AI agents with `heygen.<voice>`.

(Links verified against current slugs.)

Verification

  • yarn build:specs: passes. Regenerated output is committed: the SWML JSON schema, the REST OpenAPI, and the Relay client/server specs.
  • yarn fern-md-check: passes (all 2980 MDX files valid).
  • yarn fern-check: the only error is the missing-redirects check, which couldn't reach Fern's FDR (403) from the sandbox. No pages were moved or removed. CI should run it.
  • Every new internal link resolves to a page slug. New anchors follow the repo's existing ParamField convention (languages[].voice becomes #languagesvoice) and should be spot-checked in preview.
  • SWML examples: the YAML and JSON in each pair parse and match.
  • Python examples: compiled against SDK 3.15.3. Examples that need no credentials were run.
  • Scanned the diff for internal-only content (account-access models, realtime models, debug webhook, SKUs, internal repo names): none.

Pages to preview

  • SWML:
    • /docs/swml/reference/calling/ai
    • /docs/swml/reference/calling/ai/params
    • /docs/swml/reference/calling/ai/prompt
    • /docs/swml/reference/calling/ai/languages
    • /docs/swml/reference/calling/ai/multilingual
    • /docs/swml/reference/calling/ai/swaig/functions
    • /docs/swml/reference/calling/ai/swaig/functions/gates
    • /docs/swml/reference/calling/ai/swaig/functions/data-map
    • /docs/swml/reference/calling/live-translate
    • /docs/swml/reference/calling/live-transcribe
  • Platform:
    • /docs/platform/ai/semantic-gates
    • /docs/platform/ai/content-redaction
    • /docs/platform/voice/tts and the HeyGen and Grok pages
  • Server SDKs:
    • /docs/server-sdks/reference/python/agents/operations
    • .../agents/patterns
    • .../agents/testing
    • .../agents/speech
    • .../agents/context-builder/step/set-history
    • .../agents/function-result
    • .../agents/prefabs
    • .../agents/swml-builder
    • .../relay/call/ring
  • Generated API reference pages:
    • AI SWAIG tool webhook
    • AI post-prompt callback
    • Relay calling.ai events and calling.error

SWML ai: duration values, new params, voice arrays and fallback_voice,
history isolate/spoken, expected_answer, gather say_questions, gate
unclear/dialogue/history/since, new result actions, model list.
Relay/webhooks: response_heard, manual_say, speech_detect words,
calling.error voice-recovery fields, post_prompt event removed,
call_ended_by, SWAIG request fields. Regenerated output.
Semantic gates confirmation flow, content redaction coverage, HeyGen
Voice page, Grok voice list.
@github-actions

Copy link
Copy Markdown
Contributor

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.

1 participant