Skip to content

Adjustment to transfer example via SWAIG#307

Open
Manny-r31 wants to merge 11 commits into
mainfrom
Manny/swml-transfer-updates
Open

Adjustment to transfer example via SWAIG#307
Manny-r31 wants to merge 11 commits into
mainfrom
Manny/swml-transfer-updates

Conversation

@Manny-r31
Copy link
Copy Markdown
Collaborator

Changes to SWAIG transfer example to make transfer true requirement more explicit.

Description

This Github issue was made last month. From comments made on the issue recently it appears that more explicit verbiage should be given to the examples where a transfer is being completed via SWAIG function. From what I can see, this was already addressed by us last month when I made my adjustments to the docs to account for this. However one page still required a few small adjustments

Type of Change

  • Documentation update

Related Issues

https://github.com/signalwire/cloud-product/issues/18361#issuecomment-4345605918

  • Tested manually
  • Tested with live SignalWire credentials (if applicable)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have updated documentation (if applicable)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale label Jun 2, 2026
@hey-august
Copy link
Copy Markdown
Collaborator

@github-actions don't you dare

@hey-august hey-august removed the Stale label Jun 5, 2026
hey-august and others added 5 commits June 5, 2026 19:55
The transfer field was added to the SWMLAction TypeSpec model but the
generated JSON schema was never recompiled, so action[].transfer was
missing from SWMLObject.json (and the sealed schema would have rejected
it). Recompiled with @typespec/json-schema 1.11.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
action[].transfer has two source-backed forms (mod_openai/actions.c):
a boolean used alongside a sibling SWML payload (hard-transfer vs inline
execute), and an object {dest, summarize} used standalone to transfer to
a destination. The prior edit relabeled transfer as a pure boolean,
contradicting the transfer.dest/transfer.summarize sub-fields documented
just below it. Describe both forms so the snippet is internally consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
get_next_dest_from_string (mod_infrastructure/swml.c) resolves transfer.dest
to either a section in the current SWML document or a SWML URL — not a raw
phone number or SIP URI, which would fall through to an unmatched section name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
swml.mdx still used the old two-object pattern ({"transfer": true}, {"swml":
...}); the SWML action key is uppercase SWML and must sit in the same action
object as transfer (mod_openai/actions.c reads both off one item). Also fix the
swaig.mdx action table, which listed the key as lowercase swml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hey-august
Copy link
Copy Markdown
Collaborator

Review

Should be good to go now. I added the following fixes:

  • Regenerated SWMLObject.json so the schema includes the transfer field
  • Checked the source code and documented both transfer forms:
    • boolean with a sibling SWML object
    • standalone object with dest and summarize
  • Fixed contradiction in _actions.mdx, where transfer was labeled boolean but kept object sub-fields
  • Corrected the transfer.dest description. It resolves to a SWML section or URL, not a phone number or SIP URI
  • Replaced the old two-object pattern in swml.mdx with the single-object form.
  • Fixed the swaig.mdx action table, which listed the key as lowercase swml. (It has to be all caps)

Copy link
Copy Markdown
Collaborator

@hey-august hey-august left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but @Manny-r31 since I made quite a few edits you'll probably want to confirm it looks good to you as well!

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.

2 participants