Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在RequestMessageTextKeywordHandler里预留一个专门的NLU接口。 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ public static RequestMessageTextKeywordHandler Regex(this RequestMessageTextKeyw
return handler;
}

/// <summary>
/// 自然语言理解
/// Natural Language Understanding
/// 可以使用第三方NLU服务接口或开源聊天机器人框架BotSharp(https://github.com/Oceania2018/BotSharp)
/// </summary>
/// <param name="handler"></param>
/// <param name="func"></param>
/// <returns></returns>
public static RequestMessageTextKeywordHandler NLU(this RequestMessageTextKeywordHandler handler, Func<IResponseMessageBase> func)
{
if (!handler.MatchSuccessed)
{
handler.ResponseMessage = func();
}

return handler;
}

/// <summary>
/// 默认消息
/// </summary>
Expand Down