Skip to content
An SDK for ConversationLearner
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci build: update config to 2.1 for canceling redundant builds (#463) Jun 18, 2019
.vscode
docs chore: clean up of package (#432) Mar 28, 2019
src
.gitignore chore: clean up of package (#432) Mar 28, 2019
.travis.yml
LICENSE Delete previous history as part of release process Apr 28, 2018
README.md feat: expose router for serving user interface (#419) Jan 22, 2019
RELEASE.md
appveyor.yml chore: clean up of package (#432) Mar 28, 2019
azure-pipelines.yml build: add azure pipelines (#482) Jul 15, 2019
package-lock.json fix: bug 2201 protect from empty messages (buttons) (#480) Jul 11, 2019
package.json fix: bug 2201 protect from empty messages (buttons) (#480) Jul 11, 2019
tsconfig.json
tslint.json
typedoc.json chore: clean up of package (#432) Mar 28, 2019

README.md

ConversationLearner-SDK

Conversation Learner Software Development Kit

Travis CircleCI AppVeyor

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 @conversationlearner/sdk in consuming project:

npm install @conversationlearner/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 '@conversationlearner/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 '@conversationlearner/sdk'

...

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

... 

server.listen(port)

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Semantic Release

Semantic release works by analyzing all commits that have occurred since the last release, computing the next version to increment based on the most significant commit found, then tagging and publishing a new package with that version.

See: https://semantic-release.gitbooks.io/semantic-release/content/#how-does-it-work

In order to analyze the commit messages reliably they must be in a known format. To help writing these commits there is a tool at npm run commit which acts a wizard walking you through the options.

For most use cases the only change required is to type a special word in front of your normal commit messages. Instead of "add function to compute X" put "feat: add function to compute X". Based on the rules "feat" is mapped to a "minor" release.

Video Demo: https://youtu.be/qf7c-KxBBZc?t=37s

Release Process

See: RELEASE

You can’t perform that action at this time.