是否可以在没有 azure 平台的情况下创建聊天机器人(使用 Microsoft bot 平台和 luis)

is it possible to create chatbot (using microsoft bot platform and luis) without azure platform

我想在不使用 Azure 平台的情况下创建机器人服务。使用微软机器人平台和 luis 的机器人应用程序。

有什么解决办法吗??

没有。为了使用机器人服务或 LUIS,您需要 Azure(这两者都是必需的)。

相同的结论 - 您必须在 Azure 上创建一个帐户 - 订阅它 - 提供您的信用卡,最后您可以发布您的机器人(在线)。

在 GitHub 上发布项目以最终使其成为免费增值是很奇怪的。 希望Ms能在V4框架下实现。

您可以使用 Luis 创建聊天机器人,Visual Studio 然后使用机器人模拟器。您可以在 Luis 中创建意图和实体,并将它们也添加到 c# 代码中。但是为了发布机器人,您应该在 azure 中订阅。

没有 Azure 订阅就不可能拥有 MS Bot,因为你必须在 Azure 上注册 bot,这不需要一分钱。谈到成本,问题是您是否可以使用其他主机。

我有一个 botbuilder@4.0.0-preview1.2 在 DigitalOcean 上运行没有问题。 不幸的是,目前@4.1.2 版本并非如此。我倾向于说没有官方版本的解决方案,尽管它在模拟器中有效。

尝试使用 botbuilder@4.1.7 进行底层更改会导致:"There was an error sending this message to your bot: HTTP status code ServiceUnavailable"

为了使 "botbuilder@4.0.0-preview1.2" 正常工作,我对来自此示例 https://github.com/Microsoft/BotBuilder-Samples/blob/master/samples/javascript_typescript/13.basic-bot/src/index.ts 的 index.ts 和 bot.ts 进行了以下更改。

1) 删除此导入 (index.ts)

// import { BotConfiguration, IEndpointService } from 'botframework-config';

2) 删除此配置(index.ts)

// const BOT_FILE = path.join(__dirname, '..', (process.env.botFilePath || ''));
// let botConfig: BotConfiguration;
// try {
//     // Read bot configuration from .bot file.
//     botConfig = BotConfiguration.loadSync(BOT_FILE, process.env.botFileSecret);
// } catch (err) {
//     console.error(`\nError reading bot file. Please ensure you have valid botFilePath and botFileSecret set for your environment.`);
//     console.error(`\n - The botFileSecret is available under appsettings for your Azure Bot Service bot.`);
//     console.error(`\n - If you are running this bot locally, consider adding a .env file with botFilePath and botFileSecret.`);
//     console.error(`\n - See https://aka.ms/about-bot-file to learn more about .bot     file its use and bot configuration.\n\n`);
//     process.exit();
// }

3) 去掉这个 (index.ts)

// const BOT_CONFIGURATION = (process.env.NODE_ENV || DEV_ENVIRONMENT);
// const endpointConfig = <IEndpointService>botConfig.findServiceByNameOrId(BOT_CONFIGURATION);

4) 替换 (index.ts)

// const adapter : BotFrameworkAdapter = new BotFrameworkAdapter({
//     appId: endpointConfig.appId || process.env.microsoftAppID,
//     appPassword: endpointConfig.appPassword || process.env.microsoftAppPassword
// });

const adapter : BotFrameworkAdapter = new BotFrameworkAdapter({
    appId: process.env.microsoftAppID,
    appPassword: process.env.microsoftAppPassword
});

5) 替换 (index.ts)

// let bot: BasicBot;
// try {
//     bot = new BasicBot(conversationState, userState, botConfig);
// } catch (err) {
//     console.error(`[botInitializationError]: ${ err }`);
//     process.exit();
// }

let bot: BasicBot;
try {
    bot = new BasicBot(conversationState, userState);
} catch (err) {
    console.error(`[botInitializationError]: ${ err }`);
    // process.exit();
}

6) 现在在 bot.ts 中,通过删除第三个参数 "botConfig"https://github.com/Microsoft/BotBuilder-Samples/blob/master/samples/javascript_typescript/13.basic-bot/src/bot.ts.

更改 Bot-constructor 的签名

替换

// constructor(conversationState: ConversationState, userState: UserState, botConfig: BotConfiguration) {...

constructor(conversationState: ConversationState, userState: UserState) {...

7) 删除​​ bot.ts 中对 botConfig 的所有引用,因为这似乎仅用于其他 Azure 服务

// if (!botConfig) throw ('Missing parameter.  botConfig is required');
//
// add the LUIS recognizer
// let luisConfig: LuisService;
// luisConfig = <LuisService>botConfig.findServiceByNameOrId(LUIS_CONFIGURATION);
// if (!luisConfig || !luisConfig.appId) throw ('Missing LUIS configuration. Please follow README.MD to create required LUIS applications.\n\n');
// this.luisRecognizer = new LuisRecognizer({
//     applicationId: luisConfig.appId,
//
// CAUTION: Its better to assign and use a subscription key instead of authoring key here.
//     endpointKey: luisConfig.authoringKey,
//     endpoint: luisConfig.getEndpoint()
// });

8) 不要忘记在bot.ts.

中删除基于第7步删除变量的所有逻辑