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