Developer Docs

Voice+

API reference

@nlxai/voice-plus-core

Interfaces

Setup

create

create(options): Client

The starting point of the package. Call create to create a Voice+ client.

Parameters

NameTypeDescription
optionsConfigconfiguration options for the client

Returns

Client

a Voice+ client

Example

1const client = nlxai.voicePlus.create({ 2 // hard-coded params 3 apiKey: "REPLACE_WITH_API_KEY", 4 workspaceId: "REPLACE_WITH_WORKSPACE_ID", 5 scriptId: "REPLACE_WITH_SCRIPT_ID", 6 // dynamic params 7 conversationId: "REPLACE_WITH_CONVERSATION_ID", 8 languageCode: "en-US", 9}); 10 11client.sendStep("REPLACE_WITH_STEP_ID");

Defined in

index.ts:26


Client

Context

Ƭ Context: Record<string, any>

context to send back to the voice bot, for usage later in the intent.

Defined in

index.ts:143

Other

StepInfo

Ƭ StepInfo: string | { stepId: string ; stepTriggerDescription?: string }

Step information, either a step ID as a single string or an object

Defined in

index.ts:95

Interfaces

Interface: Client

The Voice+ client

Properties

sendStep

sendStep: (step: StepInfo, context?: Context) => Promise<void>

Example

1const client = nlxai.voicePlus.create({ 2 // hard-coded params 3 apiKey: "REPLACE_WITH_API_KEY", 4 workspaceId: "REPLACE_WITH_WORKSPACE_ID", 5 scriptId: "REPLACE_WITH_SCRIPT_ID", 6 // dynamic params 7 conversationId: "REPLACE_WITH_CONVERSATION_ID", 8 languageCode: "en-US", 9}); 10 11client.sendStep("REPLACE_WITH_STEP_ID", { selectedSeat: "4a" });

sends a step to the voice bot

Type declaration

▸ (step, context?): Promise<void>

Parameters
NameTypeDescription
stepStepInfothe next step to transition to, either a UUID as string or an object containing stepId. Note: The step ID must be a valid UUID
context?Contextcontext to send back to the voice bot, for usage later in the intent.
Returns

Promise<void>

Defined in

index.ts:136

Interface: Config

Initial configuration used when creating a journey manager

Properties

apiKey

apiKey: string

  • the API key generated for the journey.
Defined in

index.ts:151


journeyId

Optional journeyId: string

The ID of the journey.

Deprecated

use scriptId instead

Defined in

index.ts:156


scriptId

Optional scriptId: string

the ID of the script.

Defined in

index.ts:158


workspaceId

workspaceId: string

your workspace id

Defined in

index.ts:161


conversationId

conversationId: string

the conversation id, passed from the active voice bot.

Note: This must be dynamically set by the voice bot.

Defined in

index.ts:168


languageCode

languageCode: string

the user's language code, consistent with the language codes defined on the journey.

Defined in

index.ts:173


debug

Optional debug: boolean

set to true to help debug issues or errors. Defaults to false

Defined in

index.ts:176