易学问答
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 更多
    • 积分规则
登录 或 注册
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 积分规则
 发表新帖
发表新帖

How can I use offline-directline for Microsofts Botframework v4?

前端 未结
关注
 1  1758
忘掉有多难
忘掉有多难 2021-01-03 02:09

I need to run the microsoft botframework v4 on-premise since company internal restrictions forbid me to register the bot on Microsoft Azure or use the conne

1条回答
  •  既然无缘
    既然无缘 (楼主)
    2021-01-03 02:48

    Please refer to the instructions in the BotFramework-WebChat repo to see how to host Web Chat v4 in a website. You'll find something that looks like this:

    
    
      
        

    Rather than passing the same kind of object to window.WebChat.renderWebChat's directLine parameter as you would to BotChat.App's directLine parameter, you need to pass the object to window.WebChat.createDirectLine. The object in question is a DirectLineOptions object.

        window.WebChat.renderWebChat({
            directLine: window.WebChat.createDirectLine({
                secret: params['s'],
                token: params['t'],
                domain: params['domain'],
                webSocket: false // defaults to true
            }),
    

    If you don't want to have to pass in any parameters to your Web Chat client, you can include them inline:

                secret: '',
                token: '',
                domain: 'http://localhost:3000/directline',
                webSocket: false // defaults to true
    

    And if you're not particular about running Web Chat in your own HTML page, I recommend foregoing offline-directline and just using the Bot Emulator, which is great for interacting with local bots.

    0 讨论(0)
    提交评论

    •  加载中...
 看不清?
提交回复
热议问题