@mattmazzola/sdk
Node SDK for Conversation Learner
Last updated 6 months ago by mattmazzola .
MIT · Original npm · Tarball · package.json
$ cnpm install @mattmazzola/sdk 
SYNC missed versions from official npm registry.

ConversationLearner-SDK

Conversation Learner Software Development Kit

This repo is intended to be consumed by your bot. The SDK contains 3 major components:

  1. Administration UI - provides graphical interface to manage, train, and test your bot
  2. Express Router - The router is mounted to your server in development and used by the UI (above) during training
  3. Recognizer - Similar to other BotBuilder recognizers like LUIS the CL recognizer processes the given Bot context and returns results such as messages, adaptive cards, and more.

Getting started

Install @mattmazzola/sdk in consuming project:

npm install @mattmazzola/sdk --save-exact

Note: We recommend using --save-exact to lock the version since we are NOT following SemVer at this time. This can help prevent accidental package updates which may contain breaking changes if you are not using package-lock.json. We will move to following SemVer soon as we improve our release process.

Using the recognizer:

import { ConversationLearner, ICLOptions, ClientMemoryManager } from '@mattmazzola/sdk'

...

const sdkRouter = ConversationLearner.Init({
    CONVERSATION_LEARNER_SERVICE_URI: process.env.CONVERSATION_LEARNER_SERVICE_URI
})
if (isDevelopment) {
    server.use('/sdk', sdkRouter)
}

...

const cl = new ConversationLearner(modelId);

server.post('/api/messages', (req, res) => {
    adapter.processActivity(req, res, async context => {
        const result = await cl.recognize(context)
        
        if (result) {
            cl.SendResult(result);
        }
    })
})

Using the UI router.

Previously the UI was served separately and required to be run on a different port than your bot. Now the UI is included with your bot! The ui is availble at the /ui path of your bot url. The leaves the root / available for you to add a Bot landing page. There you can summarize your bot's purpose and capabilities to the user.

...
import { uiRouter } from '@mattmazzola/sdk'

...

"Mount the router at the root `/` as it internally has the /ui paths."
server.use(uiRouter)

...

server.listen(port)

Current Tags

  • 0.600.5                                ...           latest (6 months ago)
  • 0.602.2                                ...           testing (6 months ago)

4 Versions

  • 0.602.2                                ...           6 months ago
  • 0.602.0                                ...           6 months ago
  • 0.601.0                                ...           6 months ago
  • 0.600.5                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (22)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |