Options
All
  • Public
  • Public/Protected
  • All
Menu

@conversationlearner/sdk

Index

Type aliases

CallbackMap

CallbackMap: object

Type declaration

EntityDetectionCallback

EntityDetectionCallback: function

Processes messages received from the user. Called by the dialog system.

Type declaration

HTTP_METHOD

HTTP_METHOD: "GET" | "PUT" | "POST" | "DELETE"

IActionInput

LogicCallback

LogicCallback: function

Called when the associated action in your bot is sent. Common use cases are to call external APIs to gather data and save into entities for usage later.

Type declaration

MemoryManagerReturnType

MemoryManagerReturnType: MemoryManagerReturnType<T>

OnSessionEndCallback

OnSessionEndCallback: function

Called when Session ends. If not implemented all entity values will be cleared. If implemented, developer may return a list of entities to preserve for the next session as well as store them in the Bot State

Type declaration

    • (context: TurnContext, memoryManager: ClientMemoryManager, sessionEndState: SessionEndState, data: string | undefined): Promise<string[] | void>
    • Parameters

      • context: TurnContext
      • memoryManager: ClientMemoryManager
      • sessionEndState: SessionEndState
      • data: string | undefined

      Returns Promise<string[] | void>

OnSessionStartCallback

OnSessionStartCallback: function

Called at session start. Allows bot to set initial entities before conversation begins

Type declaration

RenderCallback

RenderCallback: function

Called when the associated action in your bot is sent AND during dialog replay. Common use cases are to construct text or card messages based on current entity values.

Type declaration

Variables

Const CL_DEVELOPER

CL_DEVELOPER: "ConversationLearnerDeveloper" = "ConversationLearnerDeveloper"

Const DEFAULT_MAX_SESSION_LENGTH

DEFAULT_MAX_SESSION_LENGTH: number = 20 * 60 * 1000

Const MAX_BROWSER_SLOTS

MAX_BROWSER_SLOTS: 10 = 10

Const MESSAGE_TIMEOUT

MESSAGE_TIMEOUT: 10000 = 10000

Const NEGATIVE_PREFIX

NEGATIVE_PREFIX: "~" = "~"

Const UI_RUNNER_APPID

UI_RUNNER_APPID: "UIRunner_AppId" = "UIRunner_AppId"

Const apimSubscriptionIdHeader

apimSubscriptionIdHeader: "apim-subscription-id" = "apim-subscription-id"

Const apimSubscriptionKeyHeader

apimSubscriptionKeyHeader: "Ocp-Apim-Subscription-Key" = "Ocp-Apim-Subscription-Key"

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Const app

app: Express = express()

Const delay

delay: __promisify__ = util.promisify(setTimeout)

Const listener

listener: Server = app.listen(port, () =>console.log(`Navigate to http://localhost:${listener.address().port}/ui to view Conversation Learner administration application.`)).on('error', (error: NodeJS.ErrnoException) => {if (error.code === 'EADDRINUSE') {console.log(`ERROR: The UI is already running or the port (${port}) is in use by another process`)return}throw error})

Const luisAuthoringKeyHeader

luisAuthoringKeyHeader: "x-luis-authoring-key" = "x-luis-authoring-key"

Const luisSubscriptionKeyHeader

luisSubscriptionKeyHeader: "x-luis-subscription-key" = "x-luis-subscription-key"

Const packageJsonPath

packageJsonPath: string = path.join(__dirname, '..', 'package.json')

Const port

port: 5053 = 5053

Const requestMethodMap

requestMethodMap: Map<"GET" | "PUT" | "POST" | "DELETE", get | post> = new Map<HTTP_METHOD, typeof Request.get | typeof Request.post>([['GET', Request.get],['PUT', Request.put],['POST', Request.post],['DELETE', Request.delete]])

Const router

router: Router = express.Router({ caseSensitive: false })

Const statusEndpoint

statusEndpoint: "https://blisstorage.blob.core.windows.net/status/status.json" = "https://blisstorage.blob.core.windows.net/status/status.json"

Const versionEndpoint

versionEndpoint: "https://blisstorage.blob.core.windows.net/version/version.json" = "https://blisstorage.blob.core.windows.net/version/version.json"

Functions

GetLogicAPIError

  • GetLogicAPIError(logicResult: LogicResult | undefined): LogicAPIError | null
  • Parameters

    • logicResult: LogicResult | undefined

    Returns LogicAPIError | null

Const HTML2Error

  • HTML2Error(htmlText: string): string

Const HandleError

  • HandleError(response: express.Response, err: any): void
  • Parameters

    • response: express.Response
    • err: any

    Returns void

IsCardValid

  • IsCardValid(card: string | Partial<Activity>): boolean
  • Parameters

    • card: string | Partial<Activity>

    Returns boolean

Const addEntitiesById

  • addEntitiesById(valuesByName: FilledEntityMap): FilledEntityMap
  • Parameters

    • valuesByName: FilledEntityMap

    Returns FilledEntityMap

botChecksum

  • botChecksum(callbacks: Callback[], templates: Template[]): string
  • Parameters

    • callbacks: Callback[]
    • templates: Template[]

    Returns string

Const convertToMapById

  • convertToMapById(entityMap: FilledEntityMap): FilledEntityMap
  • Parameters

    • entityMap: FilledEntityMap

    Returns FilledEntityMap

default

  • default(appDefinition: AppDefinition, callbackMap: CallbackMap): models.AppDefinitionChange
  • Given an app definition return an updated app definition. If no updates are performed, return undefined.

    Parameters

    • appDefinition: AppDefinition
    • callbackMap: CallbackMap

    Returns models.AppDefinitionChange

Const defaultLogicCallback

  • defaultLogicCallback(): Promise<void>

getActionChangeResult

  • getActionChangeResult(action: ActionBase, callbackMap: CallbackMap): IChangeResult<ActionBase>

getActionPayload

  • getActionPayload(legacyActionPayload: ActionPayloadSingleArguments, callback: Callback): ActionPayload
  • Parameters

    • legacyActionPayload: ActionPayloadSingleArguments
    • callback: Callback

    Returns ActionPayload

Const getBanner

  • getBanner(source: string): Promise<Banner | null>
  • Parameters

    • source: string

    Returns Promise<Banner | null>

getDefaultChangeResult

  • getDefaultChangeResult<T>(value: T): IChangeResult<T>
  • Type parameters

    • T

    Parameters

    • value: T

    Returns IChangeResult<T>

getMemoryKey

  • getMemoryKey(req: express.Request): string

getQuery

  • getQuery(req: express.Request): any

Const getRouter

isSDKOld

  • isSDKOld(curVersion: string): Promise<boolean>
  • Parameters

    • curVersion: string

    Returns Promise<boolean>

parseFile

  • parseFile(filePath: string): Promise<Object | undefined>
  • Parameters

    • filePath: string

    Returns Promise<Object | undefined>

replace

  • replace<T>(xs: T[], updatedX: T, getId: function): T[]
  • Type parameters

    • T

    Parameters

    • xs: T[]
    • updatedX: T
    • getId: function
        • (x: T): any
        • Parameters

          • x: T

          Returns any

    Returns T[]

validateBot

  • validateBot(req: express.Request, botChecksum: string): void
  • Parameters

    • req: express.Request
    • botChecksum: string

    Returns void

Generated using TypeDoc