Skip to content

Document ai.params redact_prompt, auto_correct, and utility_model#452

Open
Devon-White wants to merge 4 commits into
mainfrom
Devon/swml-redaction-params
Open

Document ai.params redact_prompt, auto_correct, and utility_model#452
Devon-White wants to merge 4 commits into
mainfrom
Devon/swml-redaction-params

Conversation

@Devon-White

@Devon-White Devon-White commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the three shipped-but-undocumented AI content-redaction params to the SWML TypeSpec schema and the ai.params reference page. Addresses the reference-page acceptance criterion of #450; the conceptual Content Redaction guide is deliberately deferred to a follow-up PR.

All types, defaults, and behavior were verified against the mod_openai source (not just the issue text):

  • redact_prompt (string) — plain-language description of content to mask (----) from everything the platform records or transmits: logs, events, webhook payloads, the call timeline, and the post-conversation call_log/raw_call_log. Non-empty value enables; omit to disable. Explicitly states the caller still hears the content and the AI model still receives the real text each turn — redaction protects recorded/transmitted data only, and is best-effort.
  • auto_correct (boolean, default false) — utility-pass cleanup of caller speech-to-text. Documents a source-verified constraint the issue draft missed: it is mutually exclusive with enable_text_normalization (which defaults on and wins, so enable_text_normalization: false is required for auto_correct to take effect). When combined with redact_prompt, cleanup and redaction run in a single pass.
  • utility_model (string, defaults to the value of ai_model) — model for the lightweight redaction/cleanup passes, documented with the same allowed-models phrasing and default convention as thinking_model.

Changes

  • specs/swml/calling/Methods/ai/ai_params.tsp — three new fields on AIParams (auto_correct and redact_prompt beside enable_text_normalization; utility_model beside thinking_model)
  • fern/products/swml/pages/reference/methods/calling/ai/ai_params/index.mdx — three matching <ParamField> entries in the corresponding page sections
  • specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json — regenerated (checked-in output)
  • fern/apis/signalwire-rest/openapi.yaml — regenerated: the calling-api imports the SWML module, so SWML.Calling.AIParams is emitted into the REST OpenAPI and picks up the three new fields. This also means the Fabric AI-agent REST resource documents them for free (see below).
  • Removed specs/signalwire-rest/fabric-api/ai-agent/models/ai/ai_params.tsp — dead code. The Fabric AI-agent spec already reuses SWML.Calling.AIParams via model AIAgent is AIObject (core.tsp imports the SWML ai module); this hand-copied duplicate was never imported or compiled, had drifted ~40 fields behind the shared model, and carried the backend's digit_termiantors typo. Deleting it leaves the emitted openapi.yaml byte-identical (verified by rebuild).

Verification

  • yarn build:swml-calling and yarn build:signalwire-rest compile clean; tsp format unchanged
  • All three fields emit into SWMLObject.json and into SWML.Calling.AIParams in openapi.yaml with correct shapes (plain string / boolean | SWMLVar with default: false / SupportedAIModels union)

Follow-ups (out of scope here)

Part of #450

Adds the three shipped-but-undocumented AI params to the SWML TypeSpec
schema (AIParams) and the ai_params reference page, per issue #450.
Types, defaults, and behavior verified against mod_openai source:
redact_prompt masks recorded/transmitted content only (model still
receives real text), auto_correct is mutually exclusive with
enable_text_normalization, and utility_model defaults to ai_model.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The calling-api imports the SWML module, so SWML.Calling.AIParams is
emitted into the checked-in openapi.yaml and picks up redact_prompt,
auto_correct, and utility_model.
The Fabric AI-agent spec already reuses SWML.Calling.AIParams via
'model AIAgent is AIObject' (core.tsp imports the SWML ai module), so
the hand-copied AIParams in ai-agent/models/ai/ai_params.tsp was never
imported or compiled. It had drifted ~40 fields behind the SWML model
and carried the backend's digit_termiantors typo. Deleting it changes
nothing in the emitted openapi.yaml (verified: rebuild is byte-identical);
the REST surface already picks up redact_prompt, auto_correct, and
utility_model through the shared SWML model. The Rails backend merges
unrecognized params verbatim into the generated SWML document
(params_serializer.rb), so the shared model matches actual behavior.
@Devon-White Devon-White linked an issue Jul 7, 2026 that may be closed by this pull request
3 tasks
Removes implementation-flavored wording (model round-trip, utility
passes, per-turn phrasing) in favor of end-user language, states the
latency benefit plainly, and turns the best-effort caveat into
actionable guidance.
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.

Document AI content redaction (redact_prompt, auto_correct, utility_model)

1 participant