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:
Name | Type |
---|---|
TInput | Record<string, unknown> |
TOutput | Record<string, unknown> |
Type declaration:
▸ (conv
: Conversation<TInput, TOutput>): Connection | Promise<Connection>
Parameters:
Name | Type |
---|---|
conv | Conversation<TInput, TOutput> |
Returns: Connection | Promise<Connection>
ProgressHandler
Ƭ ProgressHandler: (event
: ProgressEvent) => void
Type declaration:
▸ (event
: ProgressEvent): void
Parameters:
Name | Type |
---|---|
event | ProgressEvent |
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:
Name | Type |
---|---|
config | Configuration |
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:
Name | Type | Default |
---|---|---|
TInput | Record<string, unknown> | Record<string, unknown> |
TOutput | Record<string, unknown> | Record<string, unknown> |
Parameters:
Name | Type | Description |
---|---|---|
path | string | path 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:
Name | Type | Default |
---|---|---|
TInput | Record<string, unknown> | Record<string, unknown> |
TOutput | Record<string, unknown> | Record<string, unknown> |
Parameters:
Name | Type | Description |
---|---|---|
zip | Uint8Array | the application packed into a ZIP archive |
options? | DeploymentOptions | - |
Returns: Promise<Application<TInput, TOutput>>