Skip to content

Content redaction guide: pay example runs set before pay and uses boolean security_code / postal_code #956

Open

Description

@hey-august

Page: /docs/platform/ai/content-redaction (fern/products/platform/pages/ai/guides/content-redaction/index.mdx:92-108)

The pay example's SWML action runs set with ${pay_result} before pay:

"main": [
  { "set": { "ai_response": "The payment result was ${pay_result}. …" } },
  { "pay": { "...": "..." } }
]

set resolves ${pay_result} when it runs, and an unset variable resolves to nothing, so the agent is told a blank result. Put pay first.

The same block has "security_code": true and "postal_code": true. The platform reads these as the strings "true" / "false" and ignores a JSON boolean, so the example should use the string form, as the SWML pay reference now does.

Found during the #867 review; the lines are outside that PR's hunks. The TypeScript SDK's FunctionResult.pay() currently emits the same set-before-pay order (signalwire/signalwire-typescript issue filed separately).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions