Dasha.AI SDK for JavaScript

Table of contents

Namespaces

Classes

Interfaces

References

Account

Re-exports: Account

Type aliases

ConnectionProvider

Ƭ ConnectionProvider<TInput, TOutput>: (conv: Conversation<TInput, TOutput>) => Connection | Promise<Connection>

A callback that decides the type of Connection used by each conversation.

example using SIP through an Endpoint

const endpoint = new dasha.sip.Endpoint(); application.connectionProvider = () => await dasha.sip.connect(endpoint);

example running a ConsoleChat

const chat = await dasha.chat.createConsoleChat(); application.connectionProvider = () => await dasha.chat.connect(chat);

example deciding on a connection type based on the Conversation.input

application.connectionProvider = (conversation) => conversation.input.useChat ? await dasha.chat.connect(chat) : await dasha.sip.connect(endpoint);

Type parameters:

NameType
TInputRecord<string, unknown>
TOutputRecord<string, unknown>

Type declaration:

▸ (conv: Conversation<TInput, TOutput>): Connection | Promise<Connection>

Parameters:

NameType
convConversation<TInput, TOutput>

Returns: Connection | Promise<Connection>


ProgressHandler

Ƭ ProgressHandler: (event: ProgressEvent) => void

Type declaration:

▸ (event: ProgressEvent): void

Parameters:

NameType
eventProgressEvent

Returns: void

Variables

log

Const log: winston.Logger

A global logger instance.

All logger instances are winston loggers.

Functions

configure

configure(config: Configuration): void

Set the global Configuration of the Dasha SDK.

Parameters:

NameType
configConfiguration

Returns: void


deploy

deploy<TInput, TOutput>(path: string, options?: DeploymentOptions): Promise<Application<TInput, TOutput>>

Deploy the application to the Dasha.AI platform, performing the necessary preparation steps.

TODO: list what's exactly happening

This overload is only implemented for Node.js.

Type parameters:

NameTypeDefault
TInputRecord<string, unknown>Record<string, unknown>
TOutputRecord<string, unknown>Record<string, unknown>

Parameters:

NameTypeDescription
pathstringpath to the application directory
options?DeploymentOptions-

Returns: Promise<Application<TInput, TOutput>>

deploy<TInput, TOutput>(zip: Uint8Array, options?: DeploymentOptions): Promise<Application<TInput, TOutput>>

Deploy the application to the Dasha.AI platform, performing the necessary preparation steps.

TODO: list what's exactly happening

Type parameters:

NameTypeDefault
TInputRecord<string, unknown>Record<string, unknown>
TOutputRecord<string, unknown>Record<string, unknown>

Parameters:

NameTypeDescription
zipUint8Arraythe application packed into a ZIP archive
options?DeploymentOptions-

Returns: Promise<Application<TInput, TOutput>>

Found a mistake? Let us know.

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.