ããã§èå³æ·±ãã®ã¯ããéä¿¡ãèªäœãããŸããŸãªå Žæã§çºçããå¯èœæ§ãããããšã§ããCortanaã¯ã©ã€ã¢ã³ãã䜿çšãããã¹ã¯ãããäžã ãã§ãªãããã£ããã«åŸæ¥äœ¿çšãããä»ã®ãã£ãã«ïŒSkypeãTelegramãSlackãªã©ïŒã§ãçºçããŸãã ããŒãœãã«ã¢ã·ã¹ã¿ã³ãã®æ§æ Œãšèšæ¶ã¯éä¿¡ãã£ãã«ã«äŸåããŸããããã¯ã©ãŠãã®ã©ããã«ããããããããäŒè©±ãã£ã³ãã¹ãã®ããããã§ãã£ããããæºåãã§ããŠããŸãã
ããããäœæããããã«ã Microsoft Bot Frameworkã®äºåããŒãžã§ã³ãšå¯Ÿå¿ããAPIãæ瀺ãããŸãããããã«ã€ããŠã¯ã以äžã§èª¬æããŸãã ãŸããè±èªã§ã®ãŠãŒã¶ãŒãšã®äŒè©±ããµããŒãããç¬èªã®ã·ã³ãã«ãªããããäœæããæ¹æ³ã瀺ããŸãã
次ã®äž»èŠãªèŠçŽ ã¯ãããããæäœããããã«äœ¿çšãããŸãã
- ããããã«ããŒSDK ïŒCïŒããã³Node.jsã§å©çšå¯èœïŒã¯ãäž»èŠãªãããæ©èœãäœæããããã«èšèšãããŠããŸãã ããã¯WebAPIã«åºã¥ããŠãããå€çãšã®ãããã®éä¿¡ãããã³ã«ãå®çŸ©ããŸãã SDKã®äžéšãšããŠããããã®ãããã°ãå¯èœã«ãããšãã¥ã¬ãŒã¿ãŒãšãç¶æ ã®ããé·ããã€ã¢ãã°ãªã©ãããã€ãã®äž»èŠãªæœè±¡åã®å®è£ ãç°¡çŽ åããã¯ã©ã¹ã®ã»ããããããŸãã
- Cognitive Services ïŒä»¥åã¯Project Oxfordã®äžéšã§ããLUISãšããŠç¥ãããŠããŸãã ïŒã¯ãèªç¶èšèªåæãç°¡çŽ åããããã¹ãæããæå³ãæœåºããŸãã Webã€ã³ã¿ãŒãã§ãŒã¹ã䜿çšããŠãåºæ¬çãªæ§ææ§æã決å®ãã察å¿ãããŠãŒã¶ãŒã€ã³ãã³ãïŒæå³ïŒãèªåçã«å²ãåœãŠãŠãããããå¿çããŸãã
- ãããã³ãã¯ã¿ã䜿çšãããšãããããSkypeãSlackãTelegramãªã©ã®1ã€ãŸãã¯è€æ°ã®éä¿¡ãã£ãã«ã«ãã€ã³ãã§ããŸãããããè¡ãã«ã¯ããµã€ãbotframework.comã§ãããæ¥ç¶ãèšå®ããŸãã
- æéãçµã€ã«ã€ããŠãããŸããŸãªããããžã®ãªã³ã¯ãå ¬éã§ãããããã®ã«ã¿ãã° ã
äŸïŒããŒãã£ãŒããããç¥ã
ãããã®å¥œäŸã¯ã httpïŒ//www.projectmurphy.net/ãããžã§ã¯ãã®äžéšãšããŠäœæãããããŒãã£ãŒã§ãã ãµã€ãã蚪ããããSkypeã«Murphyãã€ã³ã¹ããŒã«ããŠãã£ãããéå§ã§ããŸãïŒãããããµããŒãããææ°ããŒãžã§ã³ã®Skypeã䜿çšããŠããããšã確èªããŠãã ããïŒã ãã®ãããã«ã¯ããCindy Crawfordãã¹ãŒããŒãã³ã ã£ããã©ãããïŒãïŒäžã®ãã€ã¢ãã°äŸãåç §ïŒããŸãã¯ãç§ãããã°ã©ããŒã ã£ããã©ããããïŒãã®å Žåãåçãã¢ããããŒãããããã«æ±ããããŸãïŒãªã©ã®è³ªåãããããšãã§ããŸãã
ããã«ã¡ã¯ãããïŒ ç§ãã¡ã¯èªåã«å¯Ÿè«è ãæžããŸã
äŸãšããŠãBot Frameworkã«åºã¥ããåçŽãªãããã®äœææ¹æ³ãèŠãŠã¿ãŸãããã ãããã®å¿èãšè³ã¯ãéåžžã¯ã¯ã©ãŠãã«é 眮ãããŠããWebãµãŒãã¹ã§ããããšãæãåºããŠãã ããã
ãã®ãããªãµãŒãã¹ãäœæããæãç°¡åãªæ¹æ³ã¯ãVisual Studioçšã®ããããã¬ãŒã ã¯ãŒã¯ãã³ãã¬ãŒããããŠã³ããŒãããããšã§ãïŒWebããŒã«ãã€ã³ã¹ããŒã«ãããVisual Studio 2015 Update 1ãããããšã確èªããŠãã ããïŒã çµæã®ZIPãã¡ã€ã«ãVisual Studioãã³ãã¬ãŒãã®ãããã£ã¬ã¯ããªã«é 眮ããŸããéåžžã¯ãïŒ USERPROFILEïŒ \ Documents \ Visual Studio 2015 \ Templates \ ProjectTemplates \ Visual CïŒãã§ãããã®åŸãVisual Studioã§Bot Applicationã¿ã€ãã®æ°ãããããžã§ã¯ããäœæã§ããŸãã
äœæããããããžã§ã¯ãã§ã¯ã Controllers / MessagesController.csãã¡ã€ã«ã®Postã¡ãœããããããã®äž»ãªæ©èœãæ åœããŸãã æãåçŽãªHelloãããã®å Žåããã®ã¡ãœããã次ã®ããã«å®è£ ããŸãã
public async Task<Message> Post([FromBody]Message message) { if (message.Type == "Message") { var reply = message.Text.ToLower() == "hello" ? "Hello!" : "I do not understand you!"; return message.CreateReplyMessage(reply); } else { return HandleSystemMessage(message); } }
ãããããã¹ãããã«ã¯ãããŒã«ã«WebãµãŒããŒïŒF5ïŒã§ãããžã§ã¯ããå®è¡ããéããŠãããã©ãŠã¶ãŒã®ã¢ãã¬ã¹ããŒããã¢ãã¬ã¹ãšããŒããã³ããŒããŠã Microsoft Bot Framework Emulatorã§éããŸã ïŒæåã«ããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããå¿ èŠããããŸãïŒã ãã¹/ API /ã¡ãã»ãŒãžããµã€ãã®ã¢ãã¬ã¹ããŒã«è¿œå ããå¿ èŠãããããšã«æ³šæããŠãã ããã
ãããã«ããå°ã䟿å©ãªããšããããããã«ãæåãªElizaããã°ã©ã ã®CïŒããŒãã䜿çšããŸããã äœæããããã£ãããããã¯ãGitHubãªããžããªããããŠã³ããŒãã§ããŸã ã æåã®ããŒãžã§ã³ã§ã¯ããããã®æ§ç¯ã¹ããŒã ã¯äžèšã®ããã°ã©ã ãšããã»ã©å€ãããŸãããçããçæããããã«Elizaã©ã€ãã©ãªã¡ãœããã®ã¿ãåŒã³åºãããŸãã
ãã®ãããªåçŽãªå®è£ ã¯ãPostã¡ãœããããã¹ãŠã®ãŠãŒã¶ãŒããã®ãªã¯ãšã¹ããåŠçããããã«äœ¿çšããããããã®éã®ç¶æ åé¢ããªãããããŠãŒã¶ãŒãšã®é·ããã€ã¢ãã°ããµããŒãããã®ã«ã¯ããŸãé©ããŠããŸããã ãããè¡ãã«ã¯ãã»ãã·ã§ã³èå¥åïŒ message.ConversationID ïŒãæ瀺çã«ç¢ºèªããããBotUserData / BotConversationDataãªããžã§ã¯ãã䜿çšãããããã€ã¢ãã°ããµããŒãããããé«åºŠãªAPIã䜿çšããŸãïŒãããã«ã€ããŠã¯ä»åŸã®èšäºã§èª¬æããŸãïŒã ãããŸã§ã®éããããã¯ã¹ããŒãã¬ã¹ã§ãããšèããŠããããã®è©³çŽ°ã«æ³šæãæããŸããã
ã¯ã©ãŠãã§ããããéå§ããã«ã¯ããŸããçµæã®Web APIãAzureã§å ¬éããå¿ èŠããããŸãã 次ã«ã httpïŒ//dev.botframework.comã«ãã°ã€ã³ããŠãæ°ããããããç»é²ããå¿ èŠããããŸãã ãããã«åºæã®AppIDãèãåºããApp Secretãèªåçã«çæããããšãéèŠã§ãã
ãã®åŸãéèŠãªæé ãå®è¡ããå¿ èŠããããŸã-ã¢ããªã±ãŒã·ã§ã³ã®Web.Configãã¡ã€ã«ã§ãã¢ããªIDãšã¢ããªããŒãè¿œå ããå¿ èŠããããŸãã
<configuration> <appSettings> <add key="AppId" value="YourAppId" /> <add key="AppSecret" value="YourAppSecret" /> </appSettings>
ãã®åŸãWeb ConfigãæŽæ°ãããããã«ãããããã¯ã©ãŠãã«åãããã€ããå¿ èŠããããŸãã
ãããè¡ã£ãããããããã¬ãŒã ã¯ãŒã¯ãµã€ãã®ããããã£ããã«ã§ãããã®ããã©ãŒãã³ã¹ããã¹ãããããæ¢ç¥ã®ãšãã¥ã¬ãŒã¿ãŒã䜿çšã§ããŸãããã ãããã®å Žåãæ£ããAppIDãšApp Secretãå ¥åããå¿ èŠããããŸãã
ãããã¯ãšãã¥ã¬ãŒã¿ãŒã§åäœããŠããã®ã§ãããŸããŸãªéä¿¡ãã£ãã«ã«ãã€ã³ãã§ããŸãã ãããè¡ãã«ã¯ãBot Frameworkãµã€ãã®ãããã³ã³ãããŒã«ããã«ã§ãããã®ãã£ãã«ãè¿œå ããŠæ§æããŸãã ãããè¡ãã«ã¯ãåžæããéä¿¡ãã£ãã«ãéžæããæ瀺ã«åŸããŸãã
ããšãã°ãTelegramã®å Žåãç¹å¥ãªBot Fatherããããšã®äŒè©±ã䜿çšããŠTelegramã§æ°ããããããäœæããAccess TokemãååŸããŠBot Frameworkãµã€ãã«æäŸããå¿ èŠããããŸãã ãã®åŸããããã³ãã¯ã¿ãTelegram APIãšãããã®éã®ãã¹ãŠã®äžéæäœãåŒãç¶ããTelegramããããããšéä¿¡ã§ããããã«ãªããŸãã ãšããã§ãç§ã®ãããã¯é»å ±@ElllizaBotã§åŒã³åºãããŸããããªãã¯åœŒãšè©±ãããšãã§ããŸãïŒ
BUILDã®ãã®è±èªã®ã¬ããŒãã§ã¯ãããããã¬ãŒã ã¯ãŒã¯ã䜿çšããŠããããæåããäœæããæ¹æ³ã«ã€ããŠè©³ããèªãããšãã§ããŸãã
ãã£ã³ãã«ã®æœè±¡å
Bot Framework APIã®äž»ãªå©ç¹ã¯ã1ã€ã®éä¿¡ãã£ãã«ã«çŠç¹ãåœãŠãããšãªãããããäœæã§ããããã«ãªã£ãããšã§ãã å®éãBot Frameworkã¯äŒè©±ããã³å¯Ÿè©±ã¡ã«ããºã ãå®è£ ããããã®é©åãªã¬ãã«ã®æœè±¡åãæäŸããBot Connectorã¯ããŸããŸãªã³ãã¥ãã±ãŒã·ã§ã³ããŒã«ãšã®ç¹å®ã®æ¥ç¶ãåŒãåããŸãã ãã®åé¢ã«ãããããã°ã©ãã¯ãããã1åäœæããã©ãããã§ãããããšéä¿¡ã§ããŸãã Javaã®äžçã§ç¥ãããŠããã¹ããŒã¬ã³ãèšãæãããšããã®ååã次ã®ããã«å®åŒåã§ããŸãïŒ Write Once-Chat Everywhere ã
Skype Bot APIã«ã€ããŠäžèš
// BUILDã§çºè¡šããããã1ã€ã®ãã¥ãŒã¹ã¯ãããããäœæããããã®å¥ã®Skype APIã®å¯çšæ§ã§ãã å®éãBot Frameworkãä»ããŠSkypeããããäœæã§ããŸããããããŸã§ã®Bot Frameworkã®æ©èœã§ã¯ãããã¹ãïŒããã³äžéšã®çš®é¡ã®æ·»ä»ãã¡ã€ã«ïŒã®ã¿ã§äœæ¥ã§ããŸãããSkype Bot APIã¯ããå¹ ãåºããäœæã§ããŸããããªãããã ãã¯ãããžãŒãéžæãããšãã¯ãæ±çšæ§ãããããBot Frameworkãåªå ããå¿ èŠããããŸãããSkypeå°çšã®æ¬åœã«çŽ æŽãããããããäœæããå Žåã¯ã Skype Bot SDKãã芧ãã ãã ã
ãããã«
察話ã¯äººãšäººãšã®éã®èªç¶ãªçžäºäœçšã§ããã人ãšã³ã³ãã¥ãŒã¿ãšã®éã®èªç¶ãªçžäºäœçšã«ãªãããšãå€æãããããããŸããã ãã€ã¯ããœããã¯ãBot Frameworkã®åœ¢åŒã§äŸ¿å©ãªãœãããŠã§ã¢æœè±¡åãæäŸããŸããããã«ãããå€ãã®éä¿¡ãã£ãã«ã§ããã«åäœãããã£ãããããã®äœæãéå§ã§ããŸãã ããã¯ææã§ããã ãã§ãªããéåžžã«é¢çœããã®ã§ãïŒ ãã°ããã®éããããã®äœæãè©ŠããŠã¿ãŸãããã ã¢ããªã¹ããèšãããã«ãæ°å¹ŽïŒãŸãã¯æ°ãæïŒåŸã«ããããWebãµã€ããŸãã¯ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®ä»£ããã«ãªããã©ããã確èªããŸã ã
åæ§ã®ãããã¯ã«é¢ããä»ã®èšäºã¯æ¬¡ã®ãšããã§ã ã