Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions BotSharp.Core/BotSharp.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ If you feel that this project is helpful to you, please Star on the project, we
<PackageReference Include="CherubNLP" Version="0.2.0" />
<PackageReference Include="Colorful.Console" Version="1.2.9" />
<PackageReference Include="CSRedisCore" Version="3.1.5" />
<PackageReference Include="Ding.Core" Version="1.0.0-preview-20190906-01" />
<PackageReference Include="DotNetToolkit" Version="1.7.0" />
<PackageReference Include="EntityFrameworkCore.BootKit" Version="1.14.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
Expand Down
2 changes: 2 additions & 0 deletions BotSharp.Core/Modules/ModulesStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public ModulesStartup(IConfiguration configuration)
Console.WriteLine($"Using default emulator: DialogflowAi, BotSharp.Platform.Dialogflow.");
}

Console.WriteLine($"Note: The red part information shown below can be ignored because the corresponding item is not referenced.", Color.Yellow);

this._modules = options.Modules
.Select(s =>
{
Expand Down
54 changes: 54 additions & 0 deletions docs/Deployment Run/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Because many people don't know how to run, or run an error, write a tutorial today.

First of all, first get the code, you can download the source code through the command line or SourceTree. I mainly introduce the source code download method of SourceTree:

![SourceTree](https://images.gitee.com/uploads/images/2019/0909/191331_59109574_130171.jpeg "1.JPG")

Enter the form shown in the above figure by using the file ==>Clone/New or the tab bar + number. Follow the circle and operation in the circle to synchronize the source code to the local specified directory. I am in the "L:\Complete Project\Smart Chat Robot\BotSharp\Net core 2.2" folder, which will be used to demonstrate this folder path.

Go to the BotSharp.WebHost folder and type cmd in the address bar and press Enter. The cmd window will pop up. Enter the dotnet watch run command to run the project.

![Project operation](https://images.gitee.com/uploads/images/2019/0909/191850_a4f0fd89_130171.jpeg "2.JPG")

Note: The red font display part in the above picture can be ignored. If there is obsessive-compulsive disorder, you can right-click BotSharp.Platform.Rasa and BotSharp.Platform.Articulate in BotSharp.WebHost, or in BotSharp.WebHost/Settings/ Remove the circle in the image below in app.json

![Remove red item](https://images.gitee.com/uploads/images/2019/0909/192213_87385c4d_130171.jpeg "3.JPG")

Next we open the address of the Swagger interface to see if the Swagger interface document is displayed normally.

![Successful operation](https://images.gitee.com/uploads/images/2019/0909/192612_6aceb74e_130171.jpeg "4.JPG")

As shown, we ran successfully.


Next, start importing and training and testing the agent online through the interface documentation above.

First import the zip package required by the training agent, which contains the corpus

![Interface operation](https://images.gitee.com/uploads/images/2019/0909/193255_897b251c_130171.jpeg "5.JPG")

![Interface operation](https://images.gitee.com/uploads/images/2019/0909/193349_38366ca2_130171.jpeg "6.JPG")

![Interface operation](https://images.gitee.com/uploads/images/2019/0909/194412_edf0f024_130171.jpeg "7.JPG")

The part of the circle in the picture above is to be recorded and will be useful next. Where id is the proxy ID generated by the newly imported document, clientAccessToken is the authorization ID, and the training agent model needs this authorization ID.

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/195938_0b68c3c4_130171.jpeg "8.JPG")

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/195950_18b84a44_130171.jpeg "9.JPG")

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/200000_34596964_130171.jpeg "10.JPG")

The operation of the above pictures is to save the authorization information required by the current interface, especially the part of the circle, and Bearer is followed by a space followed by the value of clientAccessToken, and the value of clientAccessToken is different for training different agents. .

Fill in the proxy ID generated in the figure below and click Execute to execute.

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/200258_7ea18c61_130171.jpeg "11.JPG")

Then follow the picture below to enter the test data to execute the output.

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/204756_99e489c3_130171.jpeg "12.JPG")

![Enter image description](https://images.gitee.com/uploads/images/2019/0909/204939_6b75f8cd_130171.png "屏幕截图.png")

The part in the circle in the above figure is the result of the execution.
54 changes: 54 additions & 0 deletions docs/Deployment Run/ReadMe_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
因为目前很多人不知道怎么样运行,或者运行报错,故今天写下这样一个教程。

首先第一步先获取代码,可以通过命令行或者SourceTree下载源码,我这里主要介绍SourceTree的下载源码方法:

![SourceTree](https://images.gitee.com/uploads/images/2019/0909/191331_59109574_130171.jpeg "1.JPG")

通过文件下==>克隆/新建或者是标签栏+号进入上图所示窗体,按照圈中所圈填写和操作即可将源码同步到本地指定目录。我的是在“L:\完成项目\智能聊天机器人\BotSharp\Net core 2.2”文件夹中,后面会以此文件夹路径来做演示。

进入BotSharp.WebHost文件夹并在地址栏里输入cmd并回车,即弹出cmd窗口,输入dotnet watch run命令会运行项目。

![项目运行](https://images.gitee.com/uploads/images/2019/0909/191850_a4f0fd89_130171.jpeg "2.JPG")

注意:上图中红色字体显示部分可以不用理会,如果有强迫症的话,可以在BotSharp.WebHost右键引入BotSharp.Platform.Rasa和BotSharp.Platform.Articulate这两个项目,或者在BotSharp.WebHost/Settings/app.json中删除下图中圈中部分

![移除红色项目](https://images.gitee.com/uploads/images/2019/0909/192213_87385c4d_130171.jpeg "3.JPG")

接下来我们通过第二张图片上运行之后的地址打开查看Swagger的接口文档是否正常显示。

![运行成功](https://images.gitee.com/uploads/images/2019/0909/192612_6aceb74e_130171.jpeg "4.JPG")

如图所示,我们运行成功了。


接下来开始通过上面的接口文档在线导入和训练并测试代理。

先导入训练代理所需要的压缩包,里面包含有语料库

![接口操作](https://images.gitee.com/uploads/images/2019/0909/193255_897b251c_130171.jpeg "5.JPG")

![接口操作](https://images.gitee.com/uploads/images/2019/0909/193349_38366ca2_130171.jpeg "6.JPG")

![接口操作](https://images.gitee.com/uploads/images/2019/0909/194412_edf0f024_130171.jpeg "7.JPG")

上图中圈中的部分要记录下来,接下来会有用。其中id是刚导入文档生成的代理ID,clientAccessToken是授权ID,训练代理模型是需要这个授权ID的。

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/195938_0b68c3c4_130171.jpeg "8.JPG")

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/195950_18b84a44_130171.jpeg "9.JPG")

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/200000_34596964_130171.jpeg "10.JPG")

上面几张图片的操作就是保存当前接口所需要授权信息的方法,尤其是要注意圈中部分,另Bearer后面跟一个空格再跟上clientAccessToken的值,且训练不同的代理这个clientAccessToken的值也不一样。

在下图中填入前面生成的代理ID并点击Execute执行即可

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/200258_7ea18c61_130171.jpeg "11.JPG")

然后按下面图片操作输入测试数据执行输出

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/204756_99e489c3_130171.jpeg "12.JPG")

![输入图片说明](https://images.gitee.com/uploads/images/2019/0909/204939_6b75f8cd_130171.png "屏幕截图.png")

上图中圈中部分即为执行得到的结果