@signalwire/sdk 2.0.5 → 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 +821 -0
- package/LICENSE +21 -0
- package/README.md +163 -68
- package/dist/AGENTS.md +13 -0
- package/dist/AgentBase.d.ts +510 -126
- package/dist/AgentBase.js +1581 -455
- package/dist/AgentBase.js.map +1 -1
- package/dist/AgentServer.d.ts +21 -0
- package/dist/AgentServer.js +154 -47
- package/dist/AgentServer.js.map +1 -1
- package/dist/AuthHandler.d.ts +14 -2
- package/dist/AuthHandler.js +7 -2
- package/dist/AuthHandler.js.map +1 -1
- package/dist/ConfigLoader.d.ts +5 -13
- package/dist/ConfigLoader.js +15 -29
- package/dist/ConfigLoader.js.map +1 -1
- package/dist/ContextBuilder.d.ts +202 -9
- package/dist/ContextBuilder.js +219 -36
- package/dist/ContextBuilder.js.map +1 -1
- package/dist/DataMap.d.ts +186 -45
- package/dist/DataMap.js +210 -52
- package/dist/DataMap.js.map +1 -1
- package/dist/FunctionResult.d.ts +309 -83
- package/dist/FunctionResult.js +483 -116
- package/dist/FunctionResult.js.map +1 -1
- package/dist/Logger.d.ts +30 -5
- package/dist/Logger.js +77 -19
- package/dist/Logger.js.map +1 -1
- package/dist/POM/PromptObjectModel.d.ts +12 -1
- package/dist/POM/PromptObjectModel.js +25 -9
- package/dist/POM/PromptObjectModel.js.map +1 -1
- package/dist/ParameterSchema.d.ts +306 -0
- package/dist/ParameterSchema.js +251 -0
- package/dist/ParameterSchema.js.map +1 -0
- package/dist/PlatformContracts.d.ts +21 -0
- package/dist/PlatformContracts.generated.d.ts +109 -0
- package/dist/PlatformContracts.generated.js +8 -0
- package/dist/PlatformContracts.generated.js.map +1 -0
- package/dist/PlatformContracts.js +2 -0
- package/dist/PlatformContracts.js.map +1 -0
- package/dist/PomBuilder.d.ts +18 -0
- package/dist/PomBuilder.js +53 -3
- package/dist/PomBuilder.js.map +1 -1
- package/dist/PostPrompt.d.ts +110 -0
- package/dist/PostPrompt.js +204 -0
- package/dist/PostPrompt.js.map +1 -0
- package/dist/PromptManager.d.ts +22 -1
- package/dist/PromptManager.js +28 -1
- package/dist/PromptManager.js.map +1 -1
- package/dist/PublicFetch.d.ts +132 -0
- package/dist/PublicFetch.js +311 -0
- package/dist/PublicFetch.js.map +1 -0
- package/dist/RobotsTxt.d.ts +41 -0
- package/dist/RobotsTxt.js +152 -0
- package/dist/RobotsTxt.js.map +1 -0
- package/dist/SWMLHandler.js.map +1 -1
- package/dist/SWMLService.d.ts +169 -59
- package/dist/SWMLService.js +456 -129
- package/dist/SWMLService.js.map +1 -1
- package/dist/SchemaUtils.d.ts +115 -2
- package/dist/SchemaUtils.js +444 -12
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/SecurityUtils.d.ts +49 -9
- package/dist/SecurityUtils.js +153 -51
- package/dist/SecurityUtils.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/ServerlessAdapter.d.ts +156 -7
- package/dist/ServerlessAdapter.js +399 -42
- package/dist/ServerlessAdapter.js.map +1 -1
- package/dist/SessionManager.d.ts +11 -2
- package/dist/SessionManager.js +50 -18
- package/dist/SessionManager.js.map +1 -1
- package/dist/SslConfig.d.ts +2 -1
- package/dist/SslConfig.js +4 -1
- package/dist/SslConfig.js.map +1 -1
- package/dist/SwaigActions.generated.d.ts +23 -0
- package/dist/SwaigActions.generated.js +8 -0
- package/dist/SwaigActions.generated.js.map +1 -0
- package/dist/SwaigContracts.d.ts +15 -0
- package/dist/SwaigContracts.generated.d.ts +264 -0
- package/dist/SwaigContracts.generated.js +12 -0
- package/dist/SwaigContracts.generated.js.map +1 -0
- package/dist/SwaigContracts.js +2 -0
- package/dist/SwaigContracts.js.map +1 -0
- package/dist/SwaigFunction.d.ts +139 -7
- package/dist/SwaigFunction.js +170 -22
- package/dist/SwaigFunction.js.map +1 -1
- package/dist/SwmlBuilder.d.ts +68 -19
- package/dist/SwmlBuilder.js +74 -38
- package/dist/SwmlBuilder.js.map +1 -1
- package/dist/SwmlVerbMethods.generated.d.ts +41 -4
- package/dist/SwmlVerbMethods.generated.js +1 -1
- package/dist/TypeInference.d.ts +39 -3
- package/dist/TypeInference.js +256 -16
- package/dist/TypeInference.js.map +1 -1
- package/dist/WebService.d.ts +79 -11
- package/dist/WebService.js +320 -109
- package/dist/WebService.js.map +1 -1
- package/dist/WebhookMiddleware.d.ts +119 -0
- package/dist/WebhookMiddleware.js +271 -0
- package/dist/WebhookMiddleware.js.map +1 -0
- package/dist/WebhookValidator.d.ts +92 -0
- package/dist/WebhookValidator.js +409 -0
- package/dist/WebhookValidator.js.map +1 -0
- package/dist/agents/BedrockAgent.d.ts +162 -0
- package/dist/agents/BedrockAgent.js +323 -0
- package/dist/agents/BedrockAgent.js.map +1 -0
- package/dist/ai-chat/AIChatClient.d.ts +316 -0
- package/dist/ai-chat/AIChatClient.js +535 -0
- package/dist/ai-chat/AIChatClient.js.map +1 -0
- package/dist/ai-chat/ChatGateway.d.ts +408 -0
- package/dist/ai-chat/ChatGateway.js +747 -0
- package/dist/ai-chat/ChatGateway.js.map +1 -0
- package/dist/ai-chat/HandoffRouter.d.ts +282 -0
- package/dist/ai-chat/HandoffRouter.js +518 -0
- package/dist/ai-chat/HandoffRouter.js.map +1 -0
- package/dist/ai-chat/index.d.ts +12 -0
- package/dist/ai-chat/index.js +10 -0
- package/dist/ai-chat/index.js.map +1 -0
- package/dist/capabilities.d.ts +64 -0
- package/dist/capabilities.js +95 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli/agent-loader.d.ts +32 -6
- package/dist/cli/agent-loader.js +92 -33
- package/dist/cli/agent-loader.js.map +1 -1
- package/dist/cli/datamap-exec.d.ts +175 -0
- package/dist/cli/datamap-exec.js +1284 -0
- package/dist/cli/datamap-exec.js.map +1 -0
- package/dist/cli/function-args.d.ts +40 -0
- package/dist/cli/function-args.js +146 -0
- package/dist/cli/function-args.js.map +1 -0
- package/dist/cli/simulation.d.ts +99 -0
- package/dist/cli/simulation.js +490 -0
- package/dist/cli/simulation.js.map +1 -0
- package/dist/cli/swaig-test.d.ts +12 -25
- package/dist/cli/swaig-test.js +935 -371
- package/dist/cli/swaig-test.js.map +1 -1
- package/dist/cli/tsdocs/agentsNote.d.ts +30 -0
- package/dist/cli/tsdocs/agentsNote.js +92 -0
- package/dist/cli/tsdocs/agentsNote.js.map +1 -0
- package/dist/cli/tsdocs/api-index.json +1 -0
- package/dist/cli/tsdocs/api.d.ts +91 -0
- package/dist/cli/tsdocs/api.js +372 -0
- package/dist/cli/tsdocs/api.js.map +1 -0
- package/dist/cli/tsdocs/apiTypes.d.ts +64 -0
- package/dist/cli/tsdocs/apiTypes.js +7 -0
- package/dist/cli/tsdocs/apiTypes.js.map +1 -0
- package/dist/cli/tsdocs/bin.d.ts +6 -0
- package/dist/cli/tsdocs/bin.js +23 -0
- package/dist/cli/tsdocs/bin.js.map +1 -0
- package/dist/cli/tsdocs/files.d.ts +108 -0
- package/dist/cli/tsdocs/files.js +287 -0
- package/dist/cli/tsdocs/files.js.map +1 -0
- package/dist/cli/tsdocs/index.d.ts +28 -0
- package/dist/cli/tsdocs/index.js +307 -0
- package/dist/cli/tsdocs/index.js.map +1 -0
- package/dist/cli/tsdocs/live.d.ts +41 -0
- package/dist/cli/tsdocs/live.js +202 -0
- package/dist/cli/tsdocs/live.js.map +1 -0
- package/dist/cli/tsdocs/locate.d.ts +51 -0
- package/dist/cli/tsdocs/locate.js +75 -0
- package/dist/cli/tsdocs/locate.js.map +1 -0
- package/dist/cli/tsdocs/render.d.ts +75 -0
- package/dist/cli/tsdocs/render.js +323 -0
- package/dist/cli/tsdocs/render.js.map +1 -0
- package/dist/cli/tsdocs/topics.d.ts +43 -0
- package/dist/cli/tsdocs/topics.js +920 -0
- package/dist/cli/tsdocs/topics.js.map +1 -0
- package/dist/index.d.ts +49 -68
- package/dist/index.js +45 -73
- package/dist/index.js.map +1 -1
- package/dist/livewire/index.d.ts +229 -155
- package/dist/livewire/index.js +298 -195
- package/dist/livewire/index.js.map +1 -1
- package/dist/llms.txt +65 -0
- package/dist/prefabs/CallSessionStore.d.ts +52 -0
- package/dist/prefabs/CallSessionStore.js +72 -0
- package/dist/prefabs/CallSessionStore.js.map +1 -0
- package/dist/prefabs/ConciergeAgent.d.ts +13 -1
- package/dist/prefabs/ConciergeAgent.js +36 -31
- package/dist/prefabs/ConciergeAgent.js.map +1 -1
- package/dist/prefabs/FAQBotAgent.d.ts +9 -1
- package/dist/prefabs/FAQBotAgent.js +113 -47
- package/dist/prefabs/FAQBotAgent.js.map +1 -1
- package/dist/prefabs/InfoGathererAgent.d.ts +22 -3
- package/dist/prefabs/InfoGathererAgent.js +67 -58
- package/dist/prefabs/InfoGathererAgent.js.map +1 -1
- package/dist/prefabs/ReceptionistAgent.d.ts +16 -5
- package/dist/prefabs/ReceptionistAgent.js +39 -31
- package/dist/prefabs/ReceptionistAgent.js.map +1 -1
- package/dist/prefabs/SurveyAgent.d.ts +22 -4
- package/dist/prefabs/SurveyAgent.js +84 -68
- package/dist/prefabs/SurveyAgent.js.map +1 -1
- package/dist/relay/Action.d.ts +44 -21
- package/dist/relay/Action.js +75 -17
- package/dist/relay/Action.js.map +1 -1
- package/dist/relay/Call.d.ts +312 -47
- package/dist/relay/Call.js +369 -18
- package/dist/relay/Call.js.map +1 -1
- package/dist/relay/Deferred.js.map +1 -1
- package/dist/relay/Message.d.ts +26 -5
- package/dist/relay/Message.js +36 -6
- package/dist/relay/Message.js.map +1 -1
- package/dist/relay/RelayClient.d.ts +44 -17
- package/dist/relay/RelayClient.js +175 -65
- package/dist/relay/RelayClient.js.map +1 -1
- package/dist/relay/RelayError.d.ts +14 -0
- package/dist/relay/RelayError.js +15 -0
- package/dist/relay/RelayError.js.map +1 -1
- package/dist/relay/RelayEvent.d.ts +96 -65
- package/dist/relay/RelayEvent.js +85 -56
- package/dist/relay/RelayEvent.js.map +1 -1
- package/dist/relay/closedSets.d.ts +111 -0
- package/dist/relay/closedSets.js +83 -0
- package/dist/relay/closedSets.js.map +1 -0
- package/dist/relay/index.d.ts +3 -1
- package/dist/relay/index.js +1 -0
- package/dist/relay/index.js.map +1 -1
- package/dist/relay/normalize.js.map +1 -1
- package/dist/relay/protocol.types.generated.d.ts +1195 -0
- package/dist/relay/protocol.types.generated.js +8 -0
- package/dist/relay/protocol.types.generated.js.map +1 -0
- package/dist/relay/types.d.ts +73 -42
- package/dist/rest/HttpClient.d.ts +36 -8
- package/dist/rest/HttpClient.js +233 -40
- package/dist/rest/HttpClient.js.map +1 -1
- package/dist/rest/RequestOptions.d.ts +110 -0
- package/dist/rest/RequestOptions.js +113 -0
- package/dist/rest/RequestOptions.js.map +1 -0
- package/dist/rest/RestError.d.ts +52 -6
- package/dist/rest/RestError.js +89 -5
- package/dist/rest/RestError.js.map +1 -1
- package/dist/rest/base/CrudResource.d.ts +16 -26
- package/dist/rest/base/CrudResource.js +19 -33
- package/dist/rest/base/CrudResource.js.map +1 -1
- package/dist/rest/base/CrudWithAddresses.d.ts +3 -2
- package/dist/rest/base/CrudWithAddresses.js +2 -2
- package/dist/rest/base/CrudWithAddresses.js.map +1 -1
- package/dist/rest/base/FabricResource.d.ts +15 -0
- package/dist/rest/base/FabricResource.js +16 -0
- package/dist/rest/base/FabricResource.js.map +1 -0
- package/dist/rest/base/ReadResource.d.ts +62 -0
- package/dist/rest/base/ReadResource.js +69 -0
- package/dist/rest/base/ReadResource.js.map +1 -0
- package/dist/rest/callHandler.d.ts +5 -2
- package/dist/rest/callHandler.js +4 -1
- package/dist/rest/callHandler.js.map +1 -1
- package/dist/rest/index.d.ts +18 -77
- package/dist/rest/index.js +47 -120
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/namespaces/_client_tree_generated.d.ts +103 -0
- package/dist/rest/namespaces/_client_tree_generated.js +171 -0
- package/dist/rest/namespaces/_client_tree_generated.js.map +1 -0
- package/dist/rest/namespaces/addresses.d.ts +3 -42
- package/dist/rest/namespaces/addresses.js +3 -50
- package/dist/rest/namespaces/addresses.js.map +1 -1
- package/dist/rest/namespaces/calling.d.ts +6 -378
- package/dist/rest/namespaces/calling.js +6 -473
- package/dist/rest/namespaces/calling.js.map +1 -1
- package/dist/rest/namespaces/calling.resources.generated.d.ts +165 -0
- package/dist/rest/namespaces/calling.resources.generated.js +477 -0
- package/dist/rest/namespaces/calling.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/calling.types.generated.d.ts +2917 -0
- package/dist/rest/namespaces/calling.types.generated.js +8 -0
- package/dist/rest/namespaces/calling.types.generated.js.map +1 -0
- package/dist/rest/namespaces/chat.d.ts +4 -18
- package/dist/rest/namespaces/chat.js +4 -21
- package/dist/rest/namespaces/chat.js.map +1 -1
- package/dist/rest/namespaces/chat.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/chat.resources.generated.js +29 -0
- package/dist/rest/namespaces/chat.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/chat.types.generated.d.ts +56 -0
- package/dist/rest/namespaces/chat.types.generated.js +8 -0
- package/dist/rest/namespaces/chat.types.generated.js.map +1 -0
- package/dist/rest/namespaces/datasphere.d.ts +6 -62
- package/dist/rest/namespaces/datasphere.js +6 -72
- package/dist/rest/namespaces/datasphere.js.map +1 -1
- package/dist/rest/namespaces/datasphere.resources.generated.d.ts +25 -0
- package/dist/rest/namespaces/datasphere.resources.generated.js +50 -0
- package/dist/rest/namespaces/datasphere.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/datasphere.types.generated.d.ts +180 -0
- package/dist/rest/namespaces/datasphere.types.generated.js +8 -0
- package/dist/rest/namespaces/datasphere.types.generated.js.map +1 -0
- package/dist/rest/namespaces/fabric.d.ts +11 -327
- package/dist/rest/namespaces/fabric.js +14 -439
- package/dist/rest/namespaces/fabric.js.map +1 -1
- package/dist/rest/namespaces/fabric.resources.generated.d.ts +195 -0
- package/dist/rest/namespaces/fabric.resources.generated.js +399 -0
- package/dist/rest/namespaces/fabric.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/fabric.types.generated.d.ts +4557 -0
- package/dist/rest/namespaces/fabric.types.generated.js +8 -0
- package/dist/rest/namespaces/fabric.types.generated.js.map +1 -0
- package/dist/rest/namespaces/fax.resources.generated.d.ts +6 -0
- package/dist/rest/namespaces/fax.resources.generated.js +14 -0
- package/dist/rest/namespaces/fax.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/fax.types.generated.d.ts +131 -0
- package/dist/rest/namespaces/fax.types.generated.js +8 -0
- package/dist/rest/namespaces/fax.types.generated.js.map +1 -0
- package/dist/rest/namespaces/imported-numbers.d.ts +3 -18
- package/dist/rest/namespaces/imported-numbers.js +3 -21
- package/dist/rest/namespaces/imported-numbers.js.map +1 -1
- package/dist/rest/namespaces/logs.d.ts +10 -101
- package/dist/rest/namespaces/logs.js +10 -128
- package/dist/rest/namespaces/logs.js.map +1 -1
- package/dist/rest/namespaces/logs.resources.generated.d.ts +9 -0
- package/dist/rest/namespaces/logs.resources.generated.js +17 -0
- package/dist/rest/namespaces/logs.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/logs.types.generated.d.ts +131 -0
- package/dist/rest/namespaces/logs.types.generated.js +8 -0
- package/dist/rest/namespaces/logs.types.generated.js.map +1 -0
- package/dist/rest/namespaces/lookup.d.ts +3 -25
- package/dist/rest/namespaces/lookup.js +3 -27
- package/dist/rest/namespaces/lookup.js.map +1 -1
- package/dist/rest/namespaces/message.resources.generated.d.ts +6 -0
- package/dist/rest/namespaces/message.resources.generated.js +14 -0
- package/dist/rest/namespaces/message.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/message.types.generated.d.ts +122 -0
- package/dist/rest/namespaces/message.types.generated.js +8 -0
- package/dist/rest/namespaces/message.types.generated.js.map +1 -0
- package/dist/rest/namespaces/messages.resources.generated.d.ts +18 -0
- package/dist/rest/namespaces/messages.resources.generated.js +44 -0
- package/dist/rest/namespaces/messages.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/messages.types.generated.d.ts +99 -0
- package/dist/rest/namespaces/messages.types.generated.js +8 -0
- package/dist/rest/namespaces/messages.types.generated.js.map +1 -0
- package/dist/rest/namespaces/mfa.d.ts +3 -42
- package/dist/rest/namespaces/mfa.js +3 -49
- package/dist/rest/namespaces/mfa.js.map +1 -1
- package/dist/rest/namespaces/number-groups.d.ts +3 -45
- package/dist/rest/namespaces/number-groups.js +3 -53
- package/dist/rest/namespaces/number-groups.js.map +1 -1
- package/dist/rest/namespaces/phone-numbers.d.ts +8 -196
- package/dist/rest/namespaces/phone-numbers.js +8 -230
- package/dist/rest/namespaces/phone-numbers.js.map +1 -1
- package/dist/rest/namespaces/project.d.ts +6 -42
- package/dist/rest/namespaces/project.js +6 -51
- package/dist/rest/namespaces/project.js.map +1 -1
- package/dist/rest/namespaces/project.resources.generated.d.ts +17 -0
- package/dist/rest/namespaces/project.resources.generated.js +44 -0
- package/dist/rest/namespaces/project.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/project.types.generated.d.ts +58 -0
- package/dist/rest/namespaces/project.types.generated.js +8 -0
- package/dist/rest/namespaces/project.types.generated.js.map +1 -0
- package/dist/rest/namespaces/projects.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/projects.resources.generated.js +25 -0
- package/dist/rest/namespaces/projects.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/projects.types.generated.d.ts +77 -0
- package/dist/rest/namespaces/projects.types.generated.js +8 -0
- package/dist/rest/namespaces/projects.types.generated.js.map +1 -0
- package/dist/rest/namespaces/pubsub.d.ts +4 -18
- package/dist/rest/namespaces/pubsub.js +4 -21
- package/dist/rest/namespaces/pubsub.js.map +1 -1
- package/dist/rest/namespaces/pubsub.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/pubsub.resources.generated.js +29 -0
- package/dist/rest/namespaces/pubsub.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/pubsub.types.generated.d.ts +60 -0
- package/dist/rest/namespaces/pubsub.types.generated.js +8 -0
- package/dist/rest/namespaces/pubsub.types.generated.js.map +1 -0
- package/dist/rest/namespaces/queues.d.ts +3 -38
- package/dist/rest/namespaces/queues.js +3 -44
- package/dist/rest/namespaces/queues.js.map +1 -1
- package/dist/rest/namespaces/recordings.d.ts +3 -34
- package/dist/rest/namespaces/recordings.js +3 -40
- package/dist/rest/namespaces/recordings.js.map +1 -1
- package/dist/rest/namespaces/registry.d.ts +6 -137
- package/dist/rest/namespaces/registry.js +6 -173
- package/dist/rest/namespaces/registry.js.map +1 -1
- package/dist/rest/namespaces/relay-rest.resources.generated.d.ts +168 -0
- package/dist/rest/namespaces/relay-rest.resources.generated.js +430 -0
- package/dist/rest/namespaces/relay-rest.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/relay-rest.types.generated.d.ts +1906 -0
- package/dist/rest/namespaces/relay-rest.types.generated.js +8 -0
- package/dist/rest/namespaces/relay-rest.types.generated.js.map +1 -0
- package/dist/rest/namespaces/short-codes.d.ts +3 -35
- package/dist/rest/namespaces/short-codes.js +3 -41
- package/dist/rest/namespaces/short-codes.js.map +1 -1
- package/dist/rest/namespaces/sip-profile.d.ts +3 -24
- package/dist/rest/namespaces/sip-profile.js +3 -29
- package/dist/rest/namespaces/sip-profile.js.map +1 -1
- package/dist/rest/namespaces/verified-callers.d.ts +3 -29
- package/dist/rest/namespaces/verified-callers.js +3 -34
- package/dist/rest/namespaces/verified-callers.js.map +1 -1
- package/dist/rest/namespaces/video.d.ts +10 -227
- package/dist/rest/namespaces/video.js +10 -288
- package/dist/rest/namespaces/video.js.map +1 -1
- package/dist/rest/namespaces/video.resources.generated.d.ts +81 -0
- package/dist/rest/namespaces/video.resources.generated.js +171 -0
- package/dist/rest/namespaces/video.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/video.types.generated.d.ts +771 -0
- package/dist/rest/namespaces/video.types.generated.js +8 -0
- package/dist/rest/namespaces/video.types.generated.js.map +1 -0
- package/dist/rest/namespaces/voice.resources.generated.d.ts +9 -0
- package/dist/rest/namespaces/voice.resources.generated.js +17 -0
- package/dist/rest/namespaces/voice.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/voice.types.generated.d.ts +214 -0
- package/dist/rest/namespaces/voice.types.generated.js +8 -0
- package/dist/rest/namespaces/voice.types.generated.js.map +1 -0
- package/dist/rest/pagination.d.ts +5 -1
- package/dist/rest/pagination.js +40 -20
- package/dist/rest/pagination.js.map +1 -1
- package/dist/rest/types.d.ts +21 -3
- package/dist/schema.json +299 -98
- package/dist/skills/SkillBase.d.ts +111 -21
- package/dist/skills/SkillBase.js +100 -17
- package/dist/skills/SkillBase.js.map +1 -1
- package/dist/skills/SkillManager.d.ts +66 -13
- package/dist/skills/SkillManager.js +101 -20
- package/dist/skills/SkillManager.js.map +1 -1
- package/dist/skills/SkillName.d.ts +44 -0
- package/dist/skills/SkillName.js +2 -0
- package/dist/skills/SkillName.js.map +1 -0
- package/dist/skills/SkillRegistry.d.ts +22 -11
- package/dist/skills/SkillRegistry.js +47 -17
- package/dist/skills/SkillRegistry.js.map +1 -1
- package/dist/skills/builtin/api_ninjas_trivia.d.ts +3 -1
- package/dist/skills/builtin/api_ninjas_trivia.js +18 -6
- package/dist/skills/builtin/api_ninjas_trivia.js.map +1 -1
- package/dist/skills/builtin/ask_claude.d.ts +14 -4
- package/dist/skills/builtin/ask_claude.js +36 -14
- package/dist/skills/builtin/ask_claude.js.map +1 -1
- package/dist/skills/builtin/claude_skills.d.ts +3 -1
- package/dist/skills/builtin/claude_skills.js +19 -15
- package/dist/skills/builtin/claude_skills.js.map +1 -1
- package/dist/skills/builtin/custom_skills.d.ts +10 -3
- package/dist/skills/builtin/custom_skills.js +26 -9
- package/dist/skills/builtin/custom_skills.js.map +1 -1
- package/dist/skills/builtin/datasphere.d.ts +5 -3
- package/dist/skills/builtin/datasphere.js +21 -22
- package/dist/skills/builtin/datasphere.js.map +1 -1
- package/dist/skills/builtin/datasphere_serverless.d.ts +12 -1
- package/dist/skills/builtin/datasphere_serverless.js +17 -6
- package/dist/skills/builtin/datasphere_serverless.js.map +1 -1
- package/dist/skills/builtin/datetime.d.ts +3 -1
- package/dist/skills/builtin/datetime.js +11 -7
- package/dist/skills/builtin/datetime.js.map +1 -1
- package/dist/skills/builtin/google_maps.d.ts +29 -14
- package/dist/skills/builtin/google_maps.js +89 -269
- package/dist/skills/builtin/google_maps.js.map +1 -1
- package/dist/skills/builtin/index.d.ts +8 -6
- package/dist/skills/builtin/index.js +8 -6
- package/dist/skills/builtin/index.js.map +1 -1
- package/dist/skills/builtin/info_gatherer.d.ts +4 -2
- package/dist/skills/builtin/info_gatherer.js +20 -12
- package/dist/skills/builtin/info_gatherer.js.map +1 -1
- package/dist/skills/builtin/joke.d.ts +16 -6
- package/dist/skills/builtin/joke.js +54 -37
- package/dist/skills/builtin/joke.js.map +1 -1
- package/dist/skills/builtin/math.d.ts +3 -1
- package/dist/skills/builtin/math.js +14 -9
- package/dist/skills/builtin/math.js.map +1 -1
- package/dist/skills/builtin/mcp_gateway.d.ts +34 -5
- package/dist/skills/builtin/mcp_gateway.js +77 -46
- package/dist/skills/builtin/mcp_gateway.js.map +1 -1
- package/dist/skills/builtin/native_vector_search.d.ts +19 -5
- package/dist/skills/builtin/native_vector_search.js +179 -61
- package/dist/skills/builtin/native_vector_search.js.map +1 -1
- package/dist/skills/builtin/play_background_file.d.ts +21 -15
- package/dist/skills/builtin/play_background_file.js +43 -122
- package/dist/skills/builtin/play_background_file.js.map +1 -1
- package/dist/skills/builtin/spider.d.ts +42 -4
- package/dist/skills/builtin/spider.js +277 -104
- package/dist/skills/builtin/spider.js.map +1 -1
- package/dist/skills/builtin/swml_transfer.d.ts +14 -3
- package/dist/skills/builtin/swml_transfer.js +45 -24
- package/dist/skills/builtin/swml_transfer.js.map +1 -1
- package/dist/skills/builtin/weather_api.d.ts +24 -13
- package/dist/skills/builtin/weather_api.js +38 -30
- package/dist/skills/builtin/weather_api.js.map +1 -1
- package/dist/skills/builtin/web_search.d.ts +48 -10
- package/dist/skills/builtin/web_search.js +294 -100
- package/dist/skills/builtin/web_search.js.map +1 -1
- package/dist/skills/builtin/wikipedia_search.d.ts +4 -2
- package/dist/skills/builtin/wikipedia_search.js +14 -13
- package/dist/skills/builtin/wikipedia_search.js.map +1 -1
- package/dist/skills/index.d.ts +3 -2
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/swml_verbs_generated.d.ts +2824 -0
- package/dist/swml_verbs_generated.js +12 -0
- package/dist/swml_verbs_generated.js.map +1 -0
- package/dist/types.d.ts +59 -6
- package/dist/web.d.ts +27 -0
- package/dist/web.js +20 -0
- package/dist/web.js.map +1 -0
- package/docs/agent-guide.md +1034 -0
- package/docs/ai_chat.md +560 -0
- package/docs/api-reference.md +3641 -0
- package/docs/architecture.md +846 -0
- package/docs/bedrock_agent.md +411 -0
- package/docs/cli-guide.md +403 -0
- package/docs/cloud_functions_guide.md +399 -0
- package/docs/configuration.md +548 -0
- package/docs/contexts-guide.md +884 -0
- package/docs/datamap-guide.md +1207 -0
- package/docs/developer_pain_points.md +548 -0
- package/docs/llm_parameters.md +298 -0
- package/docs/mcp_gateway_reference.md +354 -0
- package/docs/mcp_integration.md +162 -0
- package/docs/pgi_agent_guide.md +1820 -0
- package/docs/prefabs-guide.md +815 -0
- package/docs/programmatically_governed_inference.md +301 -0
- package/docs/sdk_features.md +501 -0
- package/docs/security.md +559 -0
- package/docs/serverless-guide.md +520 -0
- package/docs/skills-guide.md +1223 -0
- package/docs/skills-system.md +405 -0
- package/docs/skills_parameter_schema.md +417 -0
- package/docs/swaig-reference.md +1986 -0
- package/docs/swml_service_guide.md +573 -0
- package/docs/third_party_skills.md +410 -0
- package/docs/web_service.md +666 -0
- package/examples/README.md +202 -0
- package/examples/advanced-datamap.ts +108 -0
- package/examples/advanced-dynamic-config.ts +70 -0
- package/examples/auto-vivified.ts +95 -0
- package/examples/call-flow.ts +65 -0
- package/examples/comprehensive-dynamic.ts +125 -0
- package/examples/contexts-steps.ts +65 -0
- package/examples/custom-path.ts +45 -0
- package/examples/datamap-tools.ts +51 -0
- package/examples/datasphere-multi-instance.ts +66 -0
- package/examples/datasphere-serverless-env.ts +87 -0
- package/examples/datasphere-webhook-env.ts +65 -0
- package/examples/datasphere.ts +56 -0
- package/examples/declarative.ts +100 -0
- package/examples/dynamic-config.ts +54 -0
- package/examples/dynamic-info-gatherer.ts +69 -0
- package/examples/dynamic-swml-service.ts +67 -0
- package/examples/gather-info.ts +95 -0
- package/examples/gather-per-question-functions-demo.ts +139 -0
- package/examples/joke-agent.ts +34 -0
- package/examples/kubernetes-agent.ts +45 -0
- package/examples/llm-params.ts +75 -0
- package/examples/mcp-agent.ts +89 -0
- package/examples/mcp-gateway.ts +81 -0
- package/examples/multi-agent.ts +80 -0
- package/examples/multi-endpoint.ts +79 -0
- package/examples/pgi/case-domain.ts +114 -0
- package/examples/pgi/serve.ts +16 -0
- package/examples/pgi/support-agent.ts +265 -0
- package/examples/pom-prompt.ts +70 -0
- package/examples/prefab-concierge.ts +42 -0
- package/examples/prefab-faq.ts +58 -0
- package/examples/prefab-info-gatherer.ts +33 -0
- package/examples/prefab-receptionist.ts +36 -0
- package/examples/prefab-survey.ts +69 -0
- package/examples/quickstart-agent.ts +29 -0
- package/examples/quickstart-relay.ts +25 -0
- package/examples/quickstart-rest.ts +25 -0
- package/examples/record-call.ts +65 -0
- package/examples/relay-demo.ts +33 -0
- package/examples/room-and-sip.ts +93 -0
- package/examples/serverless-lambda.ts +43 -0
- package/examples/session-state.ts +83 -0
- package/examples/simple-agent.ts +36 -0
- package/examples/simple-static.ts +29 -0
- package/examples/skills-demo.ts +41 -0
- package/examples/step-function-inheritance-demo.ts +124 -0
- package/examples/swaig-features.ts +193 -0
- package/examples/swml-service-routing.ts +66 -0
- package/examples/swml-service.ts +38 -0
- package/examples/swmlservice_ai_sidecar.ts +104 -0
- package/examples/swmlservice_swaig_standalone.ts +79 -0
- package/examples/tap.ts +67 -0
- package/examples/typed-tools.ts +68 -0
- package/examples/verb-methods.ts +45 -0
- package/examples/web-search-multi-instance.ts +75 -0
- package/examples/web-search.ts +38 -0
- package/examples/wikipedia.ts +36 -0
- package/livewire/README.md +164 -0
- package/livewire/docs/migration-guide.md +251 -0
- package/livewire/examples/livewire-basic-agent.ts +74 -0
- package/livewire/examples/livewire-handoff.ts +196 -0
- package/livewire/examples/livewire-multi-tool.ts +121 -0
- package/package.json +85 -13
- package/relay/README.md +101 -0
- package/relay/docs/call-methods.md +622 -0
- package/relay/docs/client-reference.md +281 -0
- package/relay/docs/events.md +193 -0
- package/relay/docs/getting-started.md +221 -0
- package/relay/docs/guide.md +386 -0
- package/relay/docs/messaging.md +246 -0
- package/relay/examples/relay-inbound.ts +66 -0
- package/relay/examples/relay-messaging.ts +74 -0
- package/relay/examples/relay-outbound.ts +76 -0
- package/rest/README.md +141 -0
- package/rest/docs/calling.md +313 -0
- package/rest/docs/client-reference.md +149 -0
- package/rest/docs/fabric.md +192 -0
- package/rest/docs/getting-started.md +138 -0
- package/rest/docs/guide.md +421 -0
- package/rest/docs/namespaces.md +367 -0
- package/rest/docs/phone-binding.md +116 -0
- package/rest/examples/rest-10dlc-registration.ts +177 -0
- package/rest/examples/rest-bind-phone-to-swml-webhook.ts +66 -0
- package/rest/examples/rest-calling-ivr-and-ai.ts +136 -0
- package/rest/examples/rest-calling-play-and-record.ts +98 -0
- package/rest/examples/rest-client.ts +59 -0
- package/rest/examples/rest-datasphere-search.ts +81 -0
- package/rest/examples/rest-fabric-conferences-and-routing.ts +147 -0
- package/rest/examples/rest-fabric-subscribers-and-sip.ts +106 -0
- package/rest/examples/rest-fabric-swml-and-callflows.ts +101 -0
- package/rest/examples/rest-manage-resources.ts +64 -0
- package/rest/examples/rest-phone-number-management.ts +200 -0
- package/rest/examples/rest-queues-mfa-and-recordings.ts +143 -0
- package/rest/examples/rest-video-rooms.ts +186 -0
- package/tutorial/fred/fred.ts +218 -0
- package/tutorial/fred/tutorial/01-introduction.md +141 -0
- package/tutorial/fred/tutorial/02-setup.md +304 -0
- package/tutorial/fred/tutorial/03-basic-agent.md +284 -0
- package/tutorial/fred/tutorial/04-wikipedia-skill.md +298 -0
- package/tutorial/fred/tutorial/05-custom-functions.md +347 -0
- package/tutorial/fred/tutorial/06-running-testing.md +642 -0
- package/tutorial/fred/tutorial/README.md +56 -0
- package/tutorial/fred/tutorial/appendix-complete-code.md +632 -0
- package/tutorial/fred/tutorial/appendix-docker-deployment.md +504 -0
- package/tutorial/full-guardrails-agent/handlers.ts +436 -0
- package/tutorial/full-guardrails-agent/penny.ts +305 -0
- package/tutorial/full-guardrails-agent/reservations.ts +1109 -0
- package/tutorial/full-guardrails-agent/tutorial/01-why-guardrails.md +149 -0
- package/tutorial/full-guardrails-agent/tutorial/02-design-first.md +139 -0
- package/tutorial/full-guardrails-agent/tutorial/03-rules-first.md +422 -0
- package/tutorial/full-guardrails-agent/tutorial/04-the-shell.md +238 -0
- package/tutorial/full-guardrails-agent/tutorial/05-steps-and-scoping.md +247 -0
- package/tutorial/full-guardrails-agent/tutorial/06-tools-that-decide.md +467 -0
- package/tutorial/full-guardrails-agent/tutorial/07-gather-and-projection.md +160 -0
- package/tutorial/full-guardrails-agent/tutorial/08-the-verification-gate.md +333 -0
- package/tutorial/full-guardrails-agent/tutorial/09-people-and-endings.md +313 -0
- package/tutorial/full-guardrails-agent/tutorial/10-testing-and-running.md +387 -0
- package/tutorial/full-guardrails-agent/tutorial/README.md +106 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-complete-code.md +2207 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-deployment.md +191 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-technique-map.md +117 -0
- package/tutorial/full-guardrails-agent/workflow.ts +219 -0
- package/tutorial/multi_agents/README.md +175 -0
- package/tutorial/multi_agents/advanced_agent.ts +395 -0
- package/tutorial/multi_agents/extending_agents.ts +641 -0
- package/tutorial/multi_agents/knowledge.ts +59 -0
- package/tutorial/multi_agents/lesson1_first_agent.md +368 -0
- package/tutorial/multi_agents/lesson2_knowledge_bases.md +404 -0
- package/tutorial/multi_agents/lesson3_multi_agent_systems.md +621 -0
- package/tutorial/multi_agents/lesson4_advanced_features.md +805 -0
- package/tutorial/multi_agents/lesson5_extending_agents.md +856 -0
- package/tutorial/multi_agents/pc_builder.ts +529 -0
- package/tutorial/multi_agents/sales_agent.ts +88 -0
- package/tutorial/multi_agents/sales_agent_with_search.ts +116 -0
- package/tutorial/multi_agents/sales_knowledge.md +139 -0
- package/tutorial/multi_agents/support_knowledge.md +256 -0
- package/dist/cli/mock-data.d.ts +0 -37
- package/dist/cli/mock-data.js +0 -80
- package/dist/cli/mock-data.js.map +0 -1
- package/dist/generateVerbTypes.d.ts +0 -11
- package/dist/generateVerbTypes.js +0 -265
- package/dist/generateVerbTypes.js.map +0 -1
- package/dist/rest/namespaces/compat.d.ts +0 -585
- package/dist/rest/namespaces/compat.js +0 -735
- package/dist/rest/namespaces/compat.js.map +0 -1
|
@@ -0,0 +1,2824 @@
|
|
|
1
|
+
export interface Section {
|
|
2
|
+
main?: SWMLMethod[];
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
export type SWMLMethod = Answer | AI | AmazonBedrock | Cond | Connect | Denoise | EnterQueue | Execute | Goto | Label | LiveTranscribe | AiSidecar | LiveTranslate | Hangup | JoinRoom | JoinConference | Play | Prompt | ReceiveFax | Record_ | RecordCall | Request | Return | SendDigits | SendFax | SendSMS | Set_ | Sleep | SIPRefer | StopDenoise | StopRecordCall | StopTap | Switch | Tap | Transfer | Unset | Pay | DetectMachine | UserEvent;
|
|
6
|
+
export interface Answer {
|
|
7
|
+
/** Answer incoming call and set an optional maximum duration. */
|
|
8
|
+
answer?: {
|
|
9
|
+
/** Maximum duration in seconds for the call. Defaults to `14400` seconds (4 hours). */
|
|
10
|
+
max_duration?: number | SWMLVar;
|
|
11
|
+
/** Comma-separated string of codecs to offer. Valid codecs are: PCMU, PCMA, G722, G729, AMR-WB, OPUS, VP8, H264. */
|
|
12
|
+
codecs?: string;
|
|
13
|
+
/** Username to use for SIP authentication. */
|
|
14
|
+
username?: string;
|
|
15
|
+
/** Password to use for SIP authentication. */
|
|
16
|
+
password?: string;
|
|
17
|
+
[key: string]: Record<string, unknown> | number | SWMLVar | string | undefined;
|
|
18
|
+
};
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface AI {
|
|
22
|
+
/** Creates an AI agent that conducts voice conversations using automatic speech recognition (ASR), */
|
|
23
|
+
ai?: AIObject;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface AmazonBedrock {
|
|
27
|
+
/** Creates a new Bedrock AI Agent */
|
|
28
|
+
amazon_bedrock?: AmazonBedrockObject;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface Cond {
|
|
32
|
+
/** Execute a sequence of instructions depending on the value of a JavaScript condition. */
|
|
33
|
+
cond?: CondParams[];
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
export interface Connect {
|
|
37
|
+
/** Dial a SIP URI or phone number. */
|
|
38
|
+
connect?: ConnectDeviceSingle | ConnectDeviceSerial | ConnectDeviceParallel | ConnectDeviceSerialParallel;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface Denoise {
|
|
42
|
+
/** Start noise reduction. You can stop it at any time using `stop_denoise`. */
|
|
43
|
+
denoise?: {
|
|
44
|
+
[key: string]: Record<string, unknown>;
|
|
45
|
+
};
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface EnterQueue {
|
|
49
|
+
/** Place the current call in a named queue where it will wait to be connected to an available agent or resource. */
|
|
50
|
+
enter_queue?: EnterQueueObject;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface Execute {
|
|
54
|
+
/** Execute a specified section or URL as a subroutine, and upon completion, return to the current document. */
|
|
55
|
+
execute?: {
|
|
56
|
+
/** Specifies what to execute. The value can be one of: */
|
|
57
|
+
dest: string;
|
|
58
|
+
/** Named parameters to send to section or URL */
|
|
59
|
+
params?: {
|
|
60
|
+
[key: string]: Record<string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
/** User-defined metadata, ignored by SignalWire */
|
|
63
|
+
meta?: {
|
|
64
|
+
[key: string]: Record<string, unknown>;
|
|
65
|
+
};
|
|
66
|
+
/** The list of SWML instructions to be executed when the executed section or URL returns */
|
|
67
|
+
on_return?: SWMLMethod[];
|
|
68
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
69
|
+
result?: ExecuteSwitch | CondParams[];
|
|
70
|
+
[key: string]: Record<string, unknown> | string | {
|
|
71
|
+
[key: string]: Record<string, unknown>;
|
|
72
|
+
} | SWMLMethod[] | ExecuteSwitch | CondParams[] | undefined;
|
|
73
|
+
};
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
export interface Goto {
|
|
77
|
+
/** Jump to a label within the current section, optionally based on a condition. */
|
|
78
|
+
goto?: {
|
|
79
|
+
/** Mark any point of the SWML section with a label so that goto can jump to it. */
|
|
80
|
+
label: string;
|
|
81
|
+
/** A JavaScript condition that determines whether to perform the jump. If the condition evaluates to true, the jump is executed. If omitted, the jump is unconditional. */
|
|
82
|
+
when?: string;
|
|
83
|
+
/** The maximum number of times to perform the jump. Must be a number between 1 and 100. Default `100`. */
|
|
84
|
+
max?: number | SWMLVar;
|
|
85
|
+
[key: string]: Record<string, unknown> | string | number | SWMLVar | undefined;
|
|
86
|
+
};
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
export interface Label {
|
|
90
|
+
/** Mark any point of the SWML section with a label so that goto can jump to it. */
|
|
91
|
+
label?: string;
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
}
|
|
94
|
+
export interface LiveTranscribe {
|
|
95
|
+
/** Start live transcription of the call. The transcription will be sent to the specified webhook URL. */
|
|
96
|
+
live_transcribe?: {
|
|
97
|
+
/** The action to perform during live transcription. */
|
|
98
|
+
action: TranscribeAction;
|
|
99
|
+
[key: string]: Record<string, unknown> | TranscribeAction;
|
|
100
|
+
};
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
}
|
|
103
|
+
export interface LiveTranslate {
|
|
104
|
+
/** Start live translation of the call. The translation will be sent to the specified webhook URL. */
|
|
105
|
+
live_translate?: {
|
|
106
|
+
/** The action to perform during live translation. */
|
|
107
|
+
action: TranslateAction;
|
|
108
|
+
[key: string]: Record<string, unknown> | TranslateAction;
|
|
109
|
+
};
|
|
110
|
+
[key: string]: unknown;
|
|
111
|
+
}
|
|
112
|
+
export interface Hangup {
|
|
113
|
+
/** End the call with an optional reason. */
|
|
114
|
+
hangup?: {
|
|
115
|
+
/** The reason for hanging up the call. */
|
|
116
|
+
reason?: string;
|
|
117
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
118
|
+
};
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}
|
|
121
|
+
export interface JoinRoom {
|
|
122
|
+
/** Join a RELAY room. If the room doesn't exist, it creates a new room. */
|
|
123
|
+
join_room?: {
|
|
124
|
+
/** Name of the room to join. Allowed characters: A-Z, a-z, 0-9, underscore, and hyphen. */
|
|
125
|
+
name: string;
|
|
126
|
+
[key: string]: Record<string, unknown> | string;
|
|
127
|
+
};
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
export interface JoinConference {
|
|
131
|
+
/** Join an ad-hoc audio conference started on either the SignalWire or Compatibility API. */
|
|
132
|
+
join_conference?: JoinConferenceObject;
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
}
|
|
135
|
+
export interface Play {
|
|
136
|
+
/** Play file(s), ringtones, speech or silence. */
|
|
137
|
+
play?: PlayWithURL | PlayWithURLS;
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
export interface Prompt {
|
|
141
|
+
/** Play a prompt and wait for input. The input can be received either as digits from the keypad, */
|
|
142
|
+
prompt?: {
|
|
143
|
+
/** URL or array of URLs to play. */
|
|
144
|
+
play: play_url | play_url[] | SWMLVar | SWMLVar[];
|
|
145
|
+
/** Volume level for the audio file. */
|
|
146
|
+
volume?: number;
|
|
147
|
+
/** The voice to use for the text to speech. */
|
|
148
|
+
say_voice?: string;
|
|
149
|
+
/** The language to use for the text to speech. */
|
|
150
|
+
say_language?: string;
|
|
151
|
+
/** The gender to use for the text to speech. */
|
|
152
|
+
say_gender?: 'male' | 'female';
|
|
153
|
+
/** Number of digits to collect. */
|
|
154
|
+
max_digits?: number | SWMLVar;
|
|
155
|
+
/** Digits that terminate digit collection. */
|
|
156
|
+
terminators?: string;
|
|
157
|
+
/** Time in seconds to wait for next digit. */
|
|
158
|
+
digit_timeout?: number | SWMLVar;
|
|
159
|
+
/** Time in seconds to wait for start of input. */
|
|
160
|
+
initial_timeout?: number | SWMLVar;
|
|
161
|
+
/** Max time in seconds to wait for speech result. */
|
|
162
|
+
speech_timeout?: number | SWMLVar;
|
|
163
|
+
/** Time in seconds to wait for end of speech utterance. */
|
|
164
|
+
speech_end_timeout?: number | SWMLVar;
|
|
165
|
+
/** Language to detect speech in. */
|
|
166
|
+
speech_language?: string;
|
|
167
|
+
/** Expected words or phrases to help the speech recognition. */
|
|
168
|
+
speech_hints?: string[] | SWMLVar[];
|
|
169
|
+
/** The engine that is selected for speech recognition. The engine must support the specified language. */
|
|
170
|
+
speech_engine?: string;
|
|
171
|
+
/** http or https URL to deliver prompt status events */
|
|
172
|
+
status_url?: string;
|
|
173
|
+
[key: string]: Record<string, unknown> | play_url | play_url[] | SWMLVar | SWMLVar[] | number | string | 'male' | 'female' | number | SWMLVar | string[] | SWMLVar[] | undefined;
|
|
174
|
+
};
|
|
175
|
+
[key: string]: unknown;
|
|
176
|
+
}
|
|
177
|
+
export interface ReceiveFax {
|
|
178
|
+
/** Receive a fax being delivered to this call. */
|
|
179
|
+
receive_fax?: {
|
|
180
|
+
/** http or https URL to deliver receive_fax status events */
|
|
181
|
+
status_url?: string;
|
|
182
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
183
|
+
};
|
|
184
|
+
[key: string]: unknown;
|
|
185
|
+
}
|
|
186
|
+
export interface Record_ {
|
|
187
|
+
/** Record the call audio in the foreground, pausing further SWML execution until recording ends. */
|
|
188
|
+
record?: {
|
|
189
|
+
/** If true, record in stereo. */
|
|
190
|
+
stereo?: boolean | SWMLVar;
|
|
191
|
+
/** The format to record in. Can be `wav`, `mp3`, or `mp4`. */
|
|
192
|
+
format?: 'wav' | 'mp3' | 'mp4';
|
|
193
|
+
/** Direction of the audio to record: "speak" for what party says, "listen" for what party hears. */
|
|
194
|
+
direction?: 'speak' | 'listen';
|
|
195
|
+
/** String of digits that will stop the recording when pressed. Default is `"#"`. */
|
|
196
|
+
terminators?: string;
|
|
197
|
+
/** Play a beep before recording. */
|
|
198
|
+
beep?: boolean | SWMLVar;
|
|
199
|
+
/** How sensitive the recording voice activity detector is to background noise. */
|
|
200
|
+
input_sensitivity?: number | SWMLVar;
|
|
201
|
+
/** Time in seconds to wait for the start of speech. */
|
|
202
|
+
initial_timeout?: number | SWMLVar;
|
|
203
|
+
/** Time in seconds to wait in silence before ending the recording. */
|
|
204
|
+
end_silence_timeout?: number | SWMLVar;
|
|
205
|
+
/** Maximum length of the recording in seconds. */
|
|
206
|
+
max_length?: number | SWMLVar;
|
|
207
|
+
/** URL to send recording status events to. */
|
|
208
|
+
status_url?: string;
|
|
209
|
+
[key: string]: Record<string, unknown> | boolean | SWMLVar | 'wav' | 'mp3' | 'mp4' | 'speak' | 'listen' | string | number | SWMLVar | undefined;
|
|
210
|
+
};
|
|
211
|
+
[key: string]: unknown;
|
|
212
|
+
}
|
|
213
|
+
export interface RecordCall {
|
|
214
|
+
/** Record call in the background. */
|
|
215
|
+
record_call?: {
|
|
216
|
+
/** Identifier for this recording, to use with `stop_call_record`. */
|
|
217
|
+
control_id?: string;
|
|
218
|
+
/** If `true`, record in stereo. */
|
|
219
|
+
stereo?: boolean | SWMLVar;
|
|
220
|
+
/** The format to record in. It can be `wav`, `mp3`, or `mp4`. */
|
|
221
|
+
format?: 'wav' | 'mp3' | 'mp4';
|
|
222
|
+
/** Direction of the audio to record: "speak" for what party says, "listen" for what party hears, "both" for what the party hears and says. */
|
|
223
|
+
direction?: 'speak' | 'listen' | 'both';
|
|
224
|
+
/** String of digits that will stop the recording when pressed. Default is `""` (empty). */
|
|
225
|
+
terminators?: string;
|
|
226
|
+
/** Play a beep before recording. */
|
|
227
|
+
beep?: boolean | SWMLVar;
|
|
228
|
+
/** How sensitive the recording voice activity detector is to background noise. */
|
|
229
|
+
input_sensitivity?: number | SWMLVar;
|
|
230
|
+
/** Time in seconds to wait for the start of speech. */
|
|
231
|
+
initial_timeout?: number | SWMLVar;
|
|
232
|
+
/** Time in seconds to wait in silence before ending the recording. */
|
|
233
|
+
end_silence_timeout?: number | SWMLVar;
|
|
234
|
+
/** Maximum length of the recording in seconds. */
|
|
235
|
+
max_length?: number | SWMLVar;
|
|
236
|
+
/** http or https URL to deliver record_call status events */
|
|
237
|
+
status_url?: string;
|
|
238
|
+
[key: string]: Record<string, unknown> | string | boolean | SWMLVar | 'wav' | 'mp3' | 'mp4' | 'speak' | 'listen' | 'both' | number | SWMLVar | undefined;
|
|
239
|
+
};
|
|
240
|
+
[key: string]: unknown;
|
|
241
|
+
}
|
|
242
|
+
export interface Request {
|
|
243
|
+
/** Send a GET, POST, PUT, or DELETE request to a remote URL. */
|
|
244
|
+
request?: {
|
|
245
|
+
/** URL to send the HTTPS request to. Authentication can also be set in the URL in the format of username:password@url. */
|
|
246
|
+
url: string;
|
|
247
|
+
/** The HTTP method to be used for the request. Can be `GET`, `POST`, `PUT`, or `DELETE`. */
|
|
248
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
249
|
+
/** Object containing HTTP headers to set. Valid header values are Accept, Authorization, Content-Type, Range, and custom X- headers. */
|
|
250
|
+
headers?: {
|
|
251
|
+
[key: string]: Record<string, unknown>;
|
|
252
|
+
};
|
|
253
|
+
/** Request body. Content-Type header should be explicitly set, but if not set, the most likely type */
|
|
254
|
+
body?: string | {
|
|
255
|
+
[key: string]: Record<string, unknown>;
|
|
256
|
+
};
|
|
257
|
+
/** Maximum time in seconds to wait for a response. */
|
|
258
|
+
timeout?: number | SWMLVar;
|
|
259
|
+
/** Maximum time in seconds to wait for a connection. */
|
|
260
|
+
connect_timeout?: number | SWMLVar;
|
|
261
|
+
/** Store parsed JSON response as variables. */
|
|
262
|
+
save_variables?: boolean | SWMLVar;
|
|
263
|
+
[key: string]: Record<string, unknown> | string | 'GET' | 'POST' | 'PUT' | 'DELETE' | {
|
|
264
|
+
[key: string]: Record<string, unknown>;
|
|
265
|
+
} | string | {
|
|
266
|
+
[key: string]: Record<string, unknown>;
|
|
267
|
+
} | number | SWMLVar | boolean | SWMLVar | undefined;
|
|
268
|
+
};
|
|
269
|
+
[key: string]: unknown;
|
|
270
|
+
}
|
|
271
|
+
export interface Return {
|
|
272
|
+
/** Return a value from an execute call or exit the script. The value can be any type. */
|
|
273
|
+
return?: Record<string, unknown>;
|
|
274
|
+
[key: string]: unknown;
|
|
275
|
+
}
|
|
276
|
+
export interface SendDigits {
|
|
277
|
+
/** Send digit presses as DTMF tones. */
|
|
278
|
+
send_digits?: {
|
|
279
|
+
/** The digits to send. Valid values are 0123456789*#ABCDWw. Character W is a 1 second delay, and w is a 500ms delay. */
|
|
280
|
+
digits: string;
|
|
281
|
+
[key: string]: Record<string, unknown> | string;
|
|
282
|
+
};
|
|
283
|
+
[key: string]: unknown;
|
|
284
|
+
}
|
|
285
|
+
export interface SendFax {
|
|
286
|
+
/** Send a fax. */
|
|
287
|
+
send_fax?: {
|
|
288
|
+
/** URL to the PDF document to fax. */
|
|
289
|
+
document: string;
|
|
290
|
+
/** Header text to include on the fax. */
|
|
291
|
+
header_info?: string;
|
|
292
|
+
/** Station identity to report. */
|
|
293
|
+
identity?: string;
|
|
294
|
+
/** http or https URL to deliver send_fax status events */
|
|
295
|
+
status_url?: string;
|
|
296
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
297
|
+
};
|
|
298
|
+
[key: string]: unknown;
|
|
299
|
+
}
|
|
300
|
+
export interface SendSMS {
|
|
301
|
+
/** Send an outbound SMS or MMS message to a PSTN phone number. */
|
|
302
|
+
send_sms?: SMSWithBody | SMSWithMedia;
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
}
|
|
305
|
+
export interface Set_ {
|
|
306
|
+
/** Set script variables to the specified values. */
|
|
307
|
+
set?: {
|
|
308
|
+
[key: string]: Record<string, unknown>;
|
|
309
|
+
};
|
|
310
|
+
[key: string]: unknown;
|
|
311
|
+
}
|
|
312
|
+
export interface Sleep {
|
|
313
|
+
/** Pause execution for a specified duration. */
|
|
314
|
+
sleep?: {
|
|
315
|
+
/** The amount of time to sleep in milliseconds. */
|
|
316
|
+
duration: number | SWMLVar;
|
|
317
|
+
[key: string]: Record<string, unknown> | number | SWMLVar;
|
|
318
|
+
} | number | SWMLVar;
|
|
319
|
+
[key: string]: unknown;
|
|
320
|
+
}
|
|
321
|
+
export interface SIPRefer {
|
|
322
|
+
/** Send SIP REFER to a SIP call. */
|
|
323
|
+
sip_refer?: {
|
|
324
|
+
/** The SIP URI to send the REFER to. */
|
|
325
|
+
to_uri: string;
|
|
326
|
+
/** The HTTP or HTTPS URL to send status callback events to. */
|
|
327
|
+
status_url?: string;
|
|
328
|
+
/** Username to use for SIP authentication. */
|
|
329
|
+
username?: string;
|
|
330
|
+
/** Password to use for SIP authentication. */
|
|
331
|
+
password?: string;
|
|
332
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
333
|
+
};
|
|
334
|
+
[key: string]: unknown;
|
|
335
|
+
}
|
|
336
|
+
export interface StopDenoise {
|
|
337
|
+
/** Stop noise reduction that was started with denoise. */
|
|
338
|
+
stop_denoise?: {
|
|
339
|
+
[key: string]: Record<string, unknown>;
|
|
340
|
+
};
|
|
341
|
+
[key: string]: unknown;
|
|
342
|
+
}
|
|
343
|
+
export interface StopRecordCall {
|
|
344
|
+
/** Stop an active background recording. */
|
|
345
|
+
stop_record_call?: {
|
|
346
|
+
/** Identifier for the recording to stop. */
|
|
347
|
+
control_id?: string;
|
|
348
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
349
|
+
};
|
|
350
|
+
[key: string]: unknown;
|
|
351
|
+
}
|
|
352
|
+
export interface StopTap {
|
|
353
|
+
/** Stop an active tap stream. */
|
|
354
|
+
stop_tap?: {
|
|
355
|
+
/** ID of the tap to stop. */
|
|
356
|
+
control_id?: string;
|
|
357
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
358
|
+
};
|
|
359
|
+
[key: string]: unknown;
|
|
360
|
+
}
|
|
361
|
+
export interface Switch {
|
|
362
|
+
/** Execute different instructions based on a variable's value. */
|
|
363
|
+
switch?: {
|
|
364
|
+
/** Name of the variable whose value needs to be compared. */
|
|
365
|
+
variable: string;
|
|
366
|
+
/** Object of key-mapped values to array of SWML methods to execute. */
|
|
367
|
+
case: {
|
|
368
|
+
[key: string]: SWMLMethod[];
|
|
369
|
+
};
|
|
370
|
+
/** Array of SWML methods to execute if no cases match. */
|
|
371
|
+
default?: SWMLMethod[];
|
|
372
|
+
[key: string]: Record<string, unknown> | string | {
|
|
373
|
+
[key: string]: SWMLMethod[];
|
|
374
|
+
} | SWMLMethod[] | undefined;
|
|
375
|
+
};
|
|
376
|
+
[key: string]: unknown;
|
|
377
|
+
}
|
|
378
|
+
export interface Tap {
|
|
379
|
+
/** Start background call tap. Media is streamed over Websocket or RTP to customer controlled URI. */
|
|
380
|
+
tap?: {
|
|
381
|
+
/** Destination of the tap media stream: rtp://IP:port, ws://example.com, or wss://example.com. */
|
|
382
|
+
uri: string;
|
|
383
|
+
/** Identifier for this tap to use with `stop_tap`. */
|
|
384
|
+
control_id?: string;
|
|
385
|
+
/** Direction of the audio to tap: */
|
|
386
|
+
direction?: 'speak' | 'listen' | 'both';
|
|
387
|
+
/** Codec to use for the tap media stream. */
|
|
388
|
+
codec?: 'PCMU' | 'PCMA';
|
|
389
|
+
/** If `uri` is a `rtp://` this will set the packetization time of the media in milliseconds. */
|
|
390
|
+
rtp_ptime?: number | SWMLVar;
|
|
391
|
+
/** http or https URL to deliver tap status events */
|
|
392
|
+
status_url?: string;
|
|
393
|
+
[key: string]: Record<string, unknown> | string | 'speak' | 'listen' | 'both' | 'PCMU' | 'PCMA' | number | SWMLVar | undefined;
|
|
394
|
+
};
|
|
395
|
+
[key: string]: unknown;
|
|
396
|
+
}
|
|
397
|
+
export interface Transfer {
|
|
398
|
+
/** Transfer the execution of the script to a different SWML section, URL, or Relay application. */
|
|
399
|
+
transfer?: {
|
|
400
|
+
/** Specifies where to transfer to. The value can be one of: */
|
|
401
|
+
dest: string;
|
|
402
|
+
/** Named parameters to send to transfer destination. */
|
|
403
|
+
params?: {
|
|
404
|
+
[key: string]: Record<string, unknown>;
|
|
405
|
+
};
|
|
406
|
+
/** User data, ignored by SignalWire. */
|
|
407
|
+
meta?: {
|
|
408
|
+
[key: string]: Record<string, unknown>;
|
|
409
|
+
};
|
|
410
|
+
[key: string]: Record<string, unknown> | string | {
|
|
411
|
+
[key: string]: Record<string, unknown>;
|
|
412
|
+
} | undefined;
|
|
413
|
+
};
|
|
414
|
+
[key: string]: unknown;
|
|
415
|
+
}
|
|
416
|
+
export interface Unset {
|
|
417
|
+
/** Unset specified variables. The variables may have been set using the set method */
|
|
418
|
+
unset?: string | string[];
|
|
419
|
+
[key: string]: unknown;
|
|
420
|
+
}
|
|
421
|
+
export interface Pay {
|
|
422
|
+
/** Enables secure payment processing during voice calls. When implemented, it manages the entire payment flow */
|
|
423
|
+
pay?: {
|
|
424
|
+
/** The URL to make POST requests with all the gathered payment details. */
|
|
425
|
+
payment_connector_url: string;
|
|
426
|
+
/** The amount to charge against payment method passed in the request. `Float` value with no currency prefix passed as string. */
|
|
427
|
+
charge_amount?: string;
|
|
428
|
+
/** Uses the ISO 4217 currency code of the charge amount. */
|
|
429
|
+
currency?: string;
|
|
430
|
+
/** Custom description of the payment provided in the request. */
|
|
431
|
+
description?: string;
|
|
432
|
+
/** The method of how to collect the payment details. Currently only `dtmf` mode is supported. */
|
|
433
|
+
input?: 'dtmf';
|
|
434
|
+
/** Language to use for prompts being played to the caller by the `pay` method. */
|
|
435
|
+
language?: string;
|
|
436
|
+
/** Number of times the `pay` method will retry to collect payment details. */
|
|
437
|
+
max_attempts?: number | SWMLVar;
|
|
438
|
+
/** The minimum length of the postal code the user must enter. */
|
|
439
|
+
min_postal_code_length?: number | SWMLVar;
|
|
440
|
+
/** Array of parameter objects to pass to your payment processor. The parameters are user-defined key-value pairs. */
|
|
441
|
+
parameters?: PayParameters[];
|
|
442
|
+
/** Indicates the payment method which is going to be used in this payment request. Currently only `credit-card` is supported. */
|
|
443
|
+
payment_method?: 'credit-card';
|
|
444
|
+
/** Takes `true`, `false` or real postalcode (if it's known beforehand) to let pay method know whether to prompt for postal code. Default is `true`. */
|
|
445
|
+
postal_code?: boolean | string;
|
|
446
|
+
/** Array of prompt objects for customizing the audio prompts during different stages of the payment process. */
|
|
447
|
+
prompts?: PayPrompts[];
|
|
448
|
+
/** Takes true or false to let pay method know whether to prompt for security code. */
|
|
449
|
+
security_code?: boolean | SWMLVar;
|
|
450
|
+
/** The URL to send requests for each status change during the payment process. */
|
|
451
|
+
status_url?: string;
|
|
452
|
+
/** Limit in seconds that pay method waits for the caller to press another digit before moving on to validate the digits captured. */
|
|
453
|
+
timeout?: number | SWMLVar;
|
|
454
|
+
/** Whether the payment is a one off payment or re-occurring. */
|
|
455
|
+
token_type?: 'one-time' | 'reusable';
|
|
456
|
+
/** List of payment cards allowed to use in the requested payment process separated by space. */
|
|
457
|
+
valid_card_types?: string;
|
|
458
|
+
/** Text-to-speech voice to use. Please refer to https://developer.signalwire.com/voice/getting-started/voice-and-languages for more information. */
|
|
459
|
+
voice?: string;
|
|
460
|
+
[key: string]: Record<string, unknown> | string | 'dtmf' | number | SWMLVar | PayParameters[] | 'credit-card' | boolean | string | PayPrompts[] | boolean | SWMLVar | 'one-time' | 'reusable' | undefined;
|
|
461
|
+
};
|
|
462
|
+
[key: string]: unknown;
|
|
463
|
+
}
|
|
464
|
+
export interface DetectMachine {
|
|
465
|
+
/** A detection method that combines AMD (Answering Machine Detection) and fax detection. */
|
|
466
|
+
detect_machine?: {
|
|
467
|
+
/** If `true`, stops detection on beep / end of voicemail greeting. Default `false`. */
|
|
468
|
+
detect_message_end?: boolean | SWMLVar;
|
|
469
|
+
/** Comma-separated string of detectors to enable. Valid values: `amd`, `fax`. */
|
|
470
|
+
detectors?: string;
|
|
471
|
+
/** How long to wait for voice to finish. Default `1.0`. */
|
|
472
|
+
end_silence_timeout?: number | SWMLVar;
|
|
473
|
+
/** How long to wait for initial voice before giving up. Default `4.5`. */
|
|
474
|
+
initial_timeout?: number | SWMLVar;
|
|
475
|
+
/** How long to wait for voice to finish before firing READY event. Default is `end_silence_timeout`. */
|
|
476
|
+
machine_ready_timeout?: number | SWMLVar;
|
|
477
|
+
/** The number of seconds of ongoing voice activity required to classify as MACHINE. Default `1.25`. */
|
|
478
|
+
machine_voice_threshold?: number | SWMLVar;
|
|
479
|
+
/** The minimum number of words that must be detected in a single utterance before classifying the call as MACHINE. Default `6`. */
|
|
480
|
+
machine_words_threshold?: number | SWMLVar;
|
|
481
|
+
/** The http(s) URL to deliver detector events to. */
|
|
482
|
+
status_url?: string;
|
|
483
|
+
/** The max time to run detector. Default `30.0` seconds. */
|
|
484
|
+
timeout?: number | SWMLVar;
|
|
485
|
+
/** The tone to detect, will only receive remote side tone. Default `CED`. */
|
|
486
|
+
tone?: 'CED' | 'CNG';
|
|
487
|
+
/** If false, the detector will run asynchronously and status_url must be set. */
|
|
488
|
+
wait?: boolean | SWMLVar;
|
|
489
|
+
[key: string]: Record<string, unknown> | boolean | SWMLVar | string | number | SWMLVar | 'CED' | 'CNG' | undefined;
|
|
490
|
+
};
|
|
491
|
+
[key: string]: unknown;
|
|
492
|
+
}
|
|
493
|
+
export interface UserEvent {
|
|
494
|
+
/** Allows the user to set and send events to the connected client on the call. */
|
|
495
|
+
user_event?: {
|
|
496
|
+
event: {
|
|
497
|
+
[key: string]: Record<string, unknown>;
|
|
498
|
+
};
|
|
499
|
+
[key: string]: Record<string, unknown> | {
|
|
500
|
+
[key: string]: Record<string, unknown>;
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
[key: string]: unknown;
|
|
504
|
+
}
|
|
505
|
+
/** A SWML variable reference using ${varname} or %{varname} syntax for dynamic value substitution at runtime. */
|
|
506
|
+
export type SWMLVar = string;
|
|
507
|
+
export interface AIObject {
|
|
508
|
+
/** A key-value object for storing data that persists throughout the AI session. */
|
|
509
|
+
global_data?: {
|
|
510
|
+
[key: string]: Record<string, unknown>;
|
|
511
|
+
};
|
|
512
|
+
/** Hints help the AI agent understand certain words or phrases better. Words that can commonly be misinterpreted can be added to the hints to help the AI speak more accurately. */
|
|
513
|
+
hints?: (string | Hint)[];
|
|
514
|
+
/** An array of JSON objects defining supported languages in the conversation. */
|
|
515
|
+
languages?: Languages[];
|
|
516
|
+
/** A JSON object containing parameters as key-value pairs. */
|
|
517
|
+
params?: AIParams;
|
|
518
|
+
/** The final set of instructions and configuration settings to send to the agent. */
|
|
519
|
+
post_prompt?: AIPostPrompt;
|
|
520
|
+
/** The URL to which to send status callbacks and reports. Authentication can also be set in the url in the format of `username:password@url`. */
|
|
521
|
+
post_prompt_url?: string;
|
|
522
|
+
/** An array of JSON objects to clarify the AI's pronunciation of words or expressions. */
|
|
523
|
+
pronounce?: Pronounce[];
|
|
524
|
+
/** Defines the AI agent's personality, goals, behaviors, and instructions for handling conversations. */
|
|
525
|
+
prompt?: AIPrompt;
|
|
526
|
+
/** An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue. */
|
|
527
|
+
SWAIG?: SWAIG;
|
|
528
|
+
[key: string]: unknown;
|
|
529
|
+
}
|
|
530
|
+
export interface AmazonBedrockObject {
|
|
531
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script */
|
|
532
|
+
global_data?: {
|
|
533
|
+
[key: string]: Record<string, unknown>;
|
|
534
|
+
};
|
|
535
|
+
/** A JSON object containing parameters as key-value pairs. */
|
|
536
|
+
params?: BedrockParams;
|
|
537
|
+
/** The final set of instructions and configuration settings to send to the agent. */
|
|
538
|
+
post_prompt?: BedrockPostPrompt;
|
|
539
|
+
/** The URL to which to send status callbacks and reports. Authentication can also be set in the url in the format of `username:password@url`. */
|
|
540
|
+
post_prompt_url?: string;
|
|
541
|
+
/** Establishes the initial set of instructions and settings to configure the agent. */
|
|
542
|
+
prompt?: BedrockPrompt;
|
|
543
|
+
/** An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue. */
|
|
544
|
+
SWAIG?: BedrockSWAIG;
|
|
545
|
+
[key: string]: unknown;
|
|
546
|
+
}
|
|
547
|
+
export type CondParams = CondReg | CondElse;
|
|
548
|
+
export interface ConnectDeviceSingle {
|
|
549
|
+
/** The caller ID to use when dialing the number. */
|
|
550
|
+
from?: string;
|
|
551
|
+
/** Custom SIP headers to add to INVITE. It Has no effect on calls to phone numbers. */
|
|
552
|
+
headers?: ConnectHeaders[];
|
|
553
|
+
/** Comma-separated string of codecs to offer. */
|
|
554
|
+
codecs?: string;
|
|
555
|
+
/** If true, WebRTC media is offered to the SIP endpoint. */
|
|
556
|
+
webrtc_media?: boolean | SWMLVar;
|
|
557
|
+
/** Time, in seconds, to set the SIP `Session-Expires` header in INVITE. */
|
|
558
|
+
session_timeout?: number | SWMLVar;
|
|
559
|
+
/** Ringback to play while the far end rings: a legacy array of URIs, or a RingbackConfig object. */
|
|
560
|
+
ringback?: string[] | RingbackConfig;
|
|
561
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
562
|
+
result?: ConnectSwitch | CondParams[];
|
|
563
|
+
/** Time, in seconds, to wait for the call to be answered. */
|
|
564
|
+
timeout?: number | SWMLVar;
|
|
565
|
+
/** Maximum duration, in seconds, allowed for the call. */
|
|
566
|
+
max_duration?: number | SWMLVar;
|
|
567
|
+
/** Delay answer until the B-leg answers. */
|
|
568
|
+
answer_on_bridge?: boolean | SWMLVar;
|
|
569
|
+
/** Confirmation to execute when the call is connected. Can be either: */
|
|
570
|
+
confirm?: string | ValidConfirmMethods[];
|
|
571
|
+
/** The amount of time, in seconds, to wait for the `confirm` URL to return a response */
|
|
572
|
+
confirm_timeout?: number | SWMLVar;
|
|
573
|
+
/** SIP username to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
574
|
+
username?: string;
|
|
575
|
+
/** SIP password to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
576
|
+
password?: string;
|
|
577
|
+
/** Encryption setting to use. **Possible values:** `mandatory`, `optional`, `forbidden` */
|
|
578
|
+
encryption?: 'mandatory' | 'optional' | 'forbidden';
|
|
579
|
+
/** Webhook URL to send call status change notifications to. Authentication can also be set in the URL in the format of `username:password@url`. */
|
|
580
|
+
call_state_url?: string;
|
|
581
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected and the bridge ends. */
|
|
582
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
583
|
+
/** An array of call state event names to be notified about. */
|
|
584
|
+
call_state_events?: CallStatus[];
|
|
585
|
+
/** Destination to dial. Can be: */
|
|
586
|
+
to?: string;
|
|
587
|
+
[key: string]: unknown;
|
|
588
|
+
}
|
|
589
|
+
export interface ConnectDeviceSerial {
|
|
590
|
+
/** The caller ID to use when dialing the number. */
|
|
591
|
+
from?: string;
|
|
592
|
+
/** Custom SIP headers to add to INVITE. It Has no effect on calls to phone numbers. */
|
|
593
|
+
headers?: ConnectHeaders[];
|
|
594
|
+
/** Comma-separated string of codecs to offer. */
|
|
595
|
+
codecs?: string;
|
|
596
|
+
/** If true, WebRTC media is offered to the SIP endpoint. */
|
|
597
|
+
webrtc_media?: boolean | SWMLVar;
|
|
598
|
+
/** Time, in seconds, to set the SIP `Session-Expires` header in INVITE. */
|
|
599
|
+
session_timeout?: number | SWMLVar;
|
|
600
|
+
/** Ringback to play while the far end rings: a legacy array of URIs, or a RingbackConfig object. */
|
|
601
|
+
ringback?: string[] | RingbackConfig;
|
|
602
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
603
|
+
result?: ConnectSwitch | CondParams[];
|
|
604
|
+
/** Time, in seconds, to wait for the call to be answered. */
|
|
605
|
+
timeout?: number | SWMLVar;
|
|
606
|
+
/** Maximum duration, in seconds, allowed for the call. */
|
|
607
|
+
max_duration?: number | SWMLVar;
|
|
608
|
+
/** Delay answer until the B-leg answers. */
|
|
609
|
+
answer_on_bridge?: boolean | SWMLVar;
|
|
610
|
+
/** Confirmation to execute when the call is connected. Can be either: */
|
|
611
|
+
confirm?: string | ValidConfirmMethods[];
|
|
612
|
+
/** The amount of time, in seconds, to wait for the `confirm` URL to return a response */
|
|
613
|
+
confirm_timeout?: number | SWMLVar;
|
|
614
|
+
/** SIP username to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
615
|
+
username?: string;
|
|
616
|
+
/** SIP password to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
617
|
+
password?: string;
|
|
618
|
+
/** Encryption setting to use. **Possible values:** `mandatory`, `optional`, `forbidden` */
|
|
619
|
+
encryption?: 'mandatory' | 'optional' | 'forbidden';
|
|
620
|
+
/** Webhook URL to send call status change notifications to. Authentication can also be set in the URL in the format of `username:password@url`. */
|
|
621
|
+
call_state_url?: string;
|
|
622
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected and the bridge ends. */
|
|
623
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
624
|
+
/** An array of call state event names to be notified about. */
|
|
625
|
+
call_state_events?: CallStatus[];
|
|
626
|
+
serial?: ConnectDeviceSingle[];
|
|
627
|
+
[key: string]: unknown;
|
|
628
|
+
}
|
|
629
|
+
export interface ConnectDeviceParallel {
|
|
630
|
+
/** The caller ID to use when dialing the number. */
|
|
631
|
+
from?: string;
|
|
632
|
+
/** Custom SIP headers to add to INVITE. It Has no effect on calls to phone numbers. */
|
|
633
|
+
headers?: ConnectHeaders[];
|
|
634
|
+
/** Comma-separated string of codecs to offer. */
|
|
635
|
+
codecs?: string;
|
|
636
|
+
/** If true, WebRTC media is offered to the SIP endpoint. */
|
|
637
|
+
webrtc_media?: boolean | SWMLVar;
|
|
638
|
+
/** Time, in seconds, to set the SIP `Session-Expires` header in INVITE. */
|
|
639
|
+
session_timeout?: number | SWMLVar;
|
|
640
|
+
/** Ringback to play while the far end rings: a legacy array of URIs, or a RingbackConfig object. */
|
|
641
|
+
ringback?: string[] | RingbackConfig;
|
|
642
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
643
|
+
result?: ConnectSwitch | CondParams[];
|
|
644
|
+
/** Time, in seconds, to wait for the call to be answered. */
|
|
645
|
+
timeout?: number | SWMLVar;
|
|
646
|
+
/** Maximum duration, in seconds, allowed for the call. */
|
|
647
|
+
max_duration?: number | SWMLVar;
|
|
648
|
+
/** Delay answer until the B-leg answers. */
|
|
649
|
+
answer_on_bridge?: boolean | SWMLVar;
|
|
650
|
+
/** Confirmation to execute when the call is connected. Can be either: */
|
|
651
|
+
confirm?: string | ValidConfirmMethods[];
|
|
652
|
+
/** The amount of time, in seconds, to wait for the `confirm` URL to return a response */
|
|
653
|
+
confirm_timeout?: number | SWMLVar;
|
|
654
|
+
/** SIP username to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
655
|
+
username?: string;
|
|
656
|
+
/** SIP password to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
657
|
+
password?: string;
|
|
658
|
+
/** Encryption setting to use. **Possible values:** `mandatory`, `optional`, `forbidden` */
|
|
659
|
+
encryption?: 'mandatory' | 'optional' | 'forbidden';
|
|
660
|
+
/** Webhook URL to send call status change notifications to. Authentication can also be set in the URL in the format of `username:password@url`. */
|
|
661
|
+
call_state_url?: string;
|
|
662
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected and the bridge ends. */
|
|
663
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
664
|
+
/** An array of call state event names to be notified about. */
|
|
665
|
+
call_state_events?: CallStatus[];
|
|
666
|
+
/** Array of destinations to dial simultaneously. */
|
|
667
|
+
parallel?: ConnectDeviceSingle[];
|
|
668
|
+
[key: string]: unknown;
|
|
669
|
+
}
|
|
670
|
+
export interface ConnectDeviceSerialParallel {
|
|
671
|
+
/** The caller ID to use when dialing the number. */
|
|
672
|
+
from?: string;
|
|
673
|
+
/** Custom SIP headers to add to INVITE. It Has no effect on calls to phone numbers. */
|
|
674
|
+
headers?: ConnectHeaders[];
|
|
675
|
+
/** Comma-separated string of codecs to offer. */
|
|
676
|
+
codecs?: string;
|
|
677
|
+
/** If true, WebRTC media is offered to the SIP endpoint. */
|
|
678
|
+
webrtc_media?: boolean | SWMLVar;
|
|
679
|
+
/** Time, in seconds, to set the SIP `Session-Expires` header in INVITE. */
|
|
680
|
+
session_timeout?: number | SWMLVar;
|
|
681
|
+
/** Ringback to play while the far end rings: a legacy array of URIs, or a RingbackConfig object. */
|
|
682
|
+
ringback?: string[] | RingbackConfig;
|
|
683
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
684
|
+
result?: ConnectSwitch | CondParams[];
|
|
685
|
+
/** Time, in seconds, to wait for the call to be answered. */
|
|
686
|
+
timeout?: number | SWMLVar;
|
|
687
|
+
/** Maximum duration, in seconds, allowed for the call. */
|
|
688
|
+
max_duration?: number | SWMLVar;
|
|
689
|
+
/** Delay answer until the B-leg answers. */
|
|
690
|
+
answer_on_bridge?: boolean | SWMLVar;
|
|
691
|
+
/** Confirmation to execute when the call is connected. Can be either: */
|
|
692
|
+
confirm?: string | ValidConfirmMethods[];
|
|
693
|
+
/** The amount of time, in seconds, to wait for the `confirm` URL to return a response */
|
|
694
|
+
confirm_timeout?: number | SWMLVar;
|
|
695
|
+
/** SIP username to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
696
|
+
username?: string;
|
|
697
|
+
/** SIP password to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
698
|
+
password?: string;
|
|
699
|
+
/** Encryption setting to use. **Possible values:** `mandatory`, `optional`, `forbidden` */
|
|
700
|
+
encryption?: 'mandatory' | 'optional' | 'forbidden';
|
|
701
|
+
/** Webhook URL to send call status change notifications to. Authentication can also be set in the URL in the format of `username:password@url`. */
|
|
702
|
+
call_state_url?: string;
|
|
703
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected and the bridge ends. */
|
|
704
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
705
|
+
/** An array of call state event names to be notified about. */
|
|
706
|
+
call_state_events?: CallStatus[];
|
|
707
|
+
/** Array of arrays. */
|
|
708
|
+
serial_parallel?: ConnectDeviceSingle[][];
|
|
709
|
+
[key: string]: unknown;
|
|
710
|
+
}
|
|
711
|
+
export interface EnterQueueObject {
|
|
712
|
+
/** Name of the queue to enter. If a queue with this name does not exist, it will be automatically created. */
|
|
713
|
+
queue_name?: string;
|
|
714
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected to an agent and the bridge ends. */
|
|
715
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
716
|
+
/** HTTP or HTTPS URL to deliver queue status events. Default not set */
|
|
717
|
+
status_url?: string;
|
|
718
|
+
/** URL for media to play while waiting in the queue. Default hold music will be played if not set */
|
|
719
|
+
wait_url?: string | SWMLVar;
|
|
720
|
+
/** Maximum time in seconds to wait in the queue before timeout. Default `3600` */
|
|
721
|
+
wait_time?: number | SWMLVar;
|
|
722
|
+
[key: string]: unknown;
|
|
723
|
+
}
|
|
724
|
+
export interface ExecuteSwitch {
|
|
725
|
+
/** Name of the variable whose value needs to be compared. If not provided, it will check the `return_value` variable. */
|
|
726
|
+
variable?: string;
|
|
727
|
+
/** Object of values mapped to array of instructions to execute */
|
|
728
|
+
case?: {
|
|
729
|
+
[key: string]: SWMLMethod[];
|
|
730
|
+
};
|
|
731
|
+
/** Array of instructions to execute if no cases match */
|
|
732
|
+
default?: SWMLMethod[];
|
|
733
|
+
[key: string]: unknown;
|
|
734
|
+
}
|
|
735
|
+
export type TranscribeAction = TranscribeStartAction | 'stop' | TranscribeSummarizeActionUnion;
|
|
736
|
+
export type TranslateAction = StartAction | 'stop' | SummarizeActionUnion | InjectAction;
|
|
737
|
+
export interface JoinConferenceObject {
|
|
738
|
+
/** Name of conference */
|
|
739
|
+
name?: string;
|
|
740
|
+
/** Whether to join the conference in a muted state. If set to `true`, the participant will be muted upon joining. Default `false`. */
|
|
741
|
+
muted?: boolean | SWMLVar;
|
|
742
|
+
/** Sets the behavior of the beep sound when joining or leaving the conference. Default `"true"`. */
|
|
743
|
+
beep?: 'true' | 'false' | 'onEnter' | 'onExit';
|
|
744
|
+
/** Starts the conference when the main participant joins. This means the start action will not wait on more participants to join before starting. Default `true`. */
|
|
745
|
+
start_on_enter?: boolean | SWMLVar;
|
|
746
|
+
/** Ends the conference when the main participant leaves. This means the end action will not wait on more participants to leave before ending. Default `false`. */
|
|
747
|
+
end_on_exit?: boolean | SWMLVar;
|
|
748
|
+
/** A URL that will play media when the conference is put on hold. Default hold music will be played if not set */
|
|
749
|
+
wait_url?: string | SWMLVar;
|
|
750
|
+
/** The maximum number of participants allowed in the conference. If the limit is reached, new participants will not be able to join. Default `100000`. */
|
|
751
|
+
max_participants?: number | SWMLVar;
|
|
752
|
+
/** Enables or disables recording of the conference. Default `"do-not-record"`. */
|
|
753
|
+
record?: 'do-not-record' | 'record-from-start';
|
|
754
|
+
/** Specifies the geographical region where the conference will be hosted. Default not set */
|
|
755
|
+
region?: string;
|
|
756
|
+
/** If set to `trim-silence`, it will remove silence from the start of the recording. If set to `do-not-trim`, it will keep the silence. Default `"trim-silence"`. */
|
|
757
|
+
trim?: 'trim-silence' | 'do-not-trim';
|
|
758
|
+
/** Coach accepts a call SID of a call that is currently connected to an in-progress conference. */
|
|
759
|
+
coach?: string;
|
|
760
|
+
/** The events to listen for and send to the status callback URL. Default not set */
|
|
761
|
+
status_callback_event?: 'start' | 'end' | 'join' | 'leave' | 'mute' | 'hold' | 'modify' | 'speaker' | 'announcement';
|
|
762
|
+
/** The URL to which status events will be sent. This URL must be publicly accessible and able to handle HTTP requests. Default not set */
|
|
763
|
+
status_callback?: string;
|
|
764
|
+
/** The HTTP method to use when sending status events to the status callback URL. Default `"POST"`. */
|
|
765
|
+
status_callback_method?: 'GET' | 'POST';
|
|
766
|
+
/** The URL to which recording status events will be sent. This URL must be publicly accessible and able to handle HTTP requests. Default not set */
|
|
767
|
+
recording_status_callback?: string;
|
|
768
|
+
/** The HTTP method to use when sending recording status events to the recording status callback URL. Default `"POST"`. */
|
|
769
|
+
recording_status_callback_method?: 'GET' | 'POST';
|
|
770
|
+
/** The events to listen for and send to the recording status callback URL. Default not set */
|
|
771
|
+
recording_status_callback_event?: 'in-progress' | 'completed' | 'absent';
|
|
772
|
+
/** Allows the user to specify a custom action to be executed when the conference result is returned (typically when it has ended). */
|
|
773
|
+
result?: {
|
|
774
|
+
/** Name of the variable whose value needs to be compared. */
|
|
775
|
+
variable: string;
|
|
776
|
+
/** Object of key-mapped values to array of SWML methods to execute. */
|
|
777
|
+
case: {
|
|
778
|
+
[key: string]: SWMLMethod[];
|
|
779
|
+
};
|
|
780
|
+
/** Array of SWML methods to execute if no cases match. */
|
|
781
|
+
default?: SWMLMethod[];
|
|
782
|
+
[key: string]: Record<string, unknown> | string | {
|
|
783
|
+
[key: string]: SWMLMethod[];
|
|
784
|
+
} | SWMLMethod[] | undefined;
|
|
785
|
+
} | CondParams[];
|
|
786
|
+
[key: string]: unknown;
|
|
787
|
+
}
|
|
788
|
+
/** Play with a single URL */
|
|
789
|
+
export interface PlayWithURL {
|
|
790
|
+
/** If `true`, the call will automatically answer as the sound is playing. If `false`, you will start playing the audio during early media. Default `true`. */
|
|
791
|
+
auto_answer?: boolean | SWMLVar;
|
|
792
|
+
/** Volume level for the audio file. */
|
|
793
|
+
volume?: number | SWMLVar;
|
|
794
|
+
/** The voice to use for the text to speech. */
|
|
795
|
+
say_voice?: string;
|
|
796
|
+
/** The language to use for the text to speech. */
|
|
797
|
+
say_language?: string;
|
|
798
|
+
/** Gender to use for the text to speech. */
|
|
799
|
+
say_gender?: 'male' | 'female';
|
|
800
|
+
/** http or https URL to deliver play status events */
|
|
801
|
+
status_url?: string;
|
|
802
|
+
/** URL to play. */
|
|
803
|
+
url?: play_url | SWMLVar;
|
|
804
|
+
[key: string]: unknown;
|
|
805
|
+
}
|
|
806
|
+
export interface PlayWithURLS {
|
|
807
|
+
/** If `true`, the call will automatically answer as the sound is playing. If `false`, you will start playing the audio during early media. Default `true`. */
|
|
808
|
+
auto_answer?: boolean | SWMLVar;
|
|
809
|
+
/** Volume level for the audio file. */
|
|
810
|
+
volume?: number | SWMLVar;
|
|
811
|
+
/** The voice to use for the text to speech. */
|
|
812
|
+
say_voice?: string;
|
|
813
|
+
/** The language to use for the text to speech. */
|
|
814
|
+
say_language?: string;
|
|
815
|
+
/** Gender to use for the text to speech. */
|
|
816
|
+
say_gender?: 'male' | 'female';
|
|
817
|
+
/** http or https URL to deliver play status events */
|
|
818
|
+
status_url?: string;
|
|
819
|
+
/** Array of URLs to play. */
|
|
820
|
+
urls?: play_url[] | SWMLVar[];
|
|
821
|
+
[key: string]: unknown;
|
|
822
|
+
}
|
|
823
|
+
export type play_url = string;
|
|
824
|
+
export interface SMSWithBody {
|
|
825
|
+
/** Phone number to send SMS message to in E.164 format. */
|
|
826
|
+
to_number?: string;
|
|
827
|
+
/** Phone number the SMS message will be sent from in E.164 format. */
|
|
828
|
+
from_number?: string;
|
|
829
|
+
/** Region of the world to originate the message from. Chosen based on account preferences or device location if not specified. */
|
|
830
|
+
region?: string;
|
|
831
|
+
/** Array of tags to associate with the message to facilitate log searches. */
|
|
832
|
+
tags?: string[];
|
|
833
|
+
/** Required if `media` is not present. The body of the SMS message. */
|
|
834
|
+
body?: string;
|
|
835
|
+
[key: string]: unknown;
|
|
836
|
+
}
|
|
837
|
+
export interface SMSWithMedia {
|
|
838
|
+
/** Phone number to send SMS message to in E.164 format. */
|
|
839
|
+
to_number?: string;
|
|
840
|
+
/** Phone number the SMS message will be sent from in E.164 format. */
|
|
841
|
+
from_number?: string;
|
|
842
|
+
/** Region of the world to originate the message from. Chosen based on account preferences or device location if not specified. */
|
|
843
|
+
region?: string;
|
|
844
|
+
/** Array of tags to associate with the message to facilitate log searches. */
|
|
845
|
+
tags?: string[];
|
|
846
|
+
/** Required if `body` is not present. Array of media URLs to include in the message. */
|
|
847
|
+
media?: string[];
|
|
848
|
+
/** Optional if `media` is present. The body of the SMS message. */
|
|
849
|
+
body?: string;
|
|
850
|
+
[key: string]: unknown;
|
|
851
|
+
}
|
|
852
|
+
export interface PayParameters {
|
|
853
|
+
/** The identifier for your custom parameter. This will be the key in the parameters object. */
|
|
854
|
+
name?: string;
|
|
855
|
+
/** The value associated with the parameter. This will be the value in the parameters object. */
|
|
856
|
+
value?: string;
|
|
857
|
+
[key: string]: unknown;
|
|
858
|
+
}
|
|
859
|
+
export interface PayPrompts {
|
|
860
|
+
/** Array of action objects to execute for this prompt. These actions can either play an audio file or speak a phrase. */
|
|
861
|
+
actions?: PayPromptAction[];
|
|
862
|
+
/** The payment step this prompt is for. See Payment Steps for a list of available steps. */
|
|
863
|
+
for?: string;
|
|
864
|
+
/** Specifies which payment attempt(s) this prompt applies to. The value increments when a payment fails. */
|
|
865
|
+
attempts?: string;
|
|
866
|
+
/** Space-seperated list of card types that are allowed to be used for this prompt. */
|
|
867
|
+
card_type?: string;
|
|
868
|
+
/** Space-separated list of error types this prompt applies to. */
|
|
869
|
+
error_type?: string;
|
|
870
|
+
[key: string]: unknown;
|
|
871
|
+
}
|
|
872
|
+
export interface Hint {
|
|
873
|
+
/** The hint to match. This will match the string exactly as provided */
|
|
874
|
+
hint?: string;
|
|
875
|
+
/** A regular expression to match the hint against. This will ensure that the hint has a valid matching pattern before being replaced. */
|
|
876
|
+
pattern?: string;
|
|
877
|
+
/** The text to replace the hint with. This will replace the portion of the hint that matches the pattern. */
|
|
878
|
+
replace?: string;
|
|
879
|
+
/** If true, the hint will be matched in a case-insensitive manner. **Default:** `false`. */
|
|
880
|
+
ignore_case?: boolean | SWMLVar;
|
|
881
|
+
[key: string]: unknown;
|
|
882
|
+
}
|
|
883
|
+
export type Languages = LanguagesWithSoloFillers | LanguagesWithFillers;
|
|
884
|
+
export interface AIParams {
|
|
885
|
+
/** Instructs the agent to acknowledge crosstalk and confirm user input when the user speaks over the agent. */
|
|
886
|
+
acknowledge_interruptions?: boolean | SWMLVar;
|
|
887
|
+
/** The model to use for the AI. Allowed values are `gpt-4o-mini`, `gpt-4.1-mini`, and `gpt-4.1-nano`. */
|
|
888
|
+
ai_model?: 'gpt-4o-mini' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | string;
|
|
889
|
+
/** Sets the name the AI agent responds to for wake/activation purposes. When using `enable_pause`, `start_paused`, or `speak_when_spoken_to`, the user must say this name to get the agent's attention. The name matching is case-insensitive. */
|
|
890
|
+
ai_name?: string;
|
|
891
|
+
/** Adjust the volume of the AI. Allowed values from `-50` - `50`. **Default:** `0`. */
|
|
892
|
+
ai_volume?: number | SWMLVar;
|
|
893
|
+
/** A custom identifier for the AI application instance. This name is included in webhook payloads, allowing backend systems to identify which AI configuration made the request. */
|
|
894
|
+
app_name?: string;
|
|
895
|
+
/** If true, enables smart formatting in ASR (Automatic Speech Recognition). */
|
|
896
|
+
asr_smart_format?: boolean | SWMLVar;
|
|
897
|
+
/** Amount of time, in ms, to wait before prompting the user to respond. Allowed values from `10,000` - `600,000`. Set to `0` to disable. **Default:** `5000` ms. */
|
|
898
|
+
attention_timeout?: AttentionTimeout | 0 | SWMLVar;
|
|
899
|
+
/** A custom prompt that is fed into the AI when the attention_timeout is reached. */
|
|
900
|
+
attention_timeout_prompt?: string;
|
|
901
|
+
/** If true, enables speaker diarization in ASR (Automatic Speech Recognition). */
|
|
902
|
+
asr_diarize?: boolean | SWMLVar;
|
|
903
|
+
/** If true, will force the AI Agent to only respond to the speaker who reesponds to the AI Agent first. */
|
|
904
|
+
asr_speaker_affinity?: boolean | SWMLVar;
|
|
905
|
+
/** URL of audio file to play in the background while AI plays in foreground. */
|
|
906
|
+
background_file?: string;
|
|
907
|
+
/** Maximum number of times to loop playing the background file. `undefined` means loop indefinitely. */
|
|
908
|
+
background_file_loops?: number | null | SWMLVar;
|
|
909
|
+
/** Defines background_file volume within a range of `-50` to `50`. **Default:** `0`. */
|
|
910
|
+
background_file_volume?: number | SWMLVar;
|
|
911
|
+
/** Controls the barge behavior. Allowed values are `"complete"`, `"partial"`, `"all"`, or boolean. */
|
|
912
|
+
enable_barge?: string | boolean | SWMLVar;
|
|
913
|
+
/** Enables the inner dialog feature, which runs a separate AI process in the background */
|
|
914
|
+
enable_inner_dialog?: boolean | SWMLVar;
|
|
915
|
+
/** Enables the pause/resume functionality for the AI agent. When enabled, a `pause_conversation` */
|
|
916
|
+
enable_pause?: boolean | SWMLVar;
|
|
917
|
+
/** Enables intelligent turn detection that monitors partial speech transcripts for sentence-ending */
|
|
918
|
+
enable_turn_detection?: boolean | SWMLVar;
|
|
919
|
+
/** Takes a string, including a regular expression, defining barge behavior. */
|
|
920
|
+
barge_match_string?: string;
|
|
921
|
+
/** Defines the number of words that must be input before triggering barge behavior, in a range of `1-99`. */
|
|
922
|
+
barge_min_words?: number | SWMLVar;
|
|
923
|
+
/** If `true`, allows functions to be executed while the AI is being interrupted. **Default:** `true`. */
|
|
924
|
+
barge_functions?: boolean | SWMLVar;
|
|
925
|
+
/** Sets the prompt which binds the agent to its purpose. */
|
|
926
|
+
conscience?: string;
|
|
927
|
+
/** Injects pre-existing conversation history into the AI session at startup. This allows you to seed the AI agent with context from a previous conversation or provide example interactions. */
|
|
928
|
+
convo?: ConversationMessage[];
|
|
929
|
+
/** Used by `check_for_input` and `save_conversation` to identify an individual conversation. */
|
|
930
|
+
conversation_id?: string;
|
|
931
|
+
/** Sets the size of the sliding window for conversation history. This limits how much conversation history is sent to the AI model. */
|
|
932
|
+
conversation_sliding_window?: number | SWMLVar;
|
|
933
|
+
/** Enables debugging to the set URL. Allowed values from `0` - `2`. Default is `1` if url is set. */
|
|
934
|
+
debug_webhook_level?: number | SWMLVar;
|
|
935
|
+
/** Each interaction between the AI and end user is posted in real time to the established URL. */
|
|
936
|
+
debug_webhook_url?: string;
|
|
937
|
+
/** Enables debug mode for the AI session. When enabled, additional diagnostic information is logged including turn detection events, speech processing details, and internal state changes. */
|
|
938
|
+
debug?: boolean | number | SWMLVar;
|
|
939
|
+
/** Forces the direction of the call to the assistant. Valid values are `inbound` and `outbound`. */
|
|
940
|
+
direction?: Direction | SWMLVar;
|
|
941
|
+
/** DTMF digit, as a string, to signal the end of input (ex: '#') */
|
|
942
|
+
digit_terminators?: string;
|
|
943
|
+
/** Time, in ms, at the end of digit input to detect end of input. Allowed values from `0` - `30,000`. **Default:** `3000` ms. */
|
|
944
|
+
digit_timeout?: number | SWMLVar;
|
|
945
|
+
/** Amount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from `250` - `10,000`. **Default:** `700` ms. */
|
|
946
|
+
end_of_speech_timeout?: number | SWMLVar;
|
|
947
|
+
/** Enables thinking output for the AI Agent. */
|
|
948
|
+
enable_thinking?: boolean | SWMLVar;
|
|
949
|
+
/** Enables visual input processing for the AI Agent. */
|
|
950
|
+
enable_vision?: boolean | SWMLVar;
|
|
951
|
+
/** Amount of energy necessary for bot to hear you (in dB). Allowed values from `0.0` - `100.0`. **Default:** `52.0` dB. */
|
|
952
|
+
energy_level?: number | SWMLVar;
|
|
953
|
+
/** Amount of time, in ms, to wait for the first word after speech is detected. Allowed values from `0` - `10,000`. **Default:** `1000` ms. */
|
|
954
|
+
first_word_timeout?: number | SWMLVar;
|
|
955
|
+
/** If `true`, the AI will wait for any `filler` to finish playing before executing a function. */
|
|
956
|
+
function_wait_for_talking?: boolean | SWMLVar;
|
|
957
|
+
/** If `true`, functions can be executed when there is no user response after a timeout. **Default:** `false`. */
|
|
958
|
+
functions_on_no_response?: boolean | SWMLVar;
|
|
959
|
+
/** A final prompt that is fed into the AI when the `hard_stop_time` is reached. */
|
|
960
|
+
hard_stop_prompt?: string;
|
|
961
|
+
/** Specifies the maximum duration fopr the AI Agent to remain active before it exists the session. */
|
|
962
|
+
hard_stop_time?: string | SWMLVar;
|
|
963
|
+
/** A URL for the hold music to play, accepting WAV, mp3, and FreeSWITCH tone_stream. */
|
|
964
|
+
hold_music?: string;
|
|
965
|
+
/** Enables hold music during SWAIG processing. */
|
|
966
|
+
hold_on_process?: boolean | SWMLVar;
|
|
967
|
+
/** Amount of time, in ms, to wait before exiting the app due to inactivity. Allowed values from `10,000` - `3,600,000`. **Default:** `600000` ms (10 minutes). */
|
|
968
|
+
inactivity_timeout?: number | SWMLVar;
|
|
969
|
+
/** Specifies the AI model to use for the inner dialog feature. Can be set to a different (often smaller/faster) model than the main conversation model. Only used when `enable_inner_dialog` is `true`. */
|
|
970
|
+
inner_dialog_model?: 'gpt-4o-mini' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | string;
|
|
971
|
+
/** The system prompt that guides the inner dialog AI's behavior. This prompt shapes how the background AI */
|
|
972
|
+
inner_dialog_prompt?: string;
|
|
973
|
+
/** When enabled, synchronizes the inner dialog with the main conversation flow. */
|
|
974
|
+
inner_dialog_synced?: boolean | SWMLVar;
|
|
975
|
+
/** Amount of time, in ms, to wait before starting the conversation. Allowed values from `0` - `300,000`. */
|
|
976
|
+
initial_sleep_ms?: number | SWMLVar;
|
|
977
|
+
/** Check for input function with check_for_input. */
|
|
978
|
+
input_poll_freq?: number | SWMLVar;
|
|
979
|
+
/** When enabled, barges agent upon any sound interruption longer than 1 second. */
|
|
980
|
+
interrupt_on_noise?: boolean | SWMLVar;
|
|
981
|
+
/** Provide a prompt for the agent to handle crosstalk. */
|
|
982
|
+
interrupt_prompt?: string;
|
|
983
|
+
/** @deprecated Allows multilingualism when `true`. */
|
|
984
|
+
languages_enabled?: boolean | SWMLVar;
|
|
985
|
+
/** The local timezone setting for the AI. Value should use `IANA TZ ID` */
|
|
986
|
+
local_tz?: string;
|
|
987
|
+
/** If true, the AI Agent will be involved with the diarization process. */
|
|
988
|
+
llm_diarize_aware?: boolean | SWMLVar;
|
|
989
|
+
/** Sets the maximum emotion intensity for the AI voice. Allowed values from `1` - `30`. **Default:** `30`. */
|
|
990
|
+
max_emotion?: number | SWMLVar;
|
|
991
|
+
/** Sets the maximum number of tokens the AI model can generate in a single response. Lower values produce shorter responses and reduce latency. */
|
|
992
|
+
max_response_tokens?: number | SWMLVar;
|
|
993
|
+
/** The ASR (Automatic Speech Recognition) engine to use. Common values include `nova-2` and `nova-3`. */
|
|
994
|
+
openai_asr_engine?: string;
|
|
995
|
+
/** Sets a time duration for the outbound call recipient to respond to the AI agent before timeout, in a range from `10000` to `600000`. **Default:** `120000` ms (2 minutes). */
|
|
996
|
+
outbound_attention_timeout?: number | SWMLVar;
|
|
997
|
+
/** When enabled, the `global_data` object is automatically saved to a channel variable */
|
|
998
|
+
persist_global_data?: boolean | SWMLVar;
|
|
999
|
+
/** Specifies the output format for structured prompts when using the `pom` array in prompt definitions. Valid values are `markdown` or `xml`. */
|
|
1000
|
+
pom_format?: 'markdown' | 'xml';
|
|
1001
|
+
/** Send a summary of the conversation after the call ends. */
|
|
1002
|
+
save_conversation?: boolean | SWMLVar;
|
|
1003
|
+
/** Amount of time, in ms, to wait for a speech event. Allowed values from `0` - `10,000`. **Default:** `1400` ms. */
|
|
1004
|
+
speech_event_timeout?: number | SWMLVar;
|
|
1005
|
+
/** Number of quick stops to generate for speech. Allowed values from `0` - `10`. **Default:** `3`. */
|
|
1006
|
+
speech_gen_quick_stops?: number | SWMLVar;
|
|
1007
|
+
/** Overall speech timeout, in ms. Allowed values from `0` - `600,000`. **Default:** `60000` ms. */
|
|
1008
|
+
speech_timeout?: number | SWMLVar;
|
|
1009
|
+
/** When enabled, the AI agent remains silent until directly addressed by name (using `ai_name`). */
|
|
1010
|
+
speak_when_spoken_to?: boolean | SWMLVar;
|
|
1011
|
+
/** When enabled, the AI agent starts in a paused state and will not respond until the user */
|
|
1012
|
+
start_paused?: boolean | SWMLVar;
|
|
1013
|
+
/** The static greeting to play when the call is answered. This will always play at the beginning of the call. */
|
|
1014
|
+
static_greeting?: string;
|
|
1015
|
+
/** If `true`, the static greeting will not be interrupted by the user if they speak over the greeting. If `false`, the static greeting can be interrupted by the user if they speak over the greeting. */
|
|
1016
|
+
static_greeting_no_barge?: boolean | SWMLVar;
|
|
1017
|
+
/** Defines the mode for summary generation. Allowed values are `"string"` and `"original"`. */
|
|
1018
|
+
summary_mode?: 'string' | 'original' | SWMLVar;
|
|
1019
|
+
/** Allows tweaking any of the indicated settings, such as `barge_match_string`, using the returned SWML from the SWAIG function. **Default:** `true`. */
|
|
1020
|
+
swaig_allow_settings?: boolean | SWMLVar;
|
|
1021
|
+
/** Allows your SWAIG to return SWML to be executed. **Default:** `true`. */
|
|
1022
|
+
swaig_allow_swml?: boolean | SWMLVar;
|
|
1023
|
+
/** Post entire conversation to any SWAIG call. */
|
|
1024
|
+
swaig_post_conversation?: boolean | SWMLVar;
|
|
1025
|
+
/** Allows SWAIG to set global data that persists across calls. **Default:** `true`. */
|
|
1026
|
+
swaig_set_global_data?: boolean | SWMLVar;
|
|
1027
|
+
/** Controls whether SWML variables are included in SWAIG function webhook payloads. */
|
|
1028
|
+
swaig_post_swml_vars?: boolean | string[] | SWMLVar;
|
|
1029
|
+
/** The model to use for the AI's thinking capabilities. Allowed values are `gpt-4o-mini`, `gpt-4.1-mini`, and `gpt-4.1-nano`. */
|
|
1030
|
+
thinking_model?: 'gpt-4o-mini' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | string;
|
|
1031
|
+
/** When enabled, the AI will not respond to the user's input when the user is speaking over the agent. */
|
|
1032
|
+
transparent_barge?: boolean | SWMLVar;
|
|
1033
|
+
/** Maximum time, in ms, for transparent barge mode. Allowed values from `0` - `60,000`. **Default:** `3000` ms. */
|
|
1034
|
+
transparent_barge_max_time?: number | SWMLVar;
|
|
1035
|
+
/** Pass a summary of a conversation from one AI agent to another. For example, transfer a call summary between support agents in two departments. */
|
|
1036
|
+
transfer_summary?: boolean | SWMLVar;
|
|
1037
|
+
/** Time in milliseconds to wait after detecting a potential end-of-turn before finalizing speech recognition. */
|
|
1038
|
+
turn_detection_timeout?: number | SWMLVar;
|
|
1039
|
+
/** The format for the AI agent to reference phone numbers. */
|
|
1040
|
+
tts_number_format?: 'international' | 'national';
|
|
1041
|
+
/** URL of a video file to play when AI is listening to the user speak. Only works for calls that support video. */
|
|
1042
|
+
video_listening_file?: string;
|
|
1043
|
+
/** URL of a video file to play when AI is idle. Only works for calls that support video. */
|
|
1044
|
+
video_idle_file?: string;
|
|
1045
|
+
/** URL of a video file to play when AI is talking. Only works for calls that support video. */
|
|
1046
|
+
video_talking_file?: string;
|
|
1047
|
+
/** The model to use for the AI's vision capabilities. Allowed values are `gpt-4o-mini`, `gpt-4.1-mini`, and `gpt-4.1-nano`. */
|
|
1048
|
+
vision_model?: 'gpt-4o-mini' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | string;
|
|
1049
|
+
/** Configures Silero Voice Activity Detection (VAD) settings. Format: `"threshold"` or `"threshold:frame_ms"`. */
|
|
1050
|
+
vad_config?: string;
|
|
1051
|
+
/** When false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first. */
|
|
1052
|
+
wait_for_user?: boolean | SWMLVar;
|
|
1053
|
+
/** Specifies an additional prefix that must be spoken along with the agent's name (`ai_name`) */
|
|
1054
|
+
wake_prefix?: string;
|
|
1055
|
+
/** The stability slider determines how stable the voice is and the randomness between each generation. Lowering this slider introduces a broader emotional range for the voice. */
|
|
1056
|
+
eleven_labs_stability?: number | SWMLVar;
|
|
1057
|
+
/** The similarity slider dictates how closely the AI should adhere to the original voice when attempting to replicate it. The higher the similarity, the closer the AI will sound to the original voice. */
|
|
1058
|
+
eleven_labs_similarity?: number | SWMLVar;
|
|
1059
|
+
[key: string]: unknown;
|
|
1060
|
+
}
|
|
1061
|
+
export type AIPostPrompt = AIPostPromptText | AIPostPromptPom;
|
|
1062
|
+
export interface Pronounce {
|
|
1063
|
+
/** The expression to replace. */
|
|
1064
|
+
replace?: string;
|
|
1065
|
+
/** The phonetic spelling of the expression. */
|
|
1066
|
+
with?: string;
|
|
1067
|
+
/** Whether the pronunciation replacement should ignore case. **Default:** `true`. */
|
|
1068
|
+
ignore_case?: boolean | SWMLVar;
|
|
1069
|
+
[key: string]: unknown;
|
|
1070
|
+
}
|
|
1071
|
+
export type AIPrompt = AIPromptText | AIPromptPom;
|
|
1072
|
+
export interface SWAIG {
|
|
1073
|
+
/** Default settings for all SWAIG functions. If `defaults` is not set, settings may be set in each function object. Default is not set. */
|
|
1074
|
+
defaults?: SWAIGDefaults;
|
|
1075
|
+
/** Prebuilt functions the AI agent is able to call from this list of available native functions */
|
|
1076
|
+
native_functions?: SWAIGNativeFunction[];
|
|
1077
|
+
/** An array of objects to include remote function signatures. */
|
|
1078
|
+
includes?: SWAIGIncludes[];
|
|
1079
|
+
/** An array of JSON objects to define functions that can be executed during the interaction with the AI. Default is not set. */
|
|
1080
|
+
functions?: SWAIGFunction[];
|
|
1081
|
+
/** An object containing filler phrases for internal SWAIG functions. These fillers are played while utilizing internal functions. */
|
|
1082
|
+
internal_fillers?: SWAIGInternalFiller;
|
|
1083
|
+
[key: string]: unknown;
|
|
1084
|
+
}
|
|
1085
|
+
export interface BedrockParams {
|
|
1086
|
+
/** Amount of time, in ms, to wait before prompting the user to respond. Allowed values from `10,000` - `600,000`. Set to `0` to disable. **Default:** `5000` ms. */
|
|
1087
|
+
attention_timeout?: AttentionTimeout | 0 | SWMLVar;
|
|
1088
|
+
/** Specifies the maximum duration fopr the AI Agent to remain active before it exists the session. */
|
|
1089
|
+
hard_stop_time?: string | SWMLVar;
|
|
1090
|
+
/** Amount of time, in ms, to wait before exiting the app due to inactivity. Allowed values from `10,000` - `3,600,000`. **Default:** `600000` ms (10 minutes). */
|
|
1091
|
+
inactivity_timeout?: number | SWMLVar;
|
|
1092
|
+
/** URL of a video file to play when AI is listening to the user speak. Only works for calls that support video. */
|
|
1093
|
+
video_listening_file?: string;
|
|
1094
|
+
/** URL of a video file to play when AI is idle. Only works for calls that support video. */
|
|
1095
|
+
video_idle_file?: string;
|
|
1096
|
+
/** URL of a video file to play when AI is talking. Only works for calls that support video. */
|
|
1097
|
+
video_talking_file?: string;
|
|
1098
|
+
/** A final prompt that is fed into the AI when the `hard_stop_time` is reached. */
|
|
1099
|
+
hard_stop_prompt?: string;
|
|
1100
|
+
[key: string]: unknown;
|
|
1101
|
+
}
|
|
1102
|
+
export type BedrockPostPrompt = OmitPropertiesBedrockPostPomptTextOmittedPromptProps | OmitPropertiesBedrockPostPromptPomOmittedPromptProps;
|
|
1103
|
+
export type BedrockPrompt = OmitPropertiesBedrockPromptTextOmittedPromptProps | OmitPropertiesBedrockPromptPomOmittedPromptProps;
|
|
1104
|
+
export interface BedrockSWAIG {
|
|
1105
|
+
/** An array of JSON objects to define functions that can be executed during the interaction with the Bedrock AI. Default is not set. */
|
|
1106
|
+
functions?: BedrockSWAIGFunction[];
|
|
1107
|
+
/** Default settings for all SWAIG functions. If `defaults` is not set, settings may be set in each function object. Default is not set. */
|
|
1108
|
+
defaults?: SWAIGDefaults;
|
|
1109
|
+
/** Prebuilt functions the AI agent is able to call from this list of available native functions */
|
|
1110
|
+
native_functions?: SWAIGNativeFunction[];
|
|
1111
|
+
/** An array of objects to include remote function signatures. */
|
|
1112
|
+
includes?: SWAIGIncludes[];
|
|
1113
|
+
[key: string]: unknown;
|
|
1114
|
+
}
|
|
1115
|
+
export interface CondReg {
|
|
1116
|
+
/** The JavaScript condition to act on. */
|
|
1117
|
+
when?: string;
|
|
1118
|
+
/** Sequence of SWML methods to execute when the condition evaluates to true. */
|
|
1119
|
+
then?: SWMLMethod[];
|
|
1120
|
+
/** Sequence of SWML methods to execute when none of the other conditions evaluate to true. */
|
|
1121
|
+
else?: SWMLMethod[];
|
|
1122
|
+
[key: string]: unknown;
|
|
1123
|
+
}
|
|
1124
|
+
export interface CondElse {
|
|
1125
|
+
/** Sequence of SWML methods to execute when none of the other conditions evaluate to true. */
|
|
1126
|
+
else?: SWMLMethod[];
|
|
1127
|
+
[key: string]: unknown;
|
|
1128
|
+
}
|
|
1129
|
+
export interface ConnectHeaders {
|
|
1130
|
+
/** The name of the header. */
|
|
1131
|
+
name?: string;
|
|
1132
|
+
/** The value of the header. */
|
|
1133
|
+
value?: string;
|
|
1134
|
+
[key: string]: unknown;
|
|
1135
|
+
}
|
|
1136
|
+
export interface ConnectSwitch {
|
|
1137
|
+
/** Name of the variable whose value needs to be compared. If not provided, it will check the `connect_result` variable. */
|
|
1138
|
+
variable?: string;
|
|
1139
|
+
/** Object of values mapped to array of instructions to execute */
|
|
1140
|
+
case?: {
|
|
1141
|
+
[key: string]: SWMLMethod[];
|
|
1142
|
+
};
|
|
1143
|
+
/** Array of instructions to execute if no cases match */
|
|
1144
|
+
default?: SWMLMethod[];
|
|
1145
|
+
[key: string]: unknown;
|
|
1146
|
+
}
|
|
1147
|
+
export type ValidConfirmMethods = Cond | Set_ | Unset | Hangup | Play | Prompt | Record_ | RecordCall | StopRecordCall | Tap | StopTap | SendDigits | SendSMS | Denoise | StopDenoise;
|
|
1148
|
+
export type CallStatus = 'created' | 'ringing' | 'answered' | 'ended';
|
|
1149
|
+
export interface TranscribeStartAction {
|
|
1150
|
+
/** Starts live transcription of the call. The transcription will be sent to the specified URL. */
|
|
1151
|
+
start?: {
|
|
1152
|
+
/** Enables AI summarization of the transcription. The summary will be sent to the specified URL at the end of the conversation. */
|
|
1153
|
+
ai_summary?: boolean | SWMLVar;
|
|
1154
|
+
/** The webhook URL the transcription will be sent to. */
|
|
1155
|
+
webhook?: string;
|
|
1156
|
+
/** The language to transcribe. */
|
|
1157
|
+
lang: string;
|
|
1158
|
+
/** Whether to enable live events. */
|
|
1159
|
+
live_events?: boolean | SWMLVar;
|
|
1160
|
+
/** The timeout for speech recognition in milliseconds. */
|
|
1161
|
+
speech_timeout?: number | SWMLVar;
|
|
1162
|
+
/** Voice activity detection silence time in milliseconds. Default depends on speech engine: `300` for Deepgram, `500` for Google. */
|
|
1163
|
+
vad_silence_ms?: number | SWMLVar;
|
|
1164
|
+
/** Voice activity detection threshold (0-1800). */
|
|
1165
|
+
vad_thresh?: number | SWMLVar;
|
|
1166
|
+
/** Debug level for logging (0-2). */
|
|
1167
|
+
debug_level?: number | SWMLVar;
|
|
1168
|
+
/** The direction of the call that should be transcribed. */
|
|
1169
|
+
direction: TranscribeDirection[];
|
|
1170
|
+
/** The speech engine to use for speech recognition. */
|
|
1171
|
+
speech_engine?: SpeechEngine;
|
|
1172
|
+
/** The AI prompt that instructs how to summarize the conversation when `ai_summary` is enabled. */
|
|
1173
|
+
ai_summary_prompt?: string;
|
|
1174
|
+
[key: string]: Record<string, unknown> | boolean | SWMLVar | string | number | SWMLVar | TranscribeDirection[] | SpeechEngine | undefined;
|
|
1175
|
+
};
|
|
1176
|
+
[key: string]: unknown;
|
|
1177
|
+
}
|
|
1178
|
+
export type TranscribeSummarizeActionUnion = TranscribeSummarizeAction | 'summarize';
|
|
1179
|
+
export interface StartAction {
|
|
1180
|
+
/** Starts live translation of the call. The translation will be sent to the specified URL. */
|
|
1181
|
+
start?: {
|
|
1182
|
+
/** The webhook URL to be called. */
|
|
1183
|
+
webhook?: string;
|
|
1184
|
+
/** The language to translate from. */
|
|
1185
|
+
from_lang: string;
|
|
1186
|
+
/** The language to translate to. */
|
|
1187
|
+
to_lang: string;
|
|
1188
|
+
/** The TTS voice you want to use for the source language. */
|
|
1189
|
+
from_voice?: string;
|
|
1190
|
+
/** The TTS voice you want to use for the target language. */
|
|
1191
|
+
to_voice?: string;
|
|
1192
|
+
/** Translation filter for the source language direction. */
|
|
1193
|
+
filter_from?: TranslationFilterPreset | CustomTranslationFilter;
|
|
1194
|
+
/** Translation filter for the target language direction. */
|
|
1195
|
+
filter_to?: TranslationFilterPreset | CustomTranslationFilter;
|
|
1196
|
+
/** Whether to enable live events. */
|
|
1197
|
+
live_events?: boolean | SWMLVar;
|
|
1198
|
+
/** Whether to enable AI summarization. */
|
|
1199
|
+
ai_summary?: boolean | SWMLVar;
|
|
1200
|
+
/** The timeout for speech recognition in milliseconds. */
|
|
1201
|
+
speech_timeout?: number | SWMLVar;
|
|
1202
|
+
/** Voice activity detection silence time in milliseconds. Default depends on speech engine: `300` for Deepgram, `500` for Google. */
|
|
1203
|
+
vad_silence_ms?: number | SWMLVar;
|
|
1204
|
+
/** Voice activity detection threshold (0-1800). */
|
|
1205
|
+
vad_thresh?: number | SWMLVar;
|
|
1206
|
+
/** Debug level for logging (0-2). */
|
|
1207
|
+
debug_level?: number | SWMLVar;
|
|
1208
|
+
/** The direction of the call that should be translated. */
|
|
1209
|
+
direction: TranslateDirection[];
|
|
1210
|
+
/** The speech engine to use for speech recognition. */
|
|
1211
|
+
speech_engine?: SpeechEngine;
|
|
1212
|
+
/** The AI prompt that instructs how to summarize the conversation when `ai_summary` is enabled. */
|
|
1213
|
+
ai_summary_prompt?: string;
|
|
1214
|
+
[key: string]: Record<string, unknown> | string | TranslationFilterPreset | CustomTranslationFilter | boolean | SWMLVar | number | SWMLVar | TranslateDirection[] | SpeechEngine | undefined;
|
|
1215
|
+
};
|
|
1216
|
+
[key: string]: unknown;
|
|
1217
|
+
}
|
|
1218
|
+
export type SummarizeActionUnion = SummarizeAction | 'summarize';
|
|
1219
|
+
export interface InjectAction {
|
|
1220
|
+
/** Injects a message into the conversation to be translated and spoken to the specified party. */
|
|
1221
|
+
inject?: {
|
|
1222
|
+
/** The message to be injected */
|
|
1223
|
+
message: string;
|
|
1224
|
+
/** The direction of the message. */
|
|
1225
|
+
direction: TranslateDirection;
|
|
1226
|
+
[key: string]: Record<string, unknown> | string | TranslateDirection;
|
|
1227
|
+
};
|
|
1228
|
+
[key: string]: unknown;
|
|
1229
|
+
}
|
|
1230
|
+
export type PayPromptAction = PayPromptSayAction | PayPromptPlayAction;
|
|
1231
|
+
export interface LanguagesWithSoloFillers {
|
|
1232
|
+
/** Name of the language (e.g., 'French', 'English'). This value is used in the system prompt to instruct the LLM what language is being spoken. */
|
|
1233
|
+
name?: string;
|
|
1234
|
+
/** The language code for ASR (Automatic Speech Recognition) purposes. By default, SignalWire uses Deepgram's */
|
|
1235
|
+
code?: string;
|
|
1236
|
+
/** Voice to use for the language. String format: `<engine id>.<voice id>`. */
|
|
1237
|
+
voice?: string;
|
|
1238
|
+
/** The model to use for the specified TTS engine. For example, 'arcana'. */
|
|
1239
|
+
model?: string;
|
|
1240
|
+
/** Enables emotion detection for the set TTS engine. This allows the AI to express emotions when speaking. */
|
|
1241
|
+
emotion?: 'auto';
|
|
1242
|
+
/** The speed to use for the specified TTS engine. This allows the AI to speak at a different speed at different points in the conversation. */
|
|
1243
|
+
speed?: 'auto';
|
|
1244
|
+
/** The engine to use for the language. For example, 'elevenlabs'. */
|
|
1245
|
+
engine?: string;
|
|
1246
|
+
/** TTS engine-specific parameters for this language. */
|
|
1247
|
+
params?: LanguageParams;
|
|
1248
|
+
/** An array of strings to be used as fillers in the conversation. This will be used for both speech and function fillers if provided. */
|
|
1249
|
+
fillers?: string[];
|
|
1250
|
+
[key: string]: unknown;
|
|
1251
|
+
}
|
|
1252
|
+
export interface LanguagesWithFillers {
|
|
1253
|
+
/** Name of the language (e.g., 'French', 'English'). This value is used in the system prompt to instruct the LLM what language is being spoken. */
|
|
1254
|
+
name?: string;
|
|
1255
|
+
/** The language code for ASR (Automatic Speech Recognition) purposes. By default, SignalWire uses Deepgram's */
|
|
1256
|
+
code?: string;
|
|
1257
|
+
/** Voice to use for the language. String format: `<engine id>.<voice id>`. */
|
|
1258
|
+
voice?: string;
|
|
1259
|
+
/** The model to use for the specified TTS engine. For example, 'arcana'. */
|
|
1260
|
+
model?: string;
|
|
1261
|
+
/** Enables emotion detection for the set TTS engine. This allows the AI to express emotions when speaking. */
|
|
1262
|
+
emotion?: 'auto';
|
|
1263
|
+
/** The speed to use for the specified TTS engine. This allows the AI to speak at a different speed at different points in the conversation. */
|
|
1264
|
+
speed?: 'auto';
|
|
1265
|
+
/** The engine to use for the language. For example, 'elevenlabs'. */
|
|
1266
|
+
engine?: string;
|
|
1267
|
+
/** TTS engine-specific parameters for this language. */
|
|
1268
|
+
params?: LanguageParams;
|
|
1269
|
+
/** An array of strings to be used as fillers in the conversation when calling a `swaig function`. This helps the AI break silence between responses. The filler is played asynchronously during the function call. */
|
|
1270
|
+
function_fillers?: string[];
|
|
1271
|
+
/** An array of strings to be used as fillers in the conversation. This helps the AI break silence between responses. */
|
|
1272
|
+
speech_fillers?: string[];
|
|
1273
|
+
[key: string]: unknown;
|
|
1274
|
+
}
|
|
1275
|
+
export type AttentionTimeout = number;
|
|
1276
|
+
/** A message object representing a single turn in the conversation history. */
|
|
1277
|
+
export interface ConversationMessage {
|
|
1278
|
+
/** The role of the message sender. */
|
|
1279
|
+
role?: ConversationRole;
|
|
1280
|
+
/** The text content of the message. */
|
|
1281
|
+
content?: string;
|
|
1282
|
+
/** Optional language code for the message (e.g., 'en', 'es', 'fr'). */
|
|
1283
|
+
lang?: string;
|
|
1284
|
+
[key: string]: unknown;
|
|
1285
|
+
}
|
|
1286
|
+
export type Direction = 'inbound' | 'outbound';
|
|
1287
|
+
export interface AIPostPromptText {
|
|
1288
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1289
|
+
max_tokens?: number;
|
|
1290
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1291
|
+
temperature?: number | SWMLVar;
|
|
1292
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1293
|
+
top_p?: number | SWMLVar;
|
|
1294
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1295
|
+
confidence?: number | SWMLVar;
|
|
1296
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1297
|
+
presence_penalty?: number | SWMLVar;
|
|
1298
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1299
|
+
frequency_penalty?: number | SWMLVar;
|
|
1300
|
+
/** The instructions to send to the agent. */
|
|
1301
|
+
text?: string;
|
|
1302
|
+
[key: string]: unknown;
|
|
1303
|
+
}
|
|
1304
|
+
export interface AIPostPromptPom {
|
|
1305
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1306
|
+
max_tokens?: number;
|
|
1307
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1308
|
+
temperature?: number | SWMLVar;
|
|
1309
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1310
|
+
top_p?: number | SWMLVar;
|
|
1311
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1312
|
+
confidence?: number | SWMLVar;
|
|
1313
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1314
|
+
presence_penalty?: number | SWMLVar;
|
|
1315
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1316
|
+
frequency_penalty?: number | SWMLVar;
|
|
1317
|
+
/** The instructions to send to the agent. */
|
|
1318
|
+
pom?: POM[];
|
|
1319
|
+
[key: string]: unknown;
|
|
1320
|
+
}
|
|
1321
|
+
export interface AIPromptText {
|
|
1322
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1323
|
+
max_tokens?: number;
|
|
1324
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1325
|
+
temperature?: number | SWMLVar;
|
|
1326
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1327
|
+
top_p?: number | SWMLVar;
|
|
1328
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1329
|
+
confidence?: number | SWMLVar;
|
|
1330
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1331
|
+
presence_penalty?: number | SWMLVar;
|
|
1332
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1333
|
+
frequency_penalty?: number | SWMLVar;
|
|
1334
|
+
/** The instructions to send to the agent. */
|
|
1335
|
+
text?: string;
|
|
1336
|
+
/** An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. */
|
|
1337
|
+
contexts?: Contexts;
|
|
1338
|
+
[key: string]: unknown;
|
|
1339
|
+
}
|
|
1340
|
+
export interface AIPromptPom {
|
|
1341
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1342
|
+
max_tokens?: number;
|
|
1343
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1344
|
+
temperature?: number | SWMLVar;
|
|
1345
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1346
|
+
top_p?: number | SWMLVar;
|
|
1347
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1348
|
+
confidence?: number | SWMLVar;
|
|
1349
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1350
|
+
presence_penalty?: number | SWMLVar;
|
|
1351
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1352
|
+
frequency_penalty?: number | SWMLVar;
|
|
1353
|
+
/** Prompt Object Model (POM) is a structured data format for composing, organizing, and rendering prompt instructions for AI agents. */
|
|
1354
|
+
pom?: POM[];
|
|
1355
|
+
/** An object that defines the context steps for the AI. The context steps are used to define the flow of the conversation. */
|
|
1356
|
+
contexts?: Contexts;
|
|
1357
|
+
[key: string]: unknown;
|
|
1358
|
+
}
|
|
1359
|
+
export interface SWAIGDefaults {
|
|
1360
|
+
/** Default URL to send status callbacks and reports to. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1361
|
+
web_hook_url?: string;
|
|
1362
|
+
[key: string]: unknown;
|
|
1363
|
+
}
|
|
1364
|
+
export type SWAIGNativeFunction = 'check_time' | 'wait_seconds' | 'wait_for_user' | 'adjust_response_latency';
|
|
1365
|
+
export interface SWAIGIncludes {
|
|
1366
|
+
/** Remote functions to fetch and include in your AI application. */
|
|
1367
|
+
functions?: string[];
|
|
1368
|
+
/** URL to fetch remote functions and include in your AI application. Authentication can also be set in the url in the format of `username:password@url`. */
|
|
1369
|
+
url?: string;
|
|
1370
|
+
/** User-defined metadata to pass with the remote function request. */
|
|
1371
|
+
meta_data?: {
|
|
1372
|
+
[key: string]: Record<string, unknown>;
|
|
1373
|
+
};
|
|
1374
|
+
[key: string]: unknown;
|
|
1375
|
+
}
|
|
1376
|
+
export type SWAIGFunction = UserSWAIGFunction | StartUpHookSWAIGFunction | HangUpHookSWAIGFunction | SummarizeConversationSWAIGFunction;
|
|
1377
|
+
export interface SWAIGInternalFiller {
|
|
1378
|
+
/** Filler phrases played when the AI Agent is hanging up the call. */
|
|
1379
|
+
hangup?: FunctionFillers;
|
|
1380
|
+
/** Filler phrases played when the AI Agent is checking the time. */
|
|
1381
|
+
check_time?: FunctionFillers;
|
|
1382
|
+
/** Filler phrases played when the AI Agent is waiting for user input. */
|
|
1383
|
+
wait_for_user?: FunctionFillers;
|
|
1384
|
+
/** Filler phrases played during deliberate pauses or wait periods. */
|
|
1385
|
+
wait_seconds?: FunctionFillers;
|
|
1386
|
+
/** Filler phrases played when the AI Agent is adjusting response timing. */
|
|
1387
|
+
adjust_response_latency?: FunctionFillers;
|
|
1388
|
+
/** Filler phrases played when transitioning between conversation steps when utilizing `prompt.contexts`. */
|
|
1389
|
+
next_step?: FunctionFillers;
|
|
1390
|
+
/** Filler phrases played when switching between conversation contexts when utilizing `prompt.contexts`. */
|
|
1391
|
+
change_context?: FunctionFillers;
|
|
1392
|
+
/** Filler phrases played when the AI Agent is processing visual input. This function is enabled when `enable_vision` is set to `true` in `ai.params`. */
|
|
1393
|
+
get_visual_input?: FunctionFillers;
|
|
1394
|
+
/** Filler phrases played when the AI Agent is thinking or considering options. This is utilized when `enable_thinking` is set to `true` in `ai.params`. */
|
|
1395
|
+
get_ideal_strategy?: FunctionFillers;
|
|
1396
|
+
[key: string]: unknown;
|
|
1397
|
+
}
|
|
1398
|
+
/** The template for omitting properties. */
|
|
1399
|
+
export interface OmitPropertiesBedrockPostPomptTextOmittedPromptProps {
|
|
1400
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1401
|
+
max_tokens?: number;
|
|
1402
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1403
|
+
temperature?: number | SWMLVar;
|
|
1404
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1405
|
+
top_p?: number | SWMLVar;
|
|
1406
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1407
|
+
confidence?: number | SWMLVar;
|
|
1408
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1409
|
+
presence_penalty?: number | SWMLVar;
|
|
1410
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1411
|
+
frequency_penalty?: number | SWMLVar;
|
|
1412
|
+
/** The instructions to send to the agent. */
|
|
1413
|
+
text?: string;
|
|
1414
|
+
[key: string]: unknown;
|
|
1415
|
+
}
|
|
1416
|
+
/** The template for omitting properties. */
|
|
1417
|
+
export interface OmitPropertiesBedrockPostPromptPomOmittedPromptProps {
|
|
1418
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1419
|
+
max_tokens?: number;
|
|
1420
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1421
|
+
temperature?: number | SWMLVar;
|
|
1422
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1423
|
+
top_p?: number | SWMLVar;
|
|
1424
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1425
|
+
confidence?: number | SWMLVar;
|
|
1426
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1427
|
+
presence_penalty?: number | SWMLVar;
|
|
1428
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1429
|
+
frequency_penalty?: number | SWMLVar;
|
|
1430
|
+
/** The instructions to send to the agent. */
|
|
1431
|
+
pom?: POM[];
|
|
1432
|
+
[key: string]: unknown;
|
|
1433
|
+
}
|
|
1434
|
+
/** The template for omitting properties. */
|
|
1435
|
+
export interface OmitPropertiesBedrockPromptTextOmittedPromptProps {
|
|
1436
|
+
voice_id?: 'tiffany' | 'matthew' | 'amy' | 'lupe' | 'carlos';
|
|
1437
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1438
|
+
max_tokens?: number;
|
|
1439
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1440
|
+
temperature?: number | SWMLVar;
|
|
1441
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1442
|
+
top_p?: number | SWMLVar;
|
|
1443
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1444
|
+
confidence?: number | SWMLVar;
|
|
1445
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1446
|
+
presence_penalty?: number | SWMLVar;
|
|
1447
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1448
|
+
frequency_penalty?: number | SWMLVar;
|
|
1449
|
+
/** The instructions to send to the agent. */
|
|
1450
|
+
text?: string;
|
|
1451
|
+
[key: string]: unknown;
|
|
1452
|
+
}
|
|
1453
|
+
/** The template for omitting properties. */
|
|
1454
|
+
export interface OmitPropertiesBedrockPromptPomOmittedPromptProps {
|
|
1455
|
+
voice_id?: 'tiffany' | 'matthew' | 'amy' | 'lupe' | 'carlos';
|
|
1456
|
+
/** Limits the amount of tokens that the AI agent may generate when creating its response */
|
|
1457
|
+
max_tokens?: number;
|
|
1458
|
+
/** Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1459
|
+
temperature?: number | SWMLVar;
|
|
1460
|
+
/** Randomness setting. Alternative to `temperature`. Float value between 0.0 and 1.0. Closer to 0 will make the output less random. **Default:** `1.0`. */
|
|
1461
|
+
top_p?: number | SWMLVar;
|
|
1462
|
+
/** Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. */
|
|
1463
|
+
confidence?: number | SWMLVar;
|
|
1464
|
+
/** Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics. **Default:** `0`. */
|
|
1465
|
+
presence_penalty?: number | SWMLVar;
|
|
1466
|
+
/** Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim. **Default:** `0`. */
|
|
1467
|
+
frequency_penalty?: number | SWMLVar;
|
|
1468
|
+
/** The instructions to send to the agent. */
|
|
1469
|
+
pom?: POM[];
|
|
1470
|
+
[key: string]: unknown;
|
|
1471
|
+
}
|
|
1472
|
+
export type BedrockSWAIGFunction = PickPropertiesUserSWAIGFunctionPickedSWAIGFunctionProps | PickPropertiesStartUpHookSWAIGFunctionPickedSWAIGFunctionProps | PickPropertiesHangUpHookSWAIGFunctionPickedSWAIGFunctionProps | PickPropertiesSummarizeConversationSWAIGFunctionPickedSWAIGFunctionProps;
|
|
1473
|
+
export type TranscribeDirection = 'remote-caller' | 'local-caller';
|
|
1474
|
+
/** Speech recognition engine options. */
|
|
1475
|
+
export type SpeechEngine = 'deepgram' | 'google';
|
|
1476
|
+
export interface TranscribeSummarizeAction {
|
|
1477
|
+
/** Summarizes the conversation as an object, allowing you to specify the webhook url and prompt for the summary. */
|
|
1478
|
+
summarize?: {
|
|
1479
|
+
/** The webhook URL to be called. */
|
|
1480
|
+
webhook?: string;
|
|
1481
|
+
/** The prompt for summarization. */
|
|
1482
|
+
prompt?: string;
|
|
1483
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
1484
|
+
};
|
|
1485
|
+
[key: string]: unknown;
|
|
1486
|
+
}
|
|
1487
|
+
/** Preset translation filter values that adjust the tone or style of translated speech. */
|
|
1488
|
+
export type TranslationFilterPreset = 'polite' | 'rude' | 'professional' | 'shakespeare' | 'gen-z';
|
|
1489
|
+
/** Custom translation filter with a prompt prefix. Use `prompt:` followed by your custom instructions (e.g., `prompt:Use formal business language`). */
|
|
1490
|
+
export type CustomTranslationFilter = string;
|
|
1491
|
+
export type TranslateDirection = 'remote-caller' | 'local-caller';
|
|
1492
|
+
export interface SummarizeAction {
|
|
1493
|
+
/** Summarizes the conversation as an object, allowing you to specify the webhook url and prompt for the summary. */
|
|
1494
|
+
summarize?: {
|
|
1495
|
+
/** The webhook URL to be called. */
|
|
1496
|
+
webhook?: string;
|
|
1497
|
+
/** The AI prompt that instructs how to summarize the conversation. */
|
|
1498
|
+
prompt?: string;
|
|
1499
|
+
[key: string]: Record<string, unknown> | string | undefined;
|
|
1500
|
+
};
|
|
1501
|
+
[key: string]: unknown;
|
|
1502
|
+
}
|
|
1503
|
+
export interface PayPromptSayAction {
|
|
1504
|
+
/** When the action `type` is `Say`, this value is the text to be spoken; when the type is `Play`, it should be a URL to the audio file. */
|
|
1505
|
+
type?: 'Say';
|
|
1506
|
+
/** The phrase to speak */
|
|
1507
|
+
phrase?: string;
|
|
1508
|
+
[key: string]: unknown;
|
|
1509
|
+
}
|
|
1510
|
+
export interface PayPromptPlayAction {
|
|
1511
|
+
/** When the action `type` is `Say`, this value is the text to be spoken; when the type is `Play`, it should be a URL to the audio file. */
|
|
1512
|
+
type?: 'Play';
|
|
1513
|
+
/** The URL of the audio file to play */
|
|
1514
|
+
phrase?: string;
|
|
1515
|
+
[key: string]: unknown;
|
|
1516
|
+
}
|
|
1517
|
+
export interface LanguageParams {
|
|
1518
|
+
/** The stability slider determines how stable the voice is and the randomness between each generation. Lowering this slider introduces a broader emotional range for the voice. IMPORTANT: Only works with ElevenLabs TTS engine. */
|
|
1519
|
+
stability?: number | SWMLVar;
|
|
1520
|
+
/** The similarity slider dictates how closely the AI should adhere to the original voice when attempting to replicate it. The higher the similarity, the closer the AI will sound to the original voice. IMPORTANT: Only works with ElevenLabs TTS engine. */
|
|
1521
|
+
similarity?: number | SWMLVar;
|
|
1522
|
+
[key: string]: unknown;
|
|
1523
|
+
}
|
|
1524
|
+
export type ConversationRole = 'user' | 'assistant' | 'system';
|
|
1525
|
+
/** Regular section that requires either body or bullets. */
|
|
1526
|
+
export type POM = PomSectionBodyContent | PomSectionBulletsContent;
|
|
1527
|
+
export interface Contexts {
|
|
1528
|
+
/** The default context to use at the beginning of the conversation. Additional context steps can be defined as any other key in the object. */
|
|
1529
|
+
default?: ContextsObject;
|
|
1530
|
+
[key: string]: unknown;
|
|
1531
|
+
}
|
|
1532
|
+
export interface UserSWAIGFunction {
|
|
1533
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1534
|
+
description?: string;
|
|
1535
|
+
/** The purpose field has been deprecated and is replaced by the `description` field. */
|
|
1536
|
+
purpose?: string;
|
|
1537
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1538
|
+
parameters?: FunctionParameters;
|
|
1539
|
+
/** A JSON object defining the fillers that should be played when calling a `swaig function`. This helps the AI break silence between responses. The filler is played asynchronously during the function call. */
|
|
1540
|
+
fillers?: FunctionFillers;
|
|
1541
|
+
/** The argument field has been deprecated and is replaced by the `parameters` field. */
|
|
1542
|
+
argument?: FunctionParameters;
|
|
1543
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1544
|
+
active?: boolean | SWMLVar;
|
|
1545
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1546
|
+
meta_data?: {
|
|
1547
|
+
[key: string]: Record<string, unknown>;
|
|
1548
|
+
};
|
|
1549
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1550
|
+
meta_data_token?: string;
|
|
1551
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1552
|
+
data_map?: DataMap;
|
|
1553
|
+
/** Skips the top-level fillers specified in `ai.languages` (which includes `speech_fillers` and `function_fillers`). */
|
|
1554
|
+
skip_fillers?: boolean | SWMLVar;
|
|
1555
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1556
|
+
web_hook_url?: string;
|
|
1557
|
+
/** A file to play while the function is running. `wait_file_loops` can specify the amount of times that files should continously play. Default is not set. */
|
|
1558
|
+
wait_file?: string;
|
|
1559
|
+
/** The number of times to loop playing the file. Default is not set. */
|
|
1560
|
+
wait_file_loops?: number | string;
|
|
1561
|
+
/** Whether to wait for fillers to finish playing before continuing with the function. **Default:** `false`. */
|
|
1562
|
+
wait_for_fillers?: boolean | SWMLVar;
|
|
1563
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. */
|
|
1564
|
+
function?: string;
|
|
1565
|
+
[key: string]: unknown;
|
|
1566
|
+
}
|
|
1567
|
+
export interface StartUpHookSWAIGFunction {
|
|
1568
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1569
|
+
description?: string;
|
|
1570
|
+
/** The purpose field has been deprecated and is replaced by the `description` field. */
|
|
1571
|
+
purpose?: string;
|
|
1572
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1573
|
+
parameters?: FunctionParameters;
|
|
1574
|
+
/** A JSON object defining the fillers that should be played when calling a `swaig function`. This helps the AI break silence between responses. The filler is played asynchronously during the function call. */
|
|
1575
|
+
fillers?: FunctionFillers;
|
|
1576
|
+
/** The argument field has been deprecated and is replaced by the `parameters` field. */
|
|
1577
|
+
argument?: FunctionParameters;
|
|
1578
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1579
|
+
active?: boolean | SWMLVar;
|
|
1580
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1581
|
+
meta_data?: {
|
|
1582
|
+
[key: string]: Record<string, unknown>;
|
|
1583
|
+
};
|
|
1584
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1585
|
+
meta_data_token?: string;
|
|
1586
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1587
|
+
data_map?: DataMap;
|
|
1588
|
+
/** Skips the top-level fillers specified in `ai.languages` (which includes `speech_fillers` and `function_fillers`). */
|
|
1589
|
+
skip_fillers?: boolean | SWMLVar;
|
|
1590
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1591
|
+
web_hook_url?: string;
|
|
1592
|
+
/** A file to play while the function is running. `wait_file_loops` can specify the amount of times that files should continously play. Default is not set. */
|
|
1593
|
+
wait_file?: string;
|
|
1594
|
+
/** The number of times to loop playing the file. Default is not set. */
|
|
1595
|
+
wait_file_loops?: number | string;
|
|
1596
|
+
/** Whether to wait for fillers to finish playing before continuing with the function. **Default:** `false`. */
|
|
1597
|
+
wait_for_fillers?: boolean | SWMLVar;
|
|
1598
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. For the start_hook function, the function name is 'start_hook'. */
|
|
1599
|
+
function?: 'startup_hook';
|
|
1600
|
+
[key: string]: unknown;
|
|
1601
|
+
}
|
|
1602
|
+
export interface HangUpHookSWAIGFunction {
|
|
1603
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1604
|
+
description?: string;
|
|
1605
|
+
/** The purpose field has been deprecated and is replaced by the `description` field. */
|
|
1606
|
+
purpose?: string;
|
|
1607
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1608
|
+
parameters?: FunctionParameters;
|
|
1609
|
+
/** A JSON object defining the fillers that should be played when calling a `swaig function`. This helps the AI break silence between responses. The filler is played asynchronously during the function call. */
|
|
1610
|
+
fillers?: FunctionFillers;
|
|
1611
|
+
/** The argument field has been deprecated and is replaced by the `parameters` field. */
|
|
1612
|
+
argument?: FunctionParameters;
|
|
1613
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1614
|
+
active?: boolean | SWMLVar;
|
|
1615
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1616
|
+
meta_data?: {
|
|
1617
|
+
[key: string]: Record<string, unknown>;
|
|
1618
|
+
};
|
|
1619
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1620
|
+
meta_data_token?: string;
|
|
1621
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1622
|
+
data_map?: DataMap;
|
|
1623
|
+
/** Skips the top-level fillers specified in `ai.languages` (which includes `speech_fillers` and `function_fillers`). */
|
|
1624
|
+
skip_fillers?: boolean | SWMLVar;
|
|
1625
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1626
|
+
web_hook_url?: string;
|
|
1627
|
+
/** A file to play while the function is running. `wait_file_loops` can specify the amount of times that files should continously play. Default is not set. */
|
|
1628
|
+
wait_file?: string;
|
|
1629
|
+
/** The number of times to loop playing the file. Default is not set. */
|
|
1630
|
+
wait_file_loops?: number | string;
|
|
1631
|
+
/** Whether to wait for fillers to finish playing before continuing with the function. **Default:** `false`. */
|
|
1632
|
+
wait_for_fillers?: boolean | SWMLVar;
|
|
1633
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. For the stop_hook function, the function name is 'stop_hook'. */
|
|
1634
|
+
function?: 'hangup_hook';
|
|
1635
|
+
[key: string]: unknown;
|
|
1636
|
+
}
|
|
1637
|
+
/** An internal reserved function that generates a summary of the conversation and sends any specified properties to the configured webhook after the conversation has ended. */
|
|
1638
|
+
export interface SummarizeConversationSWAIGFunction {
|
|
1639
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1640
|
+
description?: string;
|
|
1641
|
+
/** The purpose field has been deprecated and is replaced by the `description` field. */
|
|
1642
|
+
purpose?: string;
|
|
1643
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1644
|
+
parameters?: FunctionParameters;
|
|
1645
|
+
/** A JSON object defining the fillers that should be played when calling a `swaig function`. This helps the AI break silence between responses. The filler is played asynchronously during the function call. */
|
|
1646
|
+
fillers?: FunctionFillers;
|
|
1647
|
+
/** The argument field has been deprecated and is replaced by the `parameters` field. */
|
|
1648
|
+
argument?: FunctionParameters;
|
|
1649
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1650
|
+
active?: boolean | SWMLVar;
|
|
1651
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1652
|
+
meta_data?: {
|
|
1653
|
+
[key: string]: Record<string, unknown>;
|
|
1654
|
+
};
|
|
1655
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1656
|
+
meta_data_token?: string;
|
|
1657
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1658
|
+
data_map?: DataMap;
|
|
1659
|
+
/** Skips the top-level fillers specified in `ai.languages` (which includes `speech_fillers` and `function_fillers`). */
|
|
1660
|
+
skip_fillers?: boolean | SWMLVar;
|
|
1661
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1662
|
+
web_hook_url?: string;
|
|
1663
|
+
/** A file to play while the function is running. `wait_file_loops` can specify the amount of times that files should continously play. Default is not set. */
|
|
1664
|
+
wait_file?: string;
|
|
1665
|
+
/** The number of times to loop playing the file. Default is not set. */
|
|
1666
|
+
wait_file_loops?: number | string;
|
|
1667
|
+
/** Whether to wait for fillers to finish playing before continuing with the function. **Default:** `false`. */
|
|
1668
|
+
wait_for_fillers?: boolean | SWMLVar;
|
|
1669
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation.. For the summarize_conversation function, the function name is 'summarize_conversation'. */
|
|
1670
|
+
function?: 'summarize_conversation';
|
|
1671
|
+
[key: string]: unknown;
|
|
1672
|
+
}
|
|
1673
|
+
/** Supported language codes */
|
|
1674
|
+
export type FunctionFillers = {
|
|
1675
|
+
/** Default language set by the user */
|
|
1676
|
+
default: string[];
|
|
1677
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1678
|
+
} | {
|
|
1679
|
+
/** Bulgarian */
|
|
1680
|
+
bg: string[];
|
|
1681
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1682
|
+
} | {
|
|
1683
|
+
/** Catalan */
|
|
1684
|
+
ca: string[];
|
|
1685
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1686
|
+
} | {
|
|
1687
|
+
/** Chinese (Simplified) */
|
|
1688
|
+
zh: string[];
|
|
1689
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1690
|
+
} | {
|
|
1691
|
+
/** Chinese (Simplified, China) */
|
|
1692
|
+
'zh-CN': string[];
|
|
1693
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1694
|
+
} | {
|
|
1695
|
+
/** Chinese (Simplified Han) */
|
|
1696
|
+
'zh-Hans': string[];
|
|
1697
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1698
|
+
} | {
|
|
1699
|
+
/** Chinese (Traditional, Taiwan) */
|
|
1700
|
+
'zh-TW': string[];
|
|
1701
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1702
|
+
} | {
|
|
1703
|
+
/** Chinese (Traditional Han) */
|
|
1704
|
+
'zh-Hant': string[];
|
|
1705
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1706
|
+
} | {
|
|
1707
|
+
/** Chinese (Traditional, Hong Kong) */
|
|
1708
|
+
'zh-HK': string[];
|
|
1709
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1710
|
+
} | {
|
|
1711
|
+
/** Czech */
|
|
1712
|
+
cs: string[];
|
|
1713
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1714
|
+
} | {
|
|
1715
|
+
/** Danish */
|
|
1716
|
+
da: string[];
|
|
1717
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1718
|
+
} | {
|
|
1719
|
+
/** Danish (Denmark) */
|
|
1720
|
+
'da-DK': string[];
|
|
1721
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1722
|
+
} | {
|
|
1723
|
+
/** Dutch */
|
|
1724
|
+
nl: string[];
|
|
1725
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1726
|
+
} | {
|
|
1727
|
+
/** English */
|
|
1728
|
+
en: string[];
|
|
1729
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1730
|
+
} | {
|
|
1731
|
+
/** English (United States) */
|
|
1732
|
+
'en-US': string[];
|
|
1733
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1734
|
+
} | {
|
|
1735
|
+
/** English (United Kingdom) */
|
|
1736
|
+
'en-GB': string[];
|
|
1737
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1738
|
+
} | {
|
|
1739
|
+
/** English (New Zealand) */
|
|
1740
|
+
'en-NZ': string[];
|
|
1741
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1742
|
+
} | {
|
|
1743
|
+
/** English (India) */
|
|
1744
|
+
'en-IN': string[];
|
|
1745
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1746
|
+
} | {
|
|
1747
|
+
/** English (Australia) */
|
|
1748
|
+
'en-AU': string[];
|
|
1749
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1750
|
+
} | {
|
|
1751
|
+
/** Estonian */
|
|
1752
|
+
et: string[];
|
|
1753
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1754
|
+
} | {
|
|
1755
|
+
/** Finnish */
|
|
1756
|
+
fi: string[];
|
|
1757
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1758
|
+
} | {
|
|
1759
|
+
/** Flemish (Belgian Dutch) */
|
|
1760
|
+
'nl-BE': string[];
|
|
1761
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1762
|
+
} | {
|
|
1763
|
+
/** French */
|
|
1764
|
+
fr: string[];
|
|
1765
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1766
|
+
} | {
|
|
1767
|
+
/** French (Canada) */
|
|
1768
|
+
'fr-CA': string[];
|
|
1769
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1770
|
+
} | {
|
|
1771
|
+
/** German */
|
|
1772
|
+
de: string[];
|
|
1773
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1774
|
+
} | {
|
|
1775
|
+
/** German (Switzerland) */
|
|
1776
|
+
'de-CH': string[];
|
|
1777
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1778
|
+
} | {
|
|
1779
|
+
/** Greek */
|
|
1780
|
+
el: string[];
|
|
1781
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1782
|
+
} | {
|
|
1783
|
+
/** Hindi */
|
|
1784
|
+
hi: string[];
|
|
1785
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1786
|
+
} | {
|
|
1787
|
+
/** Hungarian */
|
|
1788
|
+
hu: string[];
|
|
1789
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1790
|
+
} | {
|
|
1791
|
+
/** Indonesian */
|
|
1792
|
+
id: string[];
|
|
1793
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1794
|
+
} | {
|
|
1795
|
+
/** Italian */
|
|
1796
|
+
it: string[];
|
|
1797
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1798
|
+
} | {
|
|
1799
|
+
/** Japanese */
|
|
1800
|
+
ja: string[];
|
|
1801
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1802
|
+
} | {
|
|
1803
|
+
/** Korean */
|
|
1804
|
+
ko: string[];
|
|
1805
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1806
|
+
} | {
|
|
1807
|
+
/** Korean (South Korea) */
|
|
1808
|
+
'ko-KR': string[];
|
|
1809
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1810
|
+
} | {
|
|
1811
|
+
/** Latvian */
|
|
1812
|
+
lv: string[];
|
|
1813
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1814
|
+
} | {
|
|
1815
|
+
/** Lithuanian */
|
|
1816
|
+
lt: string[];
|
|
1817
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1818
|
+
} | {
|
|
1819
|
+
/** Malay */
|
|
1820
|
+
ms: string[];
|
|
1821
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1822
|
+
} | {
|
|
1823
|
+
/** Multilingual (Spanish + English) */
|
|
1824
|
+
multi: string[];
|
|
1825
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1826
|
+
} | {
|
|
1827
|
+
/** Norwegian */
|
|
1828
|
+
no: string[];
|
|
1829
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1830
|
+
} | {
|
|
1831
|
+
/** Polish */
|
|
1832
|
+
pl: string[];
|
|
1833
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1834
|
+
} | {
|
|
1835
|
+
/** Portuguese */
|
|
1836
|
+
pt: string[];
|
|
1837
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1838
|
+
} | {
|
|
1839
|
+
/** Portuguese (Brazil) */
|
|
1840
|
+
'pt-BR': string[];
|
|
1841
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1842
|
+
} | {
|
|
1843
|
+
/** Portuguese (Portugal) */
|
|
1844
|
+
'pt-PT': string[];
|
|
1845
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1846
|
+
} | {
|
|
1847
|
+
/** Romanian */
|
|
1848
|
+
ro: string[];
|
|
1849
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1850
|
+
} | {
|
|
1851
|
+
/** Russian */
|
|
1852
|
+
ru: string[];
|
|
1853
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1854
|
+
} | {
|
|
1855
|
+
/** Slovak */
|
|
1856
|
+
sk: string[];
|
|
1857
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1858
|
+
} | {
|
|
1859
|
+
/** Spanish */
|
|
1860
|
+
es: string[];
|
|
1861
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1862
|
+
} | {
|
|
1863
|
+
/** Spanish (Latin America) */
|
|
1864
|
+
'es-419': string[];
|
|
1865
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1866
|
+
} | {
|
|
1867
|
+
/** Swedish */
|
|
1868
|
+
sv: string[];
|
|
1869
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1870
|
+
} | {
|
|
1871
|
+
/** Swedish (Sweden) */
|
|
1872
|
+
'sv-SE': string[];
|
|
1873
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1874
|
+
} | {
|
|
1875
|
+
/** Thai */
|
|
1876
|
+
th: string[];
|
|
1877
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1878
|
+
} | {
|
|
1879
|
+
/** Thai (Thailand) */
|
|
1880
|
+
'th-TH': string[];
|
|
1881
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1882
|
+
} | {
|
|
1883
|
+
/** Turkish */
|
|
1884
|
+
tr: string[];
|
|
1885
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1886
|
+
} | {
|
|
1887
|
+
/** Ukrainian */
|
|
1888
|
+
uk: string[];
|
|
1889
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1890
|
+
} | {
|
|
1891
|
+
/** Vietnamese */
|
|
1892
|
+
vi: string[];
|
|
1893
|
+
[key: string]: Record<string, unknown> | string[];
|
|
1894
|
+
};
|
|
1895
|
+
/** The template for picking properties. */
|
|
1896
|
+
export interface PickPropertiesUserSWAIGFunctionPickedSWAIGFunctionProps {
|
|
1897
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1898
|
+
description?: string;
|
|
1899
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1900
|
+
parameters?: FunctionParameters;
|
|
1901
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1902
|
+
active?: boolean | SWMLVar;
|
|
1903
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1904
|
+
meta_data?: {
|
|
1905
|
+
[key: string]: Record<string, unknown>;
|
|
1906
|
+
};
|
|
1907
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1908
|
+
meta_data_token?: string;
|
|
1909
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1910
|
+
data_map?: DataMap;
|
|
1911
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1912
|
+
web_hook_url?: string;
|
|
1913
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. */
|
|
1914
|
+
function?: string;
|
|
1915
|
+
[key: string]: unknown;
|
|
1916
|
+
}
|
|
1917
|
+
/** The template for picking properties. */
|
|
1918
|
+
export interface PickPropertiesStartUpHookSWAIGFunctionPickedSWAIGFunctionProps {
|
|
1919
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1920
|
+
description?: string;
|
|
1921
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1922
|
+
parameters?: FunctionParameters;
|
|
1923
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1924
|
+
active?: boolean | SWMLVar;
|
|
1925
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1926
|
+
meta_data?: {
|
|
1927
|
+
[key: string]: Record<string, unknown>;
|
|
1928
|
+
};
|
|
1929
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1930
|
+
meta_data_token?: string;
|
|
1931
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1932
|
+
data_map?: DataMap;
|
|
1933
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1934
|
+
web_hook_url?: string;
|
|
1935
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. For the start_hook function, the function name is 'start_hook'. */
|
|
1936
|
+
function?: 'startup_hook';
|
|
1937
|
+
[key: string]: unknown;
|
|
1938
|
+
}
|
|
1939
|
+
/** The template for picking properties. */
|
|
1940
|
+
export interface PickPropertiesHangUpHookSWAIGFunctionPickedSWAIGFunctionProps {
|
|
1941
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1942
|
+
description?: string;
|
|
1943
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1944
|
+
parameters?: FunctionParameters;
|
|
1945
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1946
|
+
active?: boolean | SWMLVar;
|
|
1947
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1948
|
+
meta_data?: {
|
|
1949
|
+
[key: string]: Record<string, unknown>;
|
|
1950
|
+
};
|
|
1951
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1952
|
+
meta_data_token?: string;
|
|
1953
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1954
|
+
data_map?: DataMap;
|
|
1955
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1956
|
+
web_hook_url?: string;
|
|
1957
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation. For the stop_hook function, the function name is 'stop_hook'. */
|
|
1958
|
+
function?: 'hangup_hook';
|
|
1959
|
+
[key: string]: unknown;
|
|
1960
|
+
}
|
|
1961
|
+
/** The template for picking properties. */
|
|
1962
|
+
export interface PickPropertiesSummarizeConversationSWAIGFunctionPickedSWAIGFunctionProps {
|
|
1963
|
+
/** A description of the context and purpose of the function, to explain to the agent when to use it. */
|
|
1964
|
+
description?: string;
|
|
1965
|
+
/** A JSON object that defines the expected user input parameters and their validation rules for the function. */
|
|
1966
|
+
parameters?: FunctionParameters;
|
|
1967
|
+
/** Whether the function is active. **Default:** `true`. */
|
|
1968
|
+
active?: boolean | SWMLVar;
|
|
1969
|
+
/** A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_meta_data action. */
|
|
1970
|
+
meta_data?: {
|
|
1971
|
+
[key: string]: Record<string, unknown>;
|
|
1972
|
+
};
|
|
1973
|
+
/** Scoping token for meta_data. If not supplied, metadata will be scoped to function's `web_hook_url`. Default is set by SignalWire. */
|
|
1974
|
+
meta_data_token?: string;
|
|
1975
|
+
/** An object that processes function inputs and executes operations through expressions, webhooks, or direct output. */
|
|
1976
|
+
data_map?: DataMap;
|
|
1977
|
+
/** Function-specific URL to send status callbacks and reports to. Takes precedence over a default setting. Authentication can also be set in the url in the format of `username:password@url.` */
|
|
1978
|
+
web_hook_url?: string;
|
|
1979
|
+
/** A unique name for the function. This can be any user-defined string or can reference a reserved function. Reserved functions are SignalWire functions that will be executed at certain points in the conversation.. For the summarize_conversation function, the function name is 'summarize_conversation'. */
|
|
1980
|
+
function?: 'summarize_conversation';
|
|
1981
|
+
[key: string]: unknown;
|
|
1982
|
+
}
|
|
1983
|
+
/** Content model with body text and optional bullets */
|
|
1984
|
+
export interface PomSectionBodyContent {
|
|
1985
|
+
/** Title for the section */
|
|
1986
|
+
title?: string;
|
|
1987
|
+
/** Optional array of nested subsections */
|
|
1988
|
+
subsections?: POM[];
|
|
1989
|
+
/** Whether to number the section */
|
|
1990
|
+
numbered?: boolean | SWMLVar;
|
|
1991
|
+
/** Whether to number the bullets */
|
|
1992
|
+
numberedBullets?: boolean | SWMLVar;
|
|
1993
|
+
/** Body text for the section */
|
|
1994
|
+
body?: string;
|
|
1995
|
+
/** Optional array of bullet points */
|
|
1996
|
+
bullets?: string[];
|
|
1997
|
+
[key: string]: unknown;
|
|
1998
|
+
}
|
|
1999
|
+
/** Content model with bullets and optional body */
|
|
2000
|
+
export interface PomSectionBulletsContent {
|
|
2001
|
+
/** Title for the section */
|
|
2002
|
+
title?: string;
|
|
2003
|
+
/** Optional array of nested subsections */
|
|
2004
|
+
subsections?: POM[];
|
|
2005
|
+
/** Whether to number the section */
|
|
2006
|
+
numbered?: boolean | SWMLVar;
|
|
2007
|
+
/** Whether to number the bullets */
|
|
2008
|
+
numberedBullets?: boolean | SWMLVar;
|
|
2009
|
+
/** Body text for the section (optional) */
|
|
2010
|
+
body?: string;
|
|
2011
|
+
/** Array of bullet points */
|
|
2012
|
+
bullets?: string[];
|
|
2013
|
+
[key: string]: unknown;
|
|
2014
|
+
}
|
|
2015
|
+
export type ContextsObject = ContextsPOMObject | ContextsTextObject;
|
|
2016
|
+
export interface FunctionParameters {
|
|
2017
|
+
/** The type of argument the AI is passing to the function. Possible values are 'string' and 'object'. */
|
|
2018
|
+
type?: 'object';
|
|
2019
|
+
/** An object containing the property definitions that are passed to the function. */
|
|
2020
|
+
properties?: {
|
|
2021
|
+
[key: string]: SchemaType;
|
|
2022
|
+
};
|
|
2023
|
+
/** An array of required property names from the `properties` object. */
|
|
2024
|
+
required?: string[];
|
|
2025
|
+
[key: string]: unknown;
|
|
2026
|
+
}
|
|
2027
|
+
export interface DataMap {
|
|
2028
|
+
/** An object that contains a response and a list of actions to be performed upon a SWAIG function call. */
|
|
2029
|
+
output?: Output;
|
|
2030
|
+
/** An array of objects that have pattern matching logic to process the user's input data. A user can define multiple expressions to match against the user's input data. */
|
|
2031
|
+
expressions?: Expression[];
|
|
2032
|
+
/** An array of objects that define external API calls. */
|
|
2033
|
+
webhooks?: Webhook[];
|
|
2034
|
+
[key: string]: unknown;
|
|
2035
|
+
}
|
|
2036
|
+
export interface ContextsPOMObject {
|
|
2037
|
+
/** An array of step objects that define the conversation flow for this context. Steps execute sequentially unless otherwise specified. */
|
|
2038
|
+
steps?: ContextSteps[];
|
|
2039
|
+
/** When `true`, resets conversation history to only the system prompt when entering this context. Useful for focused tasks that shouldn't be influenced by previous conversation. **Default:** `false`. */
|
|
2040
|
+
isolated?: boolean;
|
|
2041
|
+
/** Language-specific filler phrases played when transitioning into this context. Helps provide smooth context switches. */
|
|
2042
|
+
enter_fillers?: FunctionFillers[];
|
|
2043
|
+
/** Language-specific filler phrases played when leaving this context. Ensures natural transitions out of specialized modes. */
|
|
2044
|
+
exit_fillers?: FunctionFillers[];
|
|
2045
|
+
/** An array of objects that define the POM for the context. POM is the Post-Prompt Object Model, which is used to define the flow of the conversation. */
|
|
2046
|
+
pom?: POM[];
|
|
2047
|
+
[key: string]: unknown;
|
|
2048
|
+
}
|
|
2049
|
+
export interface ContextsTextObject {
|
|
2050
|
+
/** An array of step objects that define the conversation flow for this context. Steps execute sequentially unless otherwise specified. */
|
|
2051
|
+
steps?: ContextSteps[];
|
|
2052
|
+
/** When `true`, resets conversation history to only the system prompt when entering this context. Useful for focused tasks that shouldn't be influenced by previous conversation. **Default:** `false`. */
|
|
2053
|
+
isolated?: boolean;
|
|
2054
|
+
/** Language-specific filler phrases played when transitioning into this context. Helps provide smooth context switches. */
|
|
2055
|
+
enter_fillers?: FunctionFillers[];
|
|
2056
|
+
/** Language-specific filler phrases played when leaving this context. Ensures natural transitions out of specialized modes. */
|
|
2057
|
+
exit_fillers?: FunctionFillers[];
|
|
2058
|
+
/** The text to send to the agent. */
|
|
2059
|
+
text?: string;
|
|
2060
|
+
[key: string]: unknown;
|
|
2061
|
+
}
|
|
2062
|
+
export type SchemaType = StringProperty | IntegerProperty | NumberProperty | BooleanProperty | ArrayProperty | ObjectProperty | NullProperty | OneOfProperty | AllOfProperty | AnyOfProperty | ConstProperty;
|
|
2063
|
+
export interface Output {
|
|
2064
|
+
/** A static response text or message returned to the AI agent's context. */
|
|
2065
|
+
response?: string;
|
|
2066
|
+
/** A list of actions to be performed upon matching. */
|
|
2067
|
+
action?: Action[];
|
|
2068
|
+
[key: string]: unknown;
|
|
2069
|
+
}
|
|
2070
|
+
export interface Expression {
|
|
2071
|
+
/** The actual input or value from the user or system. */
|
|
2072
|
+
string?: string;
|
|
2073
|
+
/** A regular expression pattern to validate or match the string. */
|
|
2074
|
+
pattern?: string;
|
|
2075
|
+
/** An object that contains a response and a list of actions to be performed upon a expression match. */
|
|
2076
|
+
output?: Output;
|
|
2077
|
+
[key: string]: unknown;
|
|
2078
|
+
}
|
|
2079
|
+
export interface Webhook {
|
|
2080
|
+
/** A list of expressions to be evaluated upon matching. */
|
|
2081
|
+
expressions?: Expression[];
|
|
2082
|
+
/** A string or array of strings that represent the keys to be used for error handling. This will match the key(s) in the response from the API call. */
|
|
2083
|
+
error_keys?: string | string[];
|
|
2084
|
+
/** The endpoint for the external service or API. */
|
|
2085
|
+
url?: string;
|
|
2086
|
+
/** Iterates over an array of objects and processes a output based on each element in the array. Works similarly to JavaScript's forEach method. */
|
|
2087
|
+
foreach?: {
|
|
2088
|
+
/** The key to be used to access the current element in the array. */
|
|
2089
|
+
input_key: string;
|
|
2090
|
+
/** The key that can be referenced in the output of the `foreach` iteration. The values that are stored from `append` will be stored in this key. */
|
|
2091
|
+
output_key: string;
|
|
2092
|
+
/** The max amount of elements that are iterated over in the array. This will start at the beginning of the array. */
|
|
2093
|
+
max?: number | SWMLVar;
|
|
2094
|
+
/** The values to append to the output_key. */
|
|
2095
|
+
append: string;
|
|
2096
|
+
[key: string]: Record<string, unknown> | string | number | SWMLVar | undefined;
|
|
2097
|
+
};
|
|
2098
|
+
/** Any necessary headers for the API call. */
|
|
2099
|
+
headers?: {
|
|
2100
|
+
[key: string]: Record<string, unknown>;
|
|
2101
|
+
};
|
|
2102
|
+
/** The HTTP method (GET, POST, etc.) for the API call. */
|
|
2103
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
2104
|
+
/** A boolean to determine if the input arguments should be passed as parameters. */
|
|
2105
|
+
input_args_as_params?: boolean | SWMLVar;
|
|
2106
|
+
/** An object of any necessary parameters for the API call. The key is the parameter name and the value is the parameter value. */
|
|
2107
|
+
params?: {
|
|
2108
|
+
[key: string]: Record<string, unknown>;
|
|
2109
|
+
};
|
|
2110
|
+
/** A string or array of strings that represent the `arguments` that are required to make the webhook request. */
|
|
2111
|
+
require_args?: string | string[];
|
|
2112
|
+
/** An object that contains a response and a list of actions to be performed upon completion of the webhook request. */
|
|
2113
|
+
output?: Output;
|
|
2114
|
+
[key: string]: unknown;
|
|
2115
|
+
}
|
|
2116
|
+
export type ContextSteps = ContextPOMSteps | ContextTextSteps;
|
|
2117
|
+
/** Base interface for all property types */
|
|
2118
|
+
export interface StringProperty {
|
|
2119
|
+
/** A description of the property. */
|
|
2120
|
+
description?: string;
|
|
2121
|
+
/** Whether the property can be null. */
|
|
2122
|
+
nullable?: boolean | SWMLVar;
|
|
2123
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2124
|
+
type?: 'string';
|
|
2125
|
+
/** An array of strings that are the possible values */
|
|
2126
|
+
enum?: string[];
|
|
2127
|
+
/** The default string value */
|
|
2128
|
+
default?: string;
|
|
2129
|
+
/** Regular expression pattern */
|
|
2130
|
+
pattern?: string;
|
|
2131
|
+
/** String format (email, date-time, etc.) */
|
|
2132
|
+
format?: StringFormat;
|
|
2133
|
+
[key: string]: unknown;
|
|
2134
|
+
}
|
|
2135
|
+
/** Base interface for all property types */
|
|
2136
|
+
export interface IntegerProperty {
|
|
2137
|
+
/** A description of the property. */
|
|
2138
|
+
description?: string;
|
|
2139
|
+
/** Whether the property can be null. */
|
|
2140
|
+
nullable?: boolean | SWMLVar;
|
|
2141
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2142
|
+
type?: 'integer';
|
|
2143
|
+
/** An array of integers that are the possible values */
|
|
2144
|
+
enum?: number[];
|
|
2145
|
+
/** The default integer value */
|
|
2146
|
+
default?: number | SWMLVar;
|
|
2147
|
+
[key: string]: unknown;
|
|
2148
|
+
}
|
|
2149
|
+
/** Base interface for all property types */
|
|
2150
|
+
export interface NumberProperty {
|
|
2151
|
+
/** A description of the property. */
|
|
2152
|
+
description?: string;
|
|
2153
|
+
/** Whether the property can be null. */
|
|
2154
|
+
nullable?: boolean | SWMLVar;
|
|
2155
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2156
|
+
type?: 'number';
|
|
2157
|
+
/** An array of integers that are the possible values */
|
|
2158
|
+
enum?: number[] | SWMLVar[];
|
|
2159
|
+
/** The default integer value */
|
|
2160
|
+
default?: number | SWMLVar;
|
|
2161
|
+
[key: string]: unknown;
|
|
2162
|
+
}
|
|
2163
|
+
/** Base interface for all property types */
|
|
2164
|
+
export interface BooleanProperty {
|
|
2165
|
+
/** A description of the property. */
|
|
2166
|
+
description?: string;
|
|
2167
|
+
/** Whether the property can be null. */
|
|
2168
|
+
nullable?: boolean | SWMLVar;
|
|
2169
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2170
|
+
type?: 'boolean';
|
|
2171
|
+
/** The default boolean value */
|
|
2172
|
+
default?: boolean | SWMLVar;
|
|
2173
|
+
[key: string]: unknown;
|
|
2174
|
+
}
|
|
2175
|
+
/** Base interface for all property types */
|
|
2176
|
+
export interface ArrayProperty {
|
|
2177
|
+
/** A description of the property. */
|
|
2178
|
+
description?: string;
|
|
2179
|
+
/** Whether the property can be null. */
|
|
2180
|
+
nullable?: boolean | SWMLVar;
|
|
2181
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2182
|
+
type?: 'array';
|
|
2183
|
+
/** The default array value */
|
|
2184
|
+
default?: Record<string, unknown>[];
|
|
2185
|
+
/** Schema for array items */
|
|
2186
|
+
items?: SchemaType;
|
|
2187
|
+
[key: string]: unknown;
|
|
2188
|
+
}
|
|
2189
|
+
/** Base interface for all property types */
|
|
2190
|
+
export interface ObjectProperty {
|
|
2191
|
+
/** A description of the property. */
|
|
2192
|
+
description?: string;
|
|
2193
|
+
/** Whether the property can be null. */
|
|
2194
|
+
nullable?: boolean | SWMLVar;
|
|
2195
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2196
|
+
type?: 'object';
|
|
2197
|
+
/** The default object value */
|
|
2198
|
+
default?: {
|
|
2199
|
+
[key: string]: Record<string, unknown>;
|
|
2200
|
+
};
|
|
2201
|
+
/** Nested properties */
|
|
2202
|
+
properties?: {
|
|
2203
|
+
[key: string]: SchemaType;
|
|
2204
|
+
};
|
|
2205
|
+
/** Required property names */
|
|
2206
|
+
required?: string[];
|
|
2207
|
+
[key: string]: unknown;
|
|
2208
|
+
}
|
|
2209
|
+
export interface NullProperty {
|
|
2210
|
+
/** The type of parameter(s) the AI is passing to the function. */
|
|
2211
|
+
type?: 'null';
|
|
2212
|
+
/** A description of the property. */
|
|
2213
|
+
description?: string;
|
|
2214
|
+
[key: string]: unknown;
|
|
2215
|
+
}
|
|
2216
|
+
export interface OneOfProperty {
|
|
2217
|
+
/** An array of schemas where exactly one of the schemas must be valid. */
|
|
2218
|
+
oneOf?: SchemaType[];
|
|
2219
|
+
[key: string]: unknown;
|
|
2220
|
+
}
|
|
2221
|
+
export interface AllOfProperty {
|
|
2222
|
+
/** An array of schemas where all of the schemas must be valid. */
|
|
2223
|
+
allOf?: SchemaType[];
|
|
2224
|
+
[key: string]: unknown;
|
|
2225
|
+
}
|
|
2226
|
+
export interface AnyOfProperty {
|
|
2227
|
+
/** An array of schemas where at least one of the schemas must be valid. */
|
|
2228
|
+
anyOf?: SchemaType[];
|
|
2229
|
+
[key: string]: unknown;
|
|
2230
|
+
}
|
|
2231
|
+
export interface ConstProperty {
|
|
2232
|
+
/** A constant value that can be passed to the function. */
|
|
2233
|
+
const?: Record<string, unknown>;
|
|
2234
|
+
[key: string]: unknown;
|
|
2235
|
+
}
|
|
2236
|
+
export type Action = SWMLAction | ChangeContextAction | ChangeStepAction | ContextSwitchAction | HangupAction | HoldAction | PlaybackBGAction | SayAction | SetGlobalDataAction | SetMetaDataAction | StopAction | StopPlaybackBGAction | ToggleFunctionsAction | UnsetGlobalDataAction | UnsetMetaDataAction | UserInputAction;
|
|
2237
|
+
export interface ContextPOMSteps {
|
|
2238
|
+
/** The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. */
|
|
2239
|
+
name?: string;
|
|
2240
|
+
/** The criteria that must be met for the AI to proceed to the next step. */
|
|
2241
|
+
step_criteria?: string;
|
|
2242
|
+
/** An array of strings, where each string is the name of a SWAIG.function that can be executed from this step. */
|
|
2243
|
+
functions?: string[];
|
|
2244
|
+
/** An array of context names that the AI can transition to from this step. This must be a valid `contexts.name` that is present in your `contexts` object. */
|
|
2245
|
+
valid_contexts?: string[];
|
|
2246
|
+
/** A boolean value, if set to `true`, will skip the user's turn to respond in the conversation and proceed to the next step. **Default:** `false`. */
|
|
2247
|
+
skip_user_turn?: boolean | SWMLVar;
|
|
2248
|
+
/** A boolean value that determines if the step is the last in the context. If `true`, the context ends after this step. Cannot be used along with the `valid_steps` parameter. **Default:** `false`. */
|
|
2249
|
+
end?: boolean;
|
|
2250
|
+
/** An array of valid steps that the conversation can proceed to from this step. */
|
|
2251
|
+
valid_steps?: string[];
|
|
2252
|
+
/** An array of objects that define the POM for the step. POM is the Post-Prompt Object Model, which is used to define the flow of the conversation. */
|
|
2253
|
+
pom?: POM[];
|
|
2254
|
+
[key: string]: unknown;
|
|
2255
|
+
}
|
|
2256
|
+
export interface ContextTextSteps {
|
|
2257
|
+
/** The name of the step. The name must be unique within the context. The name is used for referencing the step in the context. */
|
|
2258
|
+
name?: string;
|
|
2259
|
+
/** The criteria that must be met for the AI to proceed to the next step. */
|
|
2260
|
+
step_criteria?: string;
|
|
2261
|
+
/** An array of strings, where each string is the name of a SWAIG.function that can be executed from this step. */
|
|
2262
|
+
functions?: string[];
|
|
2263
|
+
/** An array of context names that the AI can transition to from this step. This must be a valid `contexts.name` that is present in your `contexts` object. */
|
|
2264
|
+
valid_contexts?: string[];
|
|
2265
|
+
/** A boolean value, if set to `true`, will skip the user's turn to respond in the conversation and proceed to the next step. **Default:** `false`. */
|
|
2266
|
+
skip_user_turn?: boolean | SWMLVar;
|
|
2267
|
+
/** A boolean value that determines if the step is the last in the context. If `true`, the context ends after this step. Cannot be used along with the `valid_steps` parameter. **Default:** `false`. */
|
|
2268
|
+
end?: boolean;
|
|
2269
|
+
/** An array of valid steps that the conversation can proceed to from this step. */
|
|
2270
|
+
valid_steps?: string[];
|
|
2271
|
+
/** The prompt or instructions given to the AI at this step. */
|
|
2272
|
+
text?: string;
|
|
2273
|
+
[key: string]: unknown;
|
|
2274
|
+
}
|
|
2275
|
+
export type StringFormat = 'date_time' | 'time' | 'date' | 'duration' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uuid';
|
|
2276
|
+
export interface SWMLAction {
|
|
2277
|
+
/** A SWML object to be executed. */
|
|
2278
|
+
SWML?: Record<string, unknown>;
|
|
2279
|
+
[key: string]: unknown;
|
|
2280
|
+
}
|
|
2281
|
+
export interface ChangeContextAction {
|
|
2282
|
+
/** The name of the context to switch to. The context must be defined in the AI's prompt.contexts configuration. */
|
|
2283
|
+
change_context?: string;
|
|
2284
|
+
[key: string]: unknown;
|
|
2285
|
+
}
|
|
2286
|
+
export interface ChangeStepAction {
|
|
2287
|
+
/** The name of the step to switch to. The step must be defined in the current context's steps array. */
|
|
2288
|
+
change_step?: string;
|
|
2289
|
+
[key: string]: unknown;
|
|
2290
|
+
}
|
|
2291
|
+
export interface ContextSwitchAction {
|
|
2292
|
+
/** A JSON object containing the context to switch to. Default is not set. */
|
|
2293
|
+
context_switch?: {
|
|
2294
|
+
/** The instructions to send to the agent. Default is not set. */
|
|
2295
|
+
system_prompt: string;
|
|
2296
|
+
/** Whether to consolidate the context. Default is `false`. */
|
|
2297
|
+
consolidate?: boolean | SWMLVar;
|
|
2298
|
+
/** A string serving as simulated user input for the AI Agent. */
|
|
2299
|
+
user_prompt?: string;
|
|
2300
|
+
[key: string]: Record<string, unknown> | string | boolean | SWMLVar | undefined;
|
|
2301
|
+
};
|
|
2302
|
+
[key: string]: unknown;
|
|
2303
|
+
}
|
|
2304
|
+
export interface HangupAction {
|
|
2305
|
+
/** Whether to hang up the call. When set to `true`, the call will be terminated after the AI agent finishes speaking. */
|
|
2306
|
+
hangup?: boolean | SWMLVar;
|
|
2307
|
+
[key: string]: unknown;
|
|
2308
|
+
}
|
|
2309
|
+
export interface HoldAction {
|
|
2310
|
+
/** Places the caller on hold while playing hold music (configured via params.hold_music). */
|
|
2311
|
+
hold?: number | SWMLVar | {
|
|
2312
|
+
/** The duration to hold the caller in seconds. Can be a number or an object with timeout property. */
|
|
2313
|
+
timeout?: number | SWMLVar;
|
|
2314
|
+
[key: string]: Record<string, unknown> | number | SWMLVar | undefined;
|
|
2315
|
+
};
|
|
2316
|
+
[key: string]: unknown;
|
|
2317
|
+
}
|
|
2318
|
+
export interface PlaybackBGAction {
|
|
2319
|
+
/** A JSON object containing the audio file to play. */
|
|
2320
|
+
playback_bg?: {
|
|
2321
|
+
/** URL or filepath of the audio file to play. */
|
|
2322
|
+
file: string;
|
|
2323
|
+
/** Whether to wait for the audio file to finish playing before continuing. Default is `false`. */
|
|
2324
|
+
wait?: boolean | SWMLVar;
|
|
2325
|
+
[key: string]: Record<string, unknown> | string | boolean | SWMLVar | undefined;
|
|
2326
|
+
};
|
|
2327
|
+
[key: string]: unknown;
|
|
2328
|
+
}
|
|
2329
|
+
export interface SayAction {
|
|
2330
|
+
/** A message to be spoken by the AI agent. */
|
|
2331
|
+
say?: string;
|
|
2332
|
+
[key: string]: unknown;
|
|
2333
|
+
}
|
|
2334
|
+
export interface SetGlobalDataAction {
|
|
2335
|
+
/** A JSON object containing any global data, as a key-value map. This action sets the data in the `global_data` to be globally referenced. */
|
|
2336
|
+
set_global_data?: {
|
|
2337
|
+
[key: string]: Record<string, unknown>;
|
|
2338
|
+
};
|
|
2339
|
+
[key: string]: unknown;
|
|
2340
|
+
}
|
|
2341
|
+
export interface SetMetaDataAction {
|
|
2342
|
+
/** A JSON object containing any metadata, as a key-value map. This action sets the data in the `meta_data` to be referenced locally in the function. */
|
|
2343
|
+
set_meta_data?: {
|
|
2344
|
+
[key: string]: Record<string, unknown>;
|
|
2345
|
+
};
|
|
2346
|
+
[key: string]: unknown;
|
|
2347
|
+
}
|
|
2348
|
+
export interface StopAction {
|
|
2349
|
+
/** Whether to stop the conversation. */
|
|
2350
|
+
stop?: boolean | SWMLVar;
|
|
2351
|
+
[key: string]: unknown;
|
|
2352
|
+
}
|
|
2353
|
+
export interface StopPlaybackBGAction {
|
|
2354
|
+
/** Whether to stop the background audio file. */
|
|
2355
|
+
stop_playback_bg?: boolean | SWMLVar;
|
|
2356
|
+
[key: string]: unknown;
|
|
2357
|
+
}
|
|
2358
|
+
export interface ToggleFunctionsAction {
|
|
2359
|
+
/** Whether to toggle the functions on or off. */
|
|
2360
|
+
toggle_functions?: {
|
|
2361
|
+
/** Whether to activate or deactivate the functions. Default is `true` */
|
|
2362
|
+
active: boolean | SWMLVar;
|
|
2363
|
+
/** The function names to toggle. */
|
|
2364
|
+
function: string | string[];
|
|
2365
|
+
[key: string]: Record<string, unknown> | boolean | SWMLVar | string | string[];
|
|
2366
|
+
}[];
|
|
2367
|
+
[key: string]: unknown;
|
|
2368
|
+
}
|
|
2369
|
+
export interface UnsetGlobalDataAction {
|
|
2370
|
+
/** The key of the global data to unset from the `global_data`. You can also reset the `global_data` by passing in a new object. */
|
|
2371
|
+
unset_global_data?: string | {
|
|
2372
|
+
[key: string]: Record<string, unknown>;
|
|
2373
|
+
};
|
|
2374
|
+
[key: string]: unknown;
|
|
2375
|
+
}
|
|
2376
|
+
export interface UnsetMetaDataAction {
|
|
2377
|
+
/** The key of the local data to unset from the `meta_data`. You can also reset the `meta_data` by passing in a new object. */
|
|
2378
|
+
unset_meta_data?: string | {
|
|
2379
|
+
[key: string]: Record<string, unknown>;
|
|
2380
|
+
};
|
|
2381
|
+
[key: string]: unknown;
|
|
2382
|
+
}
|
|
2383
|
+
export interface UserInputAction {
|
|
2384
|
+
/** Used to inject text into the users queue as if they input the data themselves. */
|
|
2385
|
+
user_input?: string;
|
|
2386
|
+
[key: string]: unknown;
|
|
2387
|
+
}
|
|
2388
|
+
export interface AiSidecar {
|
|
2389
|
+
/** Start ai_sidecar mode — live_transcribe with an LLM/SWAIG/MCP loop on top. */
|
|
2390
|
+
ai_sidecar?: {
|
|
2391
|
+
/** Operator prompt — POM object, plain string, or {file: path}. */
|
|
2392
|
+
prompt: string | Record<string, unknown> | {
|
|
2393
|
+
file: string;
|
|
2394
|
+
};
|
|
2395
|
+
/** BCP-47 conversation language. Required. */
|
|
2396
|
+
lang: string;
|
|
2397
|
+
/** LLM model for sidecar tick + close-time summaries. */
|
|
2398
|
+
model?: string;
|
|
2399
|
+
/** Both legs are required for sidecar mode. */
|
|
2400
|
+
direction?: ('remote-caller' | 'local-caller')[];
|
|
2401
|
+
/** Which leg is the customer (turn-end trigger source). */
|
|
2402
|
+
customer_role?: 'remote-caller' | 'local-caller';
|
|
2403
|
+
/** Webhook URL for transcribe events AND sidecar events. */
|
|
2404
|
+
url?: string;
|
|
2405
|
+
/** SWAIG functions and MCP servers. */
|
|
2406
|
+
SWAIG?: SWAIG;
|
|
2407
|
+
/** SWAIG permission overrides — pass-through to mod_openai. */
|
|
2408
|
+
permissions?: Record<string, unknown>;
|
|
2409
|
+
/** Initial sidecar global_data. */
|
|
2410
|
+
global_data?: Record<string, unknown>;
|
|
2411
|
+
/** Speech-recognition hints biasing ASR toward specific terms. */
|
|
2412
|
+
hints?: string[];
|
|
2413
|
+
/** Tunable knobs (idle_timeout_ms, ai_summary, etc.) — pass-through to mod_openai which validates them strictly. New tunables only land here. */
|
|
2414
|
+
params?: Record<string, unknown>;
|
|
2415
|
+
/** Reserved for future runtime sub-actions. */
|
|
2416
|
+
action?: Record<string, unknown>;
|
|
2417
|
+
};
|
|
2418
|
+
[key: string]: unknown;
|
|
2419
|
+
}
|
|
2420
|
+
/** Ringback configuration (the modern object form). Declared as a named $defs entry so every generator emits a TYPED shape via $ref rather than collapsing an inline object to an untyped map; the legacy URI array remains the other oneOf branch. */
|
|
2421
|
+
export interface RingbackConfig {
|
|
2422
|
+
url?: string;
|
|
2423
|
+
urls?: string[];
|
|
2424
|
+
volume?: number;
|
|
2425
|
+
auto_answer?: boolean;
|
|
2426
|
+
say_voice?: string;
|
|
2427
|
+
say_language?: string;
|
|
2428
|
+
say_gender?: 'male' | 'female';
|
|
2429
|
+
status_url?: string;
|
|
2430
|
+
loop?: number;
|
|
2431
|
+
[key: string]: unknown;
|
|
2432
|
+
}
|
|
2433
|
+
/** Dial a SIP URI or phone number. */
|
|
2434
|
+
export interface ConnectConfig {
|
|
2435
|
+
/** The caller ID to use when dialing the number. */
|
|
2436
|
+
from?: string;
|
|
2437
|
+
/** Custom SIP headers to add to INVITE. It Has no effect on calls to phone numbers. */
|
|
2438
|
+
headers?: ConnectHeaders[];
|
|
2439
|
+
/** Comma-separated string of codecs to offer. */
|
|
2440
|
+
codecs?: string;
|
|
2441
|
+
/** If true, WebRTC media is offered to the SIP endpoint. */
|
|
2442
|
+
webrtc_media?: boolean | SWMLVar;
|
|
2443
|
+
/** Time, in seconds, to set the SIP `Session-Expires` header in INVITE. */
|
|
2444
|
+
session_timeout?: number | SWMLVar;
|
|
2445
|
+
/** Ringback to play while the far end rings: a legacy array of URIs, or a RingbackConfig object. */
|
|
2446
|
+
ringback?: string[] | RingbackConfig;
|
|
2447
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
2448
|
+
result?: ConnectSwitch | CondParams[];
|
|
2449
|
+
/** Time, in seconds, to wait for the call to be answered. */
|
|
2450
|
+
timeout?: number | SWMLVar;
|
|
2451
|
+
/** Maximum duration, in seconds, allowed for the call. */
|
|
2452
|
+
max_duration?: number | SWMLVar;
|
|
2453
|
+
/** Delay answer until the B-leg answers. */
|
|
2454
|
+
answer_on_bridge?: boolean | SWMLVar;
|
|
2455
|
+
/** Confirmation to execute when the call is connected. Can be either: */
|
|
2456
|
+
confirm?: string | ValidConfirmMethods[];
|
|
2457
|
+
/** The amount of time, in seconds, to wait for the `confirm` URL to return a response */
|
|
2458
|
+
confirm_timeout?: number | SWMLVar;
|
|
2459
|
+
/** SIP username to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
2460
|
+
username?: string;
|
|
2461
|
+
/** SIP password to use for authentication when dialing a SIP URI. Has no effect on calls to phone numbers. */
|
|
2462
|
+
password?: string;
|
|
2463
|
+
/** Encryption setting to use. **Possible values:** `mandatory`, `optional`, `forbidden` */
|
|
2464
|
+
encryption?: 'mandatory' | 'optional' | 'forbidden';
|
|
2465
|
+
/** Webhook URL to send call status change notifications to. Authentication can also be set in the URL in the format of `username:password@url`. */
|
|
2466
|
+
call_state_url?: string;
|
|
2467
|
+
/** SWML to execute after the bridge completes. This defines what should happen after the call is connected and the bridge ends. */
|
|
2468
|
+
transfer_after_bridge?: string | SWMLVar;
|
|
2469
|
+
/** An array of call state event names to be notified about. */
|
|
2470
|
+
call_state_events?: CallStatus[];
|
|
2471
|
+
/** Destination to dial. Can be: */
|
|
2472
|
+
to?: string;
|
|
2473
|
+
serial?: ConnectDeviceSingle[];
|
|
2474
|
+
/** Array of destinations to dial simultaneously. */
|
|
2475
|
+
parallel?: ConnectDeviceSingle[];
|
|
2476
|
+
/** Array of arrays. */
|
|
2477
|
+
serial_parallel?: ConnectDeviceSingle[][];
|
|
2478
|
+
[key: string]: unknown;
|
|
2479
|
+
}
|
|
2480
|
+
/** Execute a specified section or URL as a subroutine, and upon completion, return to the current document. */
|
|
2481
|
+
export interface ExecuteConfig {
|
|
2482
|
+
/** Specifies what to execute. The value can be one of: */
|
|
2483
|
+
dest?: string;
|
|
2484
|
+
/** Named parameters to send to section or URL */
|
|
2485
|
+
params?: {
|
|
2486
|
+
[key: string]: Record<string, unknown>;
|
|
2487
|
+
};
|
|
2488
|
+
/** User-defined metadata, ignored by SignalWire */
|
|
2489
|
+
meta?: {
|
|
2490
|
+
[key: string]: Record<string, unknown>;
|
|
2491
|
+
};
|
|
2492
|
+
/** The list of SWML instructions to be executed when the executed section or URL returns */
|
|
2493
|
+
on_return?: SWMLMethod[];
|
|
2494
|
+
/** Action to take based on the result of the call. This will run once the peer leg of the call has ended. */
|
|
2495
|
+
result?: ExecuteSwitch | CondParams[];
|
|
2496
|
+
[key: string]: unknown;
|
|
2497
|
+
}
|
|
2498
|
+
/** Jump to a label within the current section, optionally based on a condition. */
|
|
2499
|
+
export interface GotoConfig {
|
|
2500
|
+
/** Mark any point of the SWML section with a label so that goto can jump to it. */
|
|
2501
|
+
label?: string;
|
|
2502
|
+
/** A JavaScript condition that determines whether to perform the jump. If the condition evaluates to true, the jump is executed. If omitted, the jump is unconditional. */
|
|
2503
|
+
when?: string;
|
|
2504
|
+
/** The maximum number of times to perform the jump. Must be a number between 1 and 100. Default `100`. */
|
|
2505
|
+
max?: number | SWMLVar;
|
|
2506
|
+
[key: string]: unknown;
|
|
2507
|
+
}
|
|
2508
|
+
/** Start live transcription of the call. The transcription will be sent to the specified webhook URL. */
|
|
2509
|
+
export interface LiveTranscribeConfig {
|
|
2510
|
+
/** The action to perform during live transcription. */
|
|
2511
|
+
action?: TranscribeAction;
|
|
2512
|
+
[key: string]: unknown;
|
|
2513
|
+
}
|
|
2514
|
+
/** Start ai_sidecar mode — live_transcribe with an LLM/SWAIG/MCP loop on top. */
|
|
2515
|
+
export interface AiSidecarConfig {
|
|
2516
|
+
/** Operator prompt — POM object, plain string, or {file: path}. */
|
|
2517
|
+
prompt?: string | Record<string, unknown> | {
|
|
2518
|
+
file: string;
|
|
2519
|
+
};
|
|
2520
|
+
/** BCP-47 conversation language. Required. */
|
|
2521
|
+
lang?: string;
|
|
2522
|
+
/** LLM model for sidecar tick + close-time summaries. */
|
|
2523
|
+
model?: string;
|
|
2524
|
+
/** Both legs are required for sidecar mode. */
|
|
2525
|
+
direction?: ('remote-caller' | 'local-caller')[];
|
|
2526
|
+
/** Which leg is the customer (turn-end trigger source). */
|
|
2527
|
+
customer_role?: 'remote-caller' | 'local-caller';
|
|
2528
|
+
/** Webhook URL for transcribe events AND sidecar events. */
|
|
2529
|
+
url?: string;
|
|
2530
|
+
/** SWAIG functions and MCP servers. */
|
|
2531
|
+
SWAIG?: SWAIG;
|
|
2532
|
+
/** SWAIG permission overrides — pass-through to mod_openai. */
|
|
2533
|
+
permissions?: Record<string, unknown>;
|
|
2534
|
+
/** Initial sidecar global_data. */
|
|
2535
|
+
global_data?: Record<string, unknown>;
|
|
2536
|
+
/** Speech-recognition hints biasing ASR toward specific terms. */
|
|
2537
|
+
hints?: string[];
|
|
2538
|
+
/** Tunable knobs (idle_timeout_ms, ai_summary, etc.) — pass-through to mod_openai which validates them strictly. New tunables only land here. */
|
|
2539
|
+
params?: Record<string, unknown>;
|
|
2540
|
+
/** Reserved for future runtime sub-actions. */
|
|
2541
|
+
action?: Record<string, unknown>;
|
|
2542
|
+
[key: string]: unknown;
|
|
2543
|
+
}
|
|
2544
|
+
/** Start live translation of the call. The translation will be sent to the specified webhook URL. */
|
|
2545
|
+
export interface LiveTranslateConfig {
|
|
2546
|
+
/** The action to perform during live translation. */
|
|
2547
|
+
action?: TranslateAction;
|
|
2548
|
+
[key: string]: unknown;
|
|
2549
|
+
}
|
|
2550
|
+
/** Join a RELAY room. If the room doesn't exist, it creates a new room. */
|
|
2551
|
+
export interface JoinRoomConfig {
|
|
2552
|
+
/** Name of the room to join. Allowed characters: A-Z, a-z, 0-9, underscore, and hyphen. */
|
|
2553
|
+
name?: string;
|
|
2554
|
+
[key: string]: unknown;
|
|
2555
|
+
}
|
|
2556
|
+
/** Play a prompt and wait for input. The input can be received either as digits from the keypad, */
|
|
2557
|
+
export interface PromptConfig {
|
|
2558
|
+
/** URL or array of URLs to play. */
|
|
2559
|
+
play?: play_url | play_url[] | SWMLVar | SWMLVar[];
|
|
2560
|
+
/** Volume level for the audio file. */
|
|
2561
|
+
volume?: number;
|
|
2562
|
+
/** The voice to use for the text to speech. */
|
|
2563
|
+
say_voice?: string;
|
|
2564
|
+
/** The language to use for the text to speech. */
|
|
2565
|
+
say_language?: string;
|
|
2566
|
+
/** The gender to use for the text to speech. */
|
|
2567
|
+
say_gender?: 'male' | 'female';
|
|
2568
|
+
/** Number of digits to collect. */
|
|
2569
|
+
max_digits?: number | SWMLVar;
|
|
2570
|
+
/** Digits that terminate digit collection. */
|
|
2571
|
+
terminators?: string;
|
|
2572
|
+
/** Time in seconds to wait for next digit. */
|
|
2573
|
+
digit_timeout?: number | SWMLVar;
|
|
2574
|
+
/** Time in seconds to wait for start of input. */
|
|
2575
|
+
initial_timeout?: number | SWMLVar;
|
|
2576
|
+
/** Max time in seconds to wait for speech result. */
|
|
2577
|
+
speech_timeout?: number | SWMLVar;
|
|
2578
|
+
/** Time in seconds to wait for end of speech utterance. */
|
|
2579
|
+
speech_end_timeout?: number | SWMLVar;
|
|
2580
|
+
/** Language to detect speech in. */
|
|
2581
|
+
speech_language?: string;
|
|
2582
|
+
/** Expected words or phrases to help the speech recognition. */
|
|
2583
|
+
speech_hints?: string[] | SWMLVar[];
|
|
2584
|
+
/** The engine that is selected for speech recognition. The engine must support the specified language. */
|
|
2585
|
+
speech_engine?: string;
|
|
2586
|
+
/** http or https URL to deliver prompt status events */
|
|
2587
|
+
status_url?: string;
|
|
2588
|
+
[key: string]: unknown;
|
|
2589
|
+
}
|
|
2590
|
+
/** Receive a fax being delivered to this call. */
|
|
2591
|
+
export interface ReceiveFaxConfig {
|
|
2592
|
+
/** http or https URL to deliver receive_fax status events */
|
|
2593
|
+
status_url?: string;
|
|
2594
|
+
[key: string]: unknown;
|
|
2595
|
+
}
|
|
2596
|
+
/** Record the call audio in the foreground, pausing further SWML execution until recording ends. */
|
|
2597
|
+
export interface RecordConfig {
|
|
2598
|
+
/** If true, record in stereo. */
|
|
2599
|
+
stereo?: boolean | SWMLVar;
|
|
2600
|
+
/** The format to record in. Can be `wav`, `mp3`, or `mp4`. */
|
|
2601
|
+
format?: 'wav' | 'mp3' | 'mp4';
|
|
2602
|
+
/** Direction of the audio to record: "speak" for what party says, "listen" for what party hears. */
|
|
2603
|
+
direction?: 'speak' | 'listen';
|
|
2604
|
+
/** String of digits that will stop the recording when pressed. Default is `"#"`. */
|
|
2605
|
+
terminators?: string;
|
|
2606
|
+
/** Play a beep before recording. */
|
|
2607
|
+
beep?: boolean | SWMLVar;
|
|
2608
|
+
/** How sensitive the recording voice activity detector is to background noise. */
|
|
2609
|
+
input_sensitivity?: number | SWMLVar;
|
|
2610
|
+
/** Time in seconds to wait for the start of speech. */
|
|
2611
|
+
initial_timeout?: number | SWMLVar;
|
|
2612
|
+
/** Time in seconds to wait in silence before ending the recording. */
|
|
2613
|
+
end_silence_timeout?: number | SWMLVar;
|
|
2614
|
+
/** Maximum length of the recording in seconds. */
|
|
2615
|
+
max_length?: number | SWMLVar;
|
|
2616
|
+
/** URL to send recording status events to. */
|
|
2617
|
+
status_url?: string;
|
|
2618
|
+
[key: string]: unknown;
|
|
2619
|
+
}
|
|
2620
|
+
/** Record call in the background. */
|
|
2621
|
+
export interface RecordCallConfig {
|
|
2622
|
+
/** Identifier for this recording, to use with `stop_call_record`. */
|
|
2623
|
+
control_id?: string;
|
|
2624
|
+
/** If `true`, record in stereo. */
|
|
2625
|
+
stereo?: boolean | SWMLVar;
|
|
2626
|
+
/** The format to record in. It can be `wav`, `mp3`, or `mp4`. */
|
|
2627
|
+
format?: 'wav' | 'mp3' | 'mp4';
|
|
2628
|
+
/** Direction of the audio to record: "speak" for what party says, "listen" for what party hears, "both" for what the party hears and says. */
|
|
2629
|
+
direction?: 'speak' | 'listen' | 'both';
|
|
2630
|
+
/** String of digits that will stop the recording when pressed. Default is `""` (empty). */
|
|
2631
|
+
terminators?: string;
|
|
2632
|
+
/** Play a beep before recording. */
|
|
2633
|
+
beep?: boolean | SWMLVar;
|
|
2634
|
+
/** How sensitive the recording voice activity detector is to background noise. */
|
|
2635
|
+
input_sensitivity?: number | SWMLVar;
|
|
2636
|
+
/** Time in seconds to wait for the start of speech. */
|
|
2637
|
+
initial_timeout?: number | SWMLVar;
|
|
2638
|
+
/** Time in seconds to wait in silence before ending the recording. */
|
|
2639
|
+
end_silence_timeout?: number | SWMLVar;
|
|
2640
|
+
/** Maximum length of the recording in seconds. */
|
|
2641
|
+
max_length?: number | SWMLVar;
|
|
2642
|
+
/** http or https URL to deliver record_call status events */
|
|
2643
|
+
status_url?: string;
|
|
2644
|
+
[key: string]: unknown;
|
|
2645
|
+
}
|
|
2646
|
+
/** Send a GET, POST, PUT, or DELETE request to a remote URL. */
|
|
2647
|
+
export interface RequestConfig {
|
|
2648
|
+
/** URL to send the HTTPS request to. Authentication can also be set in the URL in the format of username:password@url. */
|
|
2649
|
+
url?: string;
|
|
2650
|
+
/** The HTTP method to be used for the request. Can be `GET`, `POST`, `PUT`, or `DELETE`. */
|
|
2651
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
2652
|
+
/** Object containing HTTP headers to set. Valid header values are Accept, Authorization, Content-Type, Range, and custom X- headers. */
|
|
2653
|
+
headers?: {
|
|
2654
|
+
[key: string]: Record<string, unknown>;
|
|
2655
|
+
};
|
|
2656
|
+
/** Request body. Content-Type header should be explicitly set, but if not set, the most likely type */
|
|
2657
|
+
body?: string | {
|
|
2658
|
+
[key: string]: Record<string, unknown>;
|
|
2659
|
+
};
|
|
2660
|
+
/** Maximum time in seconds to wait for a response. */
|
|
2661
|
+
timeout?: number | SWMLVar;
|
|
2662
|
+
/** Maximum time in seconds to wait for a connection. */
|
|
2663
|
+
connect_timeout?: number | SWMLVar;
|
|
2664
|
+
/** Store parsed JSON response as variables. */
|
|
2665
|
+
save_variables?: boolean | SWMLVar;
|
|
2666
|
+
[key: string]: unknown;
|
|
2667
|
+
}
|
|
2668
|
+
/** Send digit presses as DTMF tones. */
|
|
2669
|
+
export interface SendDigitsConfig {
|
|
2670
|
+
/** The digits to send. Valid values are 0123456789*#ABCDWw. Character W is a 1 second delay, and w is a 500ms delay. */
|
|
2671
|
+
digits?: string;
|
|
2672
|
+
[key: string]: unknown;
|
|
2673
|
+
}
|
|
2674
|
+
/** Send a fax. */
|
|
2675
|
+
export interface SendFaxConfig {
|
|
2676
|
+
/** URL to the PDF document to fax. */
|
|
2677
|
+
document?: string;
|
|
2678
|
+
/** Header text to include on the fax. */
|
|
2679
|
+
header_info?: string;
|
|
2680
|
+
/** Station identity to report. */
|
|
2681
|
+
identity?: string;
|
|
2682
|
+
/** http or https URL to deliver send_fax status events */
|
|
2683
|
+
status_url?: string;
|
|
2684
|
+
[key: string]: unknown;
|
|
2685
|
+
}
|
|
2686
|
+
/** Send SIP REFER to a SIP call. */
|
|
2687
|
+
export interface SipReferConfig {
|
|
2688
|
+
/** The SIP URI to send the REFER to. */
|
|
2689
|
+
to_uri?: string;
|
|
2690
|
+
/** The HTTP or HTTPS URL to send status callback events to. */
|
|
2691
|
+
status_url?: string;
|
|
2692
|
+
/** Username to use for SIP authentication. */
|
|
2693
|
+
username?: string;
|
|
2694
|
+
/** Password to use for SIP authentication. */
|
|
2695
|
+
password?: string;
|
|
2696
|
+
[key: string]: unknown;
|
|
2697
|
+
}
|
|
2698
|
+
/** Stop an active background recording. */
|
|
2699
|
+
export interface StopRecordCallConfig {
|
|
2700
|
+
/** Identifier for the recording to stop. */
|
|
2701
|
+
control_id?: string;
|
|
2702
|
+
[key: string]: unknown;
|
|
2703
|
+
}
|
|
2704
|
+
/** Stop an active tap stream. */
|
|
2705
|
+
export interface StopTapConfig {
|
|
2706
|
+
/** ID of the tap to stop. */
|
|
2707
|
+
control_id?: string;
|
|
2708
|
+
[key: string]: unknown;
|
|
2709
|
+
}
|
|
2710
|
+
/** Execute different instructions based on a variable's value. */
|
|
2711
|
+
export interface SwitchConfig {
|
|
2712
|
+
/** Name of the variable whose value needs to be compared. */
|
|
2713
|
+
variable?: string;
|
|
2714
|
+
/** Object of key-mapped values to array of SWML methods to execute. */
|
|
2715
|
+
case?: {
|
|
2716
|
+
[key: string]: SWMLMethod[];
|
|
2717
|
+
};
|
|
2718
|
+
/** Array of SWML methods to execute if no cases match. */
|
|
2719
|
+
default?: SWMLMethod[];
|
|
2720
|
+
[key: string]: unknown;
|
|
2721
|
+
}
|
|
2722
|
+
/** Start background call tap. Media is streamed over Websocket or RTP to customer controlled URI. */
|
|
2723
|
+
export interface TapConfig {
|
|
2724
|
+
/** Destination of the tap media stream: rtp://IP:port, ws://example.com, or wss://example.com. */
|
|
2725
|
+
uri?: string;
|
|
2726
|
+
/** Identifier for this tap to use with `stop_tap`. */
|
|
2727
|
+
control_id?: string;
|
|
2728
|
+
/** Direction of the audio to tap: */
|
|
2729
|
+
direction?: 'speak' | 'listen' | 'both';
|
|
2730
|
+
/** Codec to use for the tap media stream. */
|
|
2731
|
+
codec?: 'PCMU' | 'PCMA';
|
|
2732
|
+
/** If `uri` is a `rtp://` this will set the packetization time of the media in milliseconds. */
|
|
2733
|
+
rtp_ptime?: number | SWMLVar;
|
|
2734
|
+
/** http or https URL to deliver tap status events */
|
|
2735
|
+
status_url?: string;
|
|
2736
|
+
[key: string]: unknown;
|
|
2737
|
+
}
|
|
2738
|
+
/** Transfer the execution of the script to a different SWML section, URL, or Relay application. */
|
|
2739
|
+
export interface TransferConfig {
|
|
2740
|
+
/** Specifies where to transfer to. The value can be one of: */
|
|
2741
|
+
dest?: string;
|
|
2742
|
+
/** Named parameters to send to transfer destination. */
|
|
2743
|
+
params?: {
|
|
2744
|
+
[key: string]: Record<string, unknown>;
|
|
2745
|
+
};
|
|
2746
|
+
/** User data, ignored by SignalWire. */
|
|
2747
|
+
meta?: {
|
|
2748
|
+
[key: string]: Record<string, unknown>;
|
|
2749
|
+
};
|
|
2750
|
+
[key: string]: unknown;
|
|
2751
|
+
}
|
|
2752
|
+
/** Enables secure payment processing during voice calls. When implemented, it manages the entire payment flow */
|
|
2753
|
+
export interface PayConfig {
|
|
2754
|
+
/** The URL to make POST requests with all the gathered payment details. */
|
|
2755
|
+
payment_connector_url?: string;
|
|
2756
|
+
/** The amount to charge against payment method passed in the request. `Float` value with no currency prefix passed as string. */
|
|
2757
|
+
charge_amount?: string;
|
|
2758
|
+
/** Uses the ISO 4217 currency code of the charge amount. */
|
|
2759
|
+
currency?: string;
|
|
2760
|
+
/** Custom description of the payment provided in the request. */
|
|
2761
|
+
description?: string;
|
|
2762
|
+
/** The method of how to collect the payment details. Currently only `dtmf` mode is supported. */
|
|
2763
|
+
input?: 'dtmf';
|
|
2764
|
+
/** Language to use for prompts being played to the caller by the `pay` method. */
|
|
2765
|
+
language?: string;
|
|
2766
|
+
/** Number of times the `pay` method will retry to collect payment details. */
|
|
2767
|
+
max_attempts?: number | SWMLVar;
|
|
2768
|
+
/** The minimum length of the postal code the user must enter. */
|
|
2769
|
+
min_postal_code_length?: number | SWMLVar;
|
|
2770
|
+
/** Array of parameter objects to pass to your payment processor. The parameters are user-defined key-value pairs. */
|
|
2771
|
+
parameters?: PayParameters[];
|
|
2772
|
+
/** Indicates the payment method which is going to be used in this payment request. Currently only `credit-card` is supported. */
|
|
2773
|
+
payment_method?: 'credit-card';
|
|
2774
|
+
/** Takes `true`, `false` or real postalcode (if it's known beforehand) to let pay method know whether to prompt for postal code. Default is `true`. */
|
|
2775
|
+
postal_code?: boolean | string;
|
|
2776
|
+
/** Array of prompt objects for customizing the audio prompts during different stages of the payment process. */
|
|
2777
|
+
prompts?: PayPrompts[];
|
|
2778
|
+
/** Takes true or false to let pay method know whether to prompt for security code. */
|
|
2779
|
+
security_code?: boolean | SWMLVar;
|
|
2780
|
+
/** The URL to send requests for each status change during the payment process. */
|
|
2781
|
+
status_url?: string;
|
|
2782
|
+
/** Limit in seconds that pay method waits for the caller to press another digit before moving on to validate the digits captured. */
|
|
2783
|
+
timeout?: number | SWMLVar;
|
|
2784
|
+
/** Whether the payment is a one off payment or re-occurring. */
|
|
2785
|
+
token_type?: 'one-time' | 'reusable';
|
|
2786
|
+
/** List of payment cards allowed to use in the requested payment process separated by space. */
|
|
2787
|
+
valid_card_types?: string;
|
|
2788
|
+
/** Text-to-speech voice to use. Please refer to https://developer.signalwire.com/voice/getting-started/voice-and-languages for more information. */
|
|
2789
|
+
voice?: string;
|
|
2790
|
+
[key: string]: unknown;
|
|
2791
|
+
}
|
|
2792
|
+
/** A detection method that combines AMD (Answering Machine Detection) and fax detection. */
|
|
2793
|
+
export interface DetectMachineConfig {
|
|
2794
|
+
/** If `true`, stops detection on beep / end of voicemail greeting. Default `false`. */
|
|
2795
|
+
detect_message_end?: boolean | SWMLVar;
|
|
2796
|
+
/** Comma-separated string of detectors to enable. Valid values: `amd`, `fax`. */
|
|
2797
|
+
detectors?: string;
|
|
2798
|
+
/** How long to wait for voice to finish. Default `1.0`. */
|
|
2799
|
+
end_silence_timeout?: number | SWMLVar;
|
|
2800
|
+
/** How long to wait for initial voice before giving up. Default `4.5`. */
|
|
2801
|
+
initial_timeout?: number | SWMLVar;
|
|
2802
|
+
/** How long to wait for voice to finish before firing READY event. Default is `end_silence_timeout`. */
|
|
2803
|
+
machine_ready_timeout?: number | SWMLVar;
|
|
2804
|
+
/** The number of seconds of ongoing voice activity required to classify as MACHINE. Default `1.25`. */
|
|
2805
|
+
machine_voice_threshold?: number | SWMLVar;
|
|
2806
|
+
/** The minimum number of words that must be detected in a single utterance before classifying the call as MACHINE. Default `6`. */
|
|
2807
|
+
machine_words_threshold?: number | SWMLVar;
|
|
2808
|
+
/** The http(s) URL to deliver detector events to. */
|
|
2809
|
+
status_url?: string;
|
|
2810
|
+
/** The max time to run detector. Default `30.0` seconds. */
|
|
2811
|
+
timeout?: number | SWMLVar;
|
|
2812
|
+
/** The tone to detect, will only receive remote side tone. Default `CED`. */
|
|
2813
|
+
tone?: 'CED' | 'CNG';
|
|
2814
|
+
/** If false, the detector will run asynchronously and status_url must be set. */
|
|
2815
|
+
wait?: boolean | SWMLVar;
|
|
2816
|
+
[key: string]: unknown;
|
|
2817
|
+
}
|
|
2818
|
+
/** Allows the user to set and send events to the connected client on the call. */
|
|
2819
|
+
export interface UserEventConfig {
|
|
2820
|
+
event?: {
|
|
2821
|
+
[key: string]: Record<string, unknown>;
|
|
2822
|
+
};
|
|
2823
|
+
[key: string]: unknown;
|
|
2824
|
+
}
|