@signalwire/sdk 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/AgentBase.d.ts +29 -0
- package/dist/AgentBase.js +84 -22
- package/dist/AgentBase.js.map +1 -1
- package/dist/DataMap.d.ts +28 -0
- package/dist/DataMap.js +43 -0
- package/dist/DataMap.js.map +1 -1
- package/dist/FunctionResult.d.ts +32 -0
- package/dist/FunctionResult.js +39 -0
- package/dist/FunctionResult.js.map +1 -1
- package/dist/SWMLService.d.ts +11 -1
- package/dist/SWMLService.js +21 -2
- package/dist/SWMLService.js.map +1 -1
- package/dist/SemanticGate.d.ts +183 -0
- package/dist/SemanticGate.js +533 -0
- package/dist/SemanticGate.js.map +1 -0
- package/dist/SwaigFunction.d.ts +29 -3
- package/dist/SwaigFunction.js +19 -3
- package/dist/SwaigFunction.js.map +1 -1
- package/dist/cli/tsdocs/api-index.json +1 -1
- package/dist/cli/tsdocs/topics.js +4 -0
- package/dist/cli/tsdocs/topics.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/skills/SkillBase.d.ts +14 -1
- package/dist/skills/SkillBase.js.map +1 -1
- package/docs/api-reference.md +110 -3
- package/docs/datamap-guide.md +51 -4
- package/docs/swaig-reference.md +48 -0
- package/package.json +1 -1
|
@@ -216,6 +216,9 @@ agent.defineTool({
|
|
|
216
216
|
call's SWML.
|
|
217
217
|
- A tool call is a request from the model, not an authorization. Check
|
|
218
218
|
identity, state and business rules in the handler.
|
|
219
|
+
- \`gates: [new SemanticGate(...)]\` adds semantic gates: yes/no questions a
|
|
220
|
+
decision model answers about the call before the platform runs the tool.
|
|
221
|
+
A platform release without semantic gates runs the tool ungated.
|
|
219
222
|
`,
|
|
220
223
|
docs: [
|
|
221
224
|
['docs/swaig-reference.md', 'Every FunctionResult method and action'],
|
|
@@ -238,6 +241,7 @@ agent.defineTool({
|
|
|
238
241
|
'FunctionResult.swmlChangeStep',
|
|
239
242
|
'FunctionResult.setPostProcess',
|
|
240
243
|
'SwaigRequest',
|
|
244
|
+
'SemanticGate',
|
|
241
245
|
],
|
|
242
246
|
related: ['datamap', 'contexts', 'skills', 'security', 'pgi'],
|
|
243
247
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topics.js","sourceRoot":"","sources":["../../../src/cli/tsdocs/topics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2BH,MAAM,UAAU,GAAU;IACxB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,yCAAyC;IAChD,OAAO,EAAE,yDAAyD;IAClE,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCP;IACC,IAAI,EAAE;QACJ,CAAC,WAAW,EAAE,+DAA+D,CAAC;QAC9E,CAAC,qBAAqB,EAAE,mCAAmC,CAAC;KAC7D;IACD,QAAQ,EAAE;QACR,8BAA8B;QAC9B,8BAA8B;QAC9B,6BAA6B;KAC9B;IACD,GAAG,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrD,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,GAAU;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,uBAAuB;IAC9B,OAAO,EAAE,+DAA+D;IACxE,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BP;IACC,IAAI,EAAE;QACJ,CAAC,qBAAqB,EAAE,2DAA2D,CAAC;QACpF,CAAC,sBAAsB,EAAE,mEAAmE,CAAC;QAC7F,CAAC,uBAAuB,EAAE,sDAAsD,CAAC;QACjF,CAAC,sBAAsB,EAAE,6CAA6C,CAAC;QACvE,CAAC,uBAAuB,EAAE,wCAAwC,CAAC;QACnE,CAAC,yBAA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D;IAC3E,CAAC,+BAA+B,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC,gDAAgD,EAAE,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC,oCAAoC,EAAE,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC,qBAAqB,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC,6BAA6B,EAAE,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC,8BAA8B,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC,8BAA8B,EAAE,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC,wBAAwB,EAAE,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,oCAAoC,EAAE,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAClC,CAAC,2BAA2B,EAAE,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,6EAA6E;QAC3E,oGAAoG;IACtG,yEAAyE;QACvE,oDAAoD;IACtD,qEAAqE;QACnE,0DAA0D;IAC5D,8EAA8E;QAC5E,+BAA+B;IACjC,+EAA+E;QAC7E,yDAAyD;IAC3D,oFAAoF;CACrF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export { FunctionResult } from './FunctionResult.js';
|
|
|
72
72
|
export { FunctionResult as SwaigFunctionResult } from './FunctionResult.js';
|
|
73
73
|
export type { PaymentPrompt, PaymentAction, PaymentParameter } from './FunctionResult.js';
|
|
74
74
|
export { SwaigFunction } from './SwaigFunction.js';
|
|
75
|
+
export { SemanticGate, gateDefinitions, applyGateFields, MAX_GATES, MAX_QUESTION_BYTES, MAX_CRITERIA_BYTES, MAX_ON_FAIL_BYTES, RESERVED_FUNCTION_NAMES, } from './SemanticGate.js';
|
|
76
|
+
export type { SemanticGateOptions, FillerPhrases } from './SemanticGate.js';
|
|
75
77
|
export type { SwaigHandler, SwaigFunctionOptions } from './SwaigFunction.js';
|
|
76
78
|
export { ParameterSchema, paramSchema, RECORD_FORMATS, RECORD_DIRECTIONS, TAP_DIRECTIONS, TAP_CODECS, } from './ParameterSchema.js';
|
|
77
79
|
export type { ParameterType, ParameterProperty, ParameterSchemaObject, RecordFormat, RecordDirection, TapDirection, TapCodec, } from './ParameterSchema.js';
|
package/dist/index.js
CHANGED
|
@@ -71,6 +71,7 @@ export { FunctionResult } from './FunctionResult.js';
|
|
|
71
71
|
/** @deprecated Use {@link FunctionResult} instead. */
|
|
72
72
|
export { FunctionResult as SwaigFunctionResult } from './FunctionResult.js';
|
|
73
73
|
export { SwaigFunction } from './SwaigFunction.js';
|
|
74
|
+
export { SemanticGate, gateDefinitions, applyGateFields, MAX_GATES, MAX_QUESTION_BYTES, MAX_CRITERIA_BYTES, MAX_ON_FAIL_BYTES, RESERVED_FUNCTION_NAMES, } from './SemanticGate.js';
|
|
74
75
|
// Typed SWAIG tool-parameter builder (Tier-2 flagship affordance for the
|
|
75
76
|
// explicit-params path; byte-identical to the untyped `parameters` blob).
|
|
76
77
|
export { ParameterSchema, paramSchema, RECORD_FORMATS, RECORD_DIRECTIONS, TAP_DIRECTIONS, TAP_CODECS, } from './ParameterSchema.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,mCAAmC;AACnC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,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prompt sections, hints, and global data.
|
|
6
6
|
*/
|
|
7
7
|
import type { SwaigHandler } from '../SwaigFunction.js';
|
|
8
|
+
import type { FillerPhrases, SemanticGate } from '../SemanticGate.js';
|
|
8
9
|
import type { SwaigRequest } from '../SwaigContracts.js';
|
|
9
10
|
import type { FunctionResult } from '../FunctionResult.js';
|
|
10
11
|
import type { AgentBase } from '../AgentBase.js';
|
|
@@ -26,7 +27,11 @@ export interface SkillToolDefinition {
|
|
|
26
27
|
handler: SwaigHandler;
|
|
27
28
|
/** Whether the tool requires secure (authenticated) invocation. */
|
|
28
29
|
secure?: boolean;
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Phrases the AI says while the tool runs, keyed by language code, `"auto"`
|
|
32
|
+
* or `"default"`; an entry may also be a list of phrases, a wait script
|
|
33
|
+
* (the type predates wait scripts, so one needs a cast).
|
|
34
|
+
*/
|
|
30
35
|
fillers?: Record<string, string[]>;
|
|
31
36
|
/** List of parameter names that are required. */
|
|
32
37
|
required?: string[];
|
|
@@ -41,6 +46,14 @@ export interface SkillToolDefinition {
|
|
|
41
46
|
* The flag is serialised as `"is_hangup_hook": true` in the SWAIG JSON.
|
|
42
47
|
*/
|
|
43
48
|
isHangupHook?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Semantic gates on the tool: yes/no preconditions a decision model checks
|
|
51
|
+
* right before the platform runs it (see {@link SemanticGate}). They win
|
|
52
|
+
* over gates in the skill's `swaig_fields`.
|
|
53
|
+
*/
|
|
54
|
+
gates?: ReadonlyArray<SemanticGate | Record<string, unknown>>;
|
|
55
|
+
/** Phrases the AI says while the gates are checked, shaped like `fillers`. */
|
|
56
|
+
gate_fillers?: FillerPhrases;
|
|
44
57
|
}
|
|
45
58
|
/**
|
|
46
59
|
* Build a {@link SkillToolDefinition} whose `handler` args are *inferred* from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillBase.js","sourceRoot":"","sources":["../../src/skills/SkillBase.ts"],"names":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C;IAED;;;;;OAKG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,WAA+B,CAAC;QACnD,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1C,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc;QAClB,OAAO,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACtD,CAAC"}
|
package/docs/api-reference.md
CHANGED
|
@@ -364,7 +364,7 @@ When `parameters` is a flat map of property definitions written inline, TypeScri
|
|
|
364
364
|
| `parameters` | `Record<string, unknown>` | `{}` | Property definitions, or a full JSON Schema object |
|
|
365
365
|
| `handler` | function | (required) | Called with `(args, rawData, agent)` |
|
|
366
366
|
| `secure` | `boolean` | `true` | Require a per-call token. The rendered SWML gives the tool its own `web_hook_url` with a `__token` for that function and call. Pass `false` to let the tool run without a token. |
|
|
367
|
-
| `fillers` | `Record<string, string[]>` | none |
|
|
367
|
+
| `fillers` | `Record<string, string[]>` | none | Phrases the AI says while the function runs, keyed by language code, `auto` or `default`, emitted as the function's `fillers`. The current language's own key is used; without one, the `auto` phrases are translated into that language on first use; without either, `default`. An entry may also be a list of phrases, a wait script, spoken one at a time while the call waits; the type predates wait scripts, so one needs a cast |
|
|
368
368
|
| `waitFile` | `string` | none | Audio URL, emitted as `wait_file` |
|
|
369
369
|
| `waitFileLoops` | `number` | none | Emitted as `wait_file_loops` |
|
|
370
370
|
| `required` | `string[]` | `[]` | Required parameter names, used when `parameters` is a flat map |
|
|
@@ -373,6 +373,10 @@ When `parameters` is a flat map of property definitions written inline, TypeScri
|
|
|
373
373
|
| `onError` | `SwaigErrorHandler` | none | Called when the handler throws; may return a `FunctionResult` to use as the response |
|
|
374
374
|
| `errorMessage` | `string` | A generic apology | Response used when the handler throws and no error hook returns one |
|
|
375
375
|
| `isTypedHandler` | `boolean` | `false` | Marks a handler that takes named parameters; `defineTypedTool()` sets it |
|
|
376
|
+
| `gates` | `(SemanticGate \| Record<string, unknown>)[]` | none | Semantic gates, 1 to 8. See [Semantic gates](#semantic-gates) |
|
|
377
|
+
| `gateFillers` | `FillerPhrases` | none | What the AI says while the gates are checked, shaped like `fillers`. Only with `gates` |
|
|
378
|
+
|
|
379
|
+
**Throws:** `Error` for a gate the platform would refuse, or `gateFillers` without `gates`.
|
|
376
380
|
|
|
377
381
|
The handler's third argument is the agent the request was configured on. With a dynamic config callback or `addPerCallConfig()`, that's the per-request copy. The handler's return value is the tool's response: context for the model, which decides what to say. See [SwaigHandler](#swaighandler) for how each return type is serialized.
|
|
378
382
|
|
|
@@ -393,6 +397,62 @@ agent.defineTool({
|
|
|
393
397
|
});
|
|
394
398
|
```
|
|
395
399
|
|
|
400
|
+
#### Semantic gates
|
|
401
|
+
|
|
402
|
+
A semantic gate is a yes/no question a decision model answers about the call right before the platform dispatches the function. Every gate on the function must pass for it to run. When one doesn't, the function isn't dispatched, and the model gets that gate's `on_fail` output instead, as if a data_map had returned it. The function's `fillers` and `wait_file` start only once its gates pass, so a blocked call never sounds as if the action were under way.
|
|
403
|
+
|
|
404
|
+
Semantic gates need a platform release that supports them. One that doesn't runs the function ungated, and may or may not log a warning about the unknown key, so don't rely on a gate to protect a function until your platform supports them.
|
|
405
|
+
|
|
406
|
+
The decision model sees three things, under these names: `conversation`, the recent dialogue; `semantic_state`, the call's `global_data.semantic_state`, which [`FunctionResult.setSemanticState()`](#data-actions) sets; and `proposed_function`, the function's name, description and arguments. Write each question as one proposition, and name what it's about with those names in backticks. The model reads literally: it doesn't do arithmetic or compare dates, so put a computed result in `semantic_state` instead of asking for it.
|
|
407
|
+
|
|
408
|
+
This tool runs only when the caller has explicitly asked to cancel:
|
|
409
|
+
|
|
410
|
+
```ts
|
|
411
|
+
import { FunctionResult, SemanticGate } from '@signalwire/sdk';
|
|
412
|
+
|
|
413
|
+
agent.defineTool({
|
|
414
|
+
name: 'cancel_account',
|
|
415
|
+
description: "Cancel the caller's account.",
|
|
416
|
+
handler: () => new FunctionResult('The account is cancelled.'),
|
|
417
|
+
gates: [
|
|
418
|
+
new SemanticGate(
|
|
419
|
+
'Has the caller explicitly asked to cancel their account in `conversation`?',
|
|
420
|
+
0.95,
|
|
421
|
+
new FunctionResult()
|
|
422
|
+
.setToolResponse(
|
|
423
|
+
'cancel_account was not run.',
|
|
424
|
+
'Ask the caller to confirm that they want to cancel.',
|
|
425
|
+
)
|
|
426
|
+
.updateGlobalData({ cancel_attempted: true }),
|
|
427
|
+
{
|
|
428
|
+
id: 'explicit_request',
|
|
429
|
+
trueMeans: 'The caller says they want to cancel.',
|
|
430
|
+
falseMeans: 'The caller asked about cancelling, or said something else.',
|
|
431
|
+
},
|
|
432
|
+
),
|
|
433
|
+
],
|
|
434
|
+
gateFillers: { default: ['Let me verify that.'] },
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
`new SemanticGate(question, threshold, onFail, opts?)` takes:
|
|
439
|
+
|
|
440
|
+
| Argument | Type | Description |
|
|
441
|
+
|----------|------|-------------|
|
|
442
|
+
| `question` | `string` | The yes/no question, at most 8 KB. Its `${...}` variables are expanded from the call's global data when the gate is checked |
|
|
443
|
+
| `threshold` | `number` | The probability of yes, above 0 and at most 1, at or above which the gate passes |
|
|
444
|
+
| `onFail` | `string \| FunctionResult \| Record<string, unknown>` | What the model gets when this is the first gate that fails: the tool result text, a `FunctionResult`, whose response and actions are used, or a data_map output object. It needs a response, and in the `tool_result`/`tool_prompt` form a `tool_result`: a blocked call must never read as a success. The `tool_prompt` becomes a system message after the tool result; OpenAI Realtime agents don't use it, so put what they need in the `tool_result`. The actions run as written, without template expansion |
|
|
445
|
+
| `opts.id` | `string` | 1 to 64 letters, digits or underscores, unique within the function. Default `gate_<n>`, 1-based |
|
|
446
|
+
| `opts.trueMeans`, `opts.falseMeans` | `string` | What yes and no mean, at most 2 KB each |
|
|
447
|
+
|
|
448
|
+
Gates are checked by the platform's rules when the tool is defined, and once more when the SWML is rendered. The platform refuses the whole function for an invalid gate, so the SDK throws instead. Gates aren't allowed on the hook names `startup_hook`, `hangup_hook` and `check_for_input`, on `end_call`, or on a built-in function's name. A gated function also needs a description, and a `web_hook_url` or `data_map`; tools the SDK builds always have them. A `gates` given as `null` is refused rather than dropped, since the platform refuses that function too.
|
|
449
|
+
|
|
450
|
+
The SDK is stricter than the platform in two ways: it refuses `gateFillers` without `gates`, which the platform would ignore, and it refuses a NUL character or an unpaired surrogate in a gate, which the platform would read differently.
|
|
451
|
+
|
|
452
|
+
When a gate check can't be completed, because the decision model timed out or failed, the call is blocked too, and the model is told the action couldn't be completed right now. [`setSemanticGates()`](#setsemanticgatesopts) sets the time a check may take.
|
|
453
|
+
|
|
454
|
+
The SDK checks the functions it renders. Functions it doesn't build, such as those a `onSwmlRequest` hook writes into the SWML, remote function includes, and functions an MCP server provides, aren't checked.
|
|
455
|
+
|
|
396
456
|
#### `defineTypedTool(opts)`
|
|
397
457
|
|
|
398
458
|
Register a tool whose handler takes the arguments as named positional parameters instead of an `args` object. When `parameters` is omitted, the SDK infers a schema from the handler's parameter names and default values.
|
|
@@ -409,9 +469,13 @@ defineTypedTool(opts: {
|
|
|
409
469
|
waitFile?: string;
|
|
410
470
|
waitFileLoops?: number;
|
|
411
471
|
required?: string[];
|
|
472
|
+
gates?: ReadonlyArray<SemanticGate | Record<string, unknown>>;
|
|
473
|
+
gateFillers?: FillerPhrases;
|
|
412
474
|
}): this
|
|
413
475
|
```
|
|
414
476
|
|
|
477
|
+
`gates` and `gateFillers` work as they do on [`defineTool()`](#semantic-gates).
|
|
478
|
+
|
|
415
479
|
#### `getTools()`
|
|
416
480
|
|
|
417
481
|
Get every registered `SwaigFunction`. DataMap and other raw function definitions aren't included. Calls `defineTools()` first if it hasn't run.
|
|
@@ -441,7 +505,7 @@ getTool(name: string): SwaigFunction | undefined
|
|
|
441
505
|
|
|
442
506
|
#### `registerSwaigFunction(fn)`
|
|
443
507
|
|
|
444
|
-
Register a `SwaigFunction`, or a raw function definition such as the output of `DataMap.toSwaigFunction()`. A raw definition is registered under its `function` key and rendered as is.
|
|
508
|
+
Register a `SwaigFunction`, or a raw function definition such as the output of `DataMap.toSwaigFunction()`. A raw definition is registered under its `function` key and rendered as is. A raw definition with `gates` or `gate_fillers` is checked by the platform's rules (see [Semantic gates](#semantic-gates)), and a normalized copy is registered; the object you pass is left as it was.
|
|
445
509
|
|
|
446
510
|
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
447
511
|
```ts
|
|
@@ -600,6 +664,27 @@ Merge entries into `params`.
|
|
|
600
664
|
setParams(params: Record<string, unknown>): this
|
|
601
665
|
```
|
|
602
666
|
|
|
667
|
+
#### `setSemanticGates(opts?)`
|
|
668
|
+
|
|
669
|
+
Set how the call checks its functions' [semantic gates](#semantic-gates). Each option left out leaves its current setting as it is; the platform's default applies to a setting that was never set.
|
|
670
|
+
|
|
671
|
+
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
672
|
+
```ts
|
|
673
|
+
setSemanticGates(opts?: { enabled?: boolean; timeoutMs?: number; history?: number }): this
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
| Option | Type | Default | Description |
|
|
677
|
+
|--------|------|---------|-------------|
|
|
678
|
+
| `enabled` | `boolean` | `true` | `false` dispatches gated functions without checking their gates. Sent as `semantic_gates_enabled` |
|
|
679
|
+
| `timeoutMs` | `number` | `2500` | The time one check may take, 500 to 10000 milliseconds. A check that runs out blocks the call. Sent as `semantic_gate_timeout_ms` |
|
|
680
|
+
| `history` | `number` | `20` | How many recent dialogue entries the decision model sees, 0 to 100. Sent as `semantic_gate_history` |
|
|
681
|
+
|
|
682
|
+
**Throws:** `Error` for a value of the wrong type or out of range; a refused call changes nothing.
|
|
683
|
+
|
|
684
|
+
```ts
|
|
685
|
+
agent.setSemanticGates({ timeoutMs: 4000, history: 30 });
|
|
686
|
+
```
|
|
687
|
+
|
|
603
688
|
#### `setGlobalData(data)`
|
|
604
689
|
|
|
605
690
|
Merge entries into `global_data`. Existing keys, including those a skill added, are kept unless `data` has the same key. To clear the object first, use `replaceGlobalData()`.
|
|
@@ -1443,6 +1528,7 @@ console.log(JSON.stringify(result.toDict()));
|
|
|
1443
1528
|
| `say` | `(text: string): this` | `{ say: text }` |
|
|
1444
1529
|
| `playBackgroundFile` | `(filename: string, wait?: boolean): this` | `{ playback_bg: filename }`, or `{ playback_bg: { file, wait: true } }` when `wait` is `true` |
|
|
1445
1530
|
| `stopBackgroundFile` | `(): this` | `{ stop_playback_bg: true }` |
|
|
1531
|
+
| `changeVoice` | `(voice: string): this` | `{ change_voice: voice }`. Changes the AI's voice for the rest of the call, from the next batch of speech on; `voice` is in the `engine.voice:model` form a language's voice takes. Throws on an empty voice |
|
|
1446
1532
|
|
|
1447
1533
|
### Speech Actions
|
|
1448
1534
|
|
|
@@ -1459,6 +1545,7 @@ console.log(JSON.stringify(result.toDict()));
|
|
|
1459
1545
|
|--------|-----------|-------|
|
|
1460
1546
|
| `updateGlobalData` | `(data: Record<string, unknown>): this` | `{ set_global_data: data }` |
|
|
1461
1547
|
| `removeGlobalData` | `(keys: string \| string[]): this` | `{ unset_global_data: keys }` |
|
|
1548
|
+
| `setSemanticState` | `(state: Record<string, unknown>): this` | `{ set_global_data: { semantic_state: state } }`. Replaces the state [semantic gates](#semantic-gates) judge, as a whole; send `{}` to reset it |
|
|
1462
1549
|
| `setMetadata` | `(data: Record<string, unknown>): this` | `{ set_meta_data: data }` |
|
|
1463
1550
|
| `removeMetadata` | `(keys: string \| string[]): this` | `{ unset_meta_data: keys }` |
|
|
1464
1551
|
|
|
@@ -1791,6 +1878,24 @@ Set `error_keys` on the `data_map`. The platform reads `error_keys` only on a we
|
|
|
1791
1878
|
globalErrorKeys(keys: string[]): this
|
|
1792
1879
|
```
|
|
1793
1880
|
|
|
1881
|
+
#### `gate(gate)`
|
|
1882
|
+
|
|
1883
|
+
Add a [semantic gate](#semantic-gates), a yes/no precondition a decision model checks right before the platform runs the function. Call once per gate, up to 8. When a gate fails, the data_map doesn't run, and the model gets that gate's `on_fail` output. `toSwaigFunction()` throws for a gate the platform would refuse, checking it after environment variables are expanded.
|
|
1884
|
+
|
|
1885
|
+
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
1886
|
+
```ts
|
|
1887
|
+
gate(gate: SemanticGate | Record<string, unknown>): this
|
|
1888
|
+
```
|
|
1889
|
+
|
|
1890
|
+
#### `gateFillers(fillers)`
|
|
1891
|
+
|
|
1892
|
+
Set what the AI says while the function's gates are checked, shaped like a function's fillers. Only for a function with gates.
|
|
1893
|
+
|
|
1894
|
+
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
1895
|
+
```ts
|
|
1896
|
+
gateFillers(fillers: FillerPhrases): this
|
|
1897
|
+
```
|
|
1898
|
+
|
|
1794
1899
|
### DataMap Registration and Serialization
|
|
1795
1900
|
|
|
1796
1901
|
#### `registerWithAgent(agent)`
|
|
@@ -3323,7 +3428,7 @@ interface SwaigFunctionOptions
|
|
|
3323
3428
|
| `description` | `string` | (required) | Description the model reads |
|
|
3324
3429
|
| `parameters` | `Record<string, unknown>` | `{}` | Property definitions or a full JSON Schema object |
|
|
3325
3430
|
| `secure` | `boolean` | `true` | Require a per-call token; `false` lets the tool run without one |
|
|
3326
|
-
| `fillers` | `Record<string, string[]>` | none |
|
|
3431
|
+
| `fillers` | `Record<string, string[]>` | none | Phrases said while the function runs, keyed by language code, `auto` or `default`; an entry may also be a wait script, with a cast |
|
|
3327
3432
|
| `waitFile` | `string` | none | Wait audio URL |
|
|
3328
3433
|
| `waitFileLoops` | `number` | none | Wait audio loop count |
|
|
3329
3434
|
| `webhookUrl` | `string` | none | External URL that runs the tool |
|
|
@@ -3332,6 +3437,8 @@ interface SwaigFunctionOptions
|
|
|
3332
3437
|
| `isTypedHandler` | `boolean` | `false` | Whether the handler takes named parameters |
|
|
3333
3438
|
| `onError` | `SwaigErrorHandler` | none | Per-tool error hook |
|
|
3334
3439
|
| `errorMessage` | `string` | A generic apology | Response when the handler throws and no hook returns one |
|
|
3440
|
+
| `gates` | `(SemanticGate \| Record<string, unknown>)[]` | none | [Semantic gates](#semantic-gates), 1 to 8 |
|
|
3441
|
+
| `gateFillers` | `FillerPhrases` | none | Phrases said while the gates are checked. Only with `gates` |
|
|
3335
3442
|
|
|
3336
3443
|
### AuthConfig
|
|
3337
3444
|
|
package/docs/datamap-guide.md
CHANGED
|
@@ -5,13 +5,14 @@ This page is the reference for the `DataMap` class in the SignalWire AI Agents T
|
|
|
5
5
|
<!-- snippet-setup -->
|
|
6
6
|
```ts
|
|
7
7
|
export {}; // treat each runnable example as a module
|
|
8
|
-
// Shared context the examples assume: `DataMap`/`FunctionResult` (imported
|
|
9
|
-
// reused), `agent` (an AgentBase), and `tool` (the DataMap built in the current
|
|
10
|
-
// Declared as ambient globals so each fragment resolves without repeating the
|
|
11
|
-
// A block that constructs or imports its own `const tool`/`DataMap` shadows these.
|
|
8
|
+
// Shared context the examples assume: `DataMap`/`FunctionResult`/`SemanticGate` (imported
|
|
9
|
+
// once and reused), `agent` (an AgentBase), and `tool` (the DataMap built in the current
|
|
10
|
+
// example). Declared as ambient globals so each fragment resolves without repeating the
|
|
11
|
+
// boilerplate. A block that constructs or imports its own `const tool`/`DataMap` shadows these.
|
|
12
12
|
declare global {
|
|
13
13
|
const DataMap: typeof import('@signalwire/sdk').DataMap;
|
|
14
14
|
const FunctionResult: typeof import('@signalwire/sdk').FunctionResult;
|
|
15
|
+
const SemanticGate: typeof import('@signalwire/sdk').SemanticGate;
|
|
15
16
|
const agent: import('@signalwire/sdk').AgentBase;
|
|
16
17
|
const tool: import('@signalwire/sdk').DataMap;
|
|
17
18
|
}
|
|
@@ -43,6 +44,9 @@ The page has these sections:
|
|
|
43
44
|
- [fallbackOutput](#fallbackoutput)
|
|
44
45
|
- [errorKeys](#errorkeys)
|
|
45
46
|
- [globalErrorKeys](#globalerrorkeys)
|
|
47
|
+
- [Semantic Gates](#semantic-gates)
|
|
48
|
+
- [gate](#gate)
|
|
49
|
+
- [gateFillers](#gatefillers)
|
|
46
50
|
- [Iteration](#iteration)
|
|
47
51
|
- [foreach](#foreach)
|
|
48
52
|
- [Environment Variables](#environment-variables)
|
|
@@ -629,6 +633,49 @@ With a ZIP code, the platform requests the first webhook. With only a city, it s
|
|
|
629
633
|
|
|
630
634
|
---
|
|
631
635
|
|
|
636
|
+
## Semantic Gates
|
|
637
|
+
|
|
638
|
+
A semantic gate is a yes/no question a decision model answers about the call right before the platform runs the function. When a gate fails, the data_map doesn't run at all: no expression or webhook is tried, and the model gets the gate's `on_fail` output. The [API reference](api-reference.md#semantic-gates) describes gates and their limits. They need a platform release that supports them; one that doesn't runs the function ungated.
|
|
639
|
+
|
|
640
|
+
### gate
|
|
641
|
+
|
|
642
|
+
This method adds a gate. Call it once per gate, up to 8.
|
|
643
|
+
|
|
644
|
+
<!-- snippet: no-compile API signature / illustrative fragment, not runnable -->
|
|
645
|
+
```typescript
|
|
646
|
+
gate(gate: SemanticGate | Record<string, unknown>): this
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
`toSwaigFunction()` checks the gates by the platform's rules, after environment variables are expanded, and throws for one the platform would refuse. This tool places an order only once the caller has confirmed it:
|
|
650
|
+
|
|
651
|
+
<!-- snippet: no-run illustrative fragment: references the assumed `DataMap` and `SemanticGate` from the page prelude (declared type-only in the shared snippet-setup), not a standalone program -->
|
|
652
|
+
```typescript
|
|
653
|
+
const placeOrder = new DataMap('place_order')
|
|
654
|
+
.purpose('Place the order the caller confirmed')
|
|
655
|
+
.webhook('POST', 'https://orders.example.com/orders')
|
|
656
|
+
.params({ item: '${args.item}' })
|
|
657
|
+
.output(new FunctionResult('The order is placed.'))
|
|
658
|
+
.gate(
|
|
659
|
+
new SemanticGate(
|
|
660
|
+
'Has the caller confirmed the order in `conversation`?',
|
|
661
|
+
0.9,
|
|
662
|
+
'place_order was not run.',
|
|
663
|
+
),
|
|
664
|
+
)
|
|
665
|
+
.gateFillers({ default: ['Let me check that.'] });
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
### gateFillers
|
|
669
|
+
|
|
670
|
+
This method sets what the AI says while the gates are checked, shaped like a function's fillers: phrases keyed by language code, `auto` or `default`. It's only for a function with gates.
|
|
671
|
+
|
|
672
|
+
<!-- snippet: no-compile API signature / illustrative fragment, not runnable -->
|
|
673
|
+
```typescript
|
|
674
|
+
gateFillers(fillers: FillerPhrases): this
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
632
679
|
## Iteration
|
|
633
680
|
|
|
634
681
|
### foreach
|
package/docs/swaig-reference.md
CHANGED
|
@@ -43,6 +43,7 @@ The reference groups the methods by what they do:
|
|
|
43
43
|
- [say](#say)
|
|
44
44
|
- [playBackgroundFile](#playbackgroundfile)
|
|
45
45
|
- [stopBackgroundFile](#stopbackgroundfile)
|
|
46
|
+
- [changeVoice](#changevoice)
|
|
46
47
|
- [Speech](#speech)
|
|
47
48
|
- [addDynamicHints](#adddynamichints)
|
|
48
49
|
- [clearDynamicHints](#cleardynamichints)
|
|
@@ -51,6 +52,7 @@ The reference groups the methods by what they do:
|
|
|
51
52
|
- [Data Management](#data-management)
|
|
52
53
|
- [updateGlobalData](#updateglobaldata)
|
|
53
54
|
- [removeGlobalData](#removeglobaldata)
|
|
55
|
+
- [setSemanticState](#setsemanticstate)
|
|
54
56
|
- [setMetadata](#setmetadata)
|
|
55
57
|
- [removeMetadata](#removemetadata)
|
|
56
58
|
- [SWML Actions](#swml-actions)
|
|
@@ -702,6 +704,29 @@ const result = new FunctionResult('The music is stopped.')
|
|
|
702
704
|
.stopBackgroundFile();
|
|
703
705
|
```
|
|
704
706
|
|
|
707
|
+
### changeVoice
|
|
708
|
+
|
|
709
|
+
Change the AI's voice for the rest of the call (`change_voice`). The voice takes the `engine.voice:model` form a language's voice takes, and may be on another engine. It replaces the current language's voice from the next batch of speech on, never mid-utterance, and stays for that language for the rest of the call. A voice that won't open falls back to the fallback voice.
|
|
710
|
+
|
|
711
|
+
<!-- snippet: no-compile API signature reference, not runnable code -->
|
|
712
|
+
```typescript
|
|
713
|
+
changeVoice(voice: string): this
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
| Parameter | Type | Description |
|
|
717
|
+
|-----------|----------|--------------------------------------------------------|
|
|
718
|
+
| `voice` | `string` | The voice as `engine.voice:model`, such as `elevenlabs.rachel`. |
|
|
719
|
+
|
|
720
|
+
**Returns:** `this` for chaining.
|
|
721
|
+
|
|
722
|
+
**Throws:** `Error` when `voice` is empty or only whitespace. The platform would ignore it.
|
|
723
|
+
|
|
724
|
+
**Example:**
|
|
725
|
+
|
|
726
|
+
```typescript
|
|
727
|
+
const result = new FunctionResult('The voice is changed.').changeVoice('elevenlabs.rachel');
|
|
728
|
+
```
|
|
729
|
+
|
|
705
730
|
## Speech
|
|
706
731
|
|
|
707
732
|
### addDynamicHints
|
|
@@ -822,6 +847,29 @@ const result = new FunctionResult('The customer record is loaded.')
|
|
|
822
847
|
.updateGlobalData({ customer_id: 'C-123', tier: 'premium' });
|
|
823
848
|
```
|
|
824
849
|
|
|
850
|
+
### setSemanticState
|
|
851
|
+
|
|
852
|
+
Set the state the call's semantic gates judge, besides the dialogue: `global_data.semantic_state` (sent as `set_global_data`). It replaces the state as a whole: to change one field, send the whole state with that field changed, and send `{}` to reset it. Keep it to what the application has established, such as an order the caller confirmed, rather than what the caller claims. It's the only global data copied into the decision model's state; a gate question can still bring in other global data with a `${global_data.x}` template. See [Semantic gates](api-reference.md#semantic-gates).
|
|
853
|
+
|
|
854
|
+
<!-- snippet: no-compile API signature reference, not runnable code -->
|
|
855
|
+
```typescript
|
|
856
|
+
setSemanticState(state: Record<string, unknown>): this
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
| Parameter | Type | Description |
|
|
860
|
+
|-----------|---------------------------|---------------------|
|
|
861
|
+
| `state` | `Record<string, unknown>` | The semantic state. |
|
|
862
|
+
|
|
863
|
+
**Returns:** `this` for chaining.
|
|
864
|
+
|
|
865
|
+
**Example:**
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
const result = new FunctionResult('The order is confirmed.').setSemanticState({
|
|
869
|
+
order: { item: 'large pepperoni', confirmed: true },
|
|
870
|
+
});
|
|
871
|
+
```
|
|
872
|
+
|
|
825
873
|
### removeGlobalData
|
|
826
874
|
|
|
827
875
|
Remove one or more keys from the global data (`unset_global_data`).
|