update docs

This commit is contained in:
Oceania2018 2018-10-02 11:46:24 -05:00
parent 989d0362b9
commit 34998f7c09
8 changed files with 157 additions and 16 deletions

View file

@ -19,7 +19,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NAudio" Version="1.8.4" /> <PackageReference Include="NAudio" Version="1.9.0-preview1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -22,7 +22,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ARTICULATE|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ARTICULATE|AnyCPU'">
<DefineConstants>DEBUG;TRACE;ARTICULATE</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<Optimize>false</Optimize> <Optimize>false</Optimize>
</PropertyGroup> </PropertyGroup>
@ -78,6 +78,30 @@
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="3.0.0" /> <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="3.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Update="Settings\app.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\ArticulateAi.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\auth.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\BotSharpAi.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\db.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\logging.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\swagger.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="App_Data\CRFLite\template.en"> <None Update="App_Data\CRFLite\template.en">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

View file

@ -18,16 +18,27 @@ namespace BotSharp.WebHost
.ConfigureAppConfiguration((hostingContext, config) => .ConfigureAppConfiguration((hostingContext, config) =>
{ {
var env = hostingContext.HostingEnvironment; var env = hostingContext.HostingEnvironment;
Console.WriteLine($"ContentRootPath: {env.ContentRootPath}");
string dir = Path.GetFullPath(env.ContentRootPath); string dir = Path.GetFullPath(env.ContentRootPath);
string settingsFolder = Path.Combine(dir, "Settings"); string settingsFolder = Path.Combine(dir, "Settings");
// locate setting folder
if (!Directory.Exists(settingsFolder)) if (!Directory.Exists(settingsFolder))
{ {
dir = Path.GetFullPath(env.ContentRootPath + "/.."); dir = Path.GetFullPath(env.ContentRootPath + "/..");
} }
settingsFolder = Path.Combine(dir, "Settings"); settingsFolder = Path.Combine(dir, "Settings");
if (!Directory.Exists(settingsFolder))
{
dir = Path.GetFullPath(env.ContentRootPath + "/bin");
}
settingsFolder = Path.Combine(dir, "Settings");
Console.WriteLine($"Read settings from {settingsFolder}"); Console.WriteLine($"Read settings from {settingsFolder}");
var settings = Directory.GetFiles(settingsFolder, "*.json"); var settings = Directory.GetFiles(settingsFolder, "*.json");
settings.ToList().ForEach(setting => settings.ToList().ForEach(setting =>
{ {

View file

@ -1,7 +1,3 @@
.. raw:: html
<img src="https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png" width="100px">
The Open Source AI Bot Platform Builder The Open Source AI Bot Platform Builder
====================================================== ======================================================
@ -19,6 +15,10 @@ The Open Source AI Bot Platform Builder
:target: `botsharpnuget`_ :target: `botsharpnuget`_
:alt: NuGet :alt: NuGet
.. raw:: html
<img src="https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png" width="100px">
This project is for learning purposes only, please do not use it in a production environment. This project is for learning purposes only, please do not use it in a production environment.
********************************************************************************************** **********************************************************************************************
@ -81,7 +81,7 @@ Scan to join group in Wechat
.. _Docker: https://www.docker.com .. _Docker: https://www.docker.com
.. _Rasa UI: https://github.com/paschmann/rasa-ui .. _Rasa UI: https://github.com/paschmann/rasa-ui
.. _Articulate UI: https://spg.ai/projects/articulate .. _Articulate UI: https://github.com/Oceania2018/articulate-ui
.. _gitter: https://gitter.im/botsharpcore/Lobby .. _gitter: https://gitter.im/botsharpcore/Lobby
.. _license: https://raw.githubusercontent.com/Oceania2018/BotSharp/master/LICENSE .. _license: https://raw.githubusercontent.com/Oceania2018/BotSharp/master/LICENSE
.. _botsharpnuget: https://www.nuget.org/packages/BotSharp.Core .. _botsharpnuget: https://www.nuget.org/packages/BotSharp.Core

16
docs/configuration/db.rst Normal file
View file

@ -0,0 +1,16 @@
Database Settings
=================
::
{
"Database": {
"Default": "Redis",
"ConnectionStrings": {
"InMemory": "DataSource=:memory:",
"Redis": "127.0.0.1:6379,defaultDatabase=BotSharp,poolsize=50,ssl=false,writeBuffer=10240,prefix=agent_",
"Sqlite": "Data Source=|DataDirectory|BotSharp.db;",
"SqlServer": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BotSharp;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
}
}
}

View file

@ -0,0 +1,57 @@
Platform Settings
=================
* app.json
::
{
"Assemblies": "BotSharp.Core",
"BotPlatform": "BotSharpAi",
"Version": "0.1.0",
"MachineLearning": {
"dataDir": "D:\\Projects\\BotSharp\\Data"
}
}
* BotSharpAi.json
::
{
"BotSharpAi": {
"Lang": "en",
"Provider": "BotSharpProvider",
"BotSharpProvider": {
},
"Pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier",
"BotSharpTokenizer": {
"tokenizer": "TreebankTokenizer"
},
"BotSharpIntentClassifier": {
"classifer": "SVMClassifier"
},
"BotSharpTagger": {
"tagger": "NGramTagger"
},
"BotSharpCRFNer": {
"template": "|App_Data|CRFLite/template.en"
},
"WitAiEntityRecognizer": {
"url": "https://api.wit.ai",
"resource": "message",
"serverAccessToken": "SERVER_ACCESS_TOKEN",
"version": "20180811"
}
}
}

View file

@ -44,12 +44,13 @@ The main documentation for the site is organized into a couple sections:
* :ref:`User Documentation <user-docs>` * :ref:`User Documentation <user-docs>`
* :ref:`Integration Documentation <integration-docs>` * :ref:`Integration Documentation <integration-docs>`
* :ref:`NLP Documentation <nlp-docs>` * :ref:`NLP Documentation <nlp-docs>`
* :ref:`Architecture Documentation <architecture-docs>`
* :ref:`search` * :ref:`search`
.. _user-docs: .. _user-docs:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 3
:caption: User Documentation: :caption: User Documentation:
installation installation
@ -69,10 +70,19 @@ The main documentation for the site is organized into a couple sections:
integrations/telegram integrations/telegram
integrations/skype integrations/skype
.. _architecture-docs:
.. toctree::
:maxdepth: 3
:caption: Architecture Documentation:
configuration/db
configuration/platform
.. _nlp-docs: .. _nlp-docs:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 3
:caption: NLP Documentation: :caption: NLP Documentation:
models/crf models/crf
@ -85,5 +95,5 @@ The main documentation for the site is organized into a couple sections:
If you feel that this project is helpful to you, please Star us on the project, we will be very grateful. If you feel that this project is helpful to you, please Star us on the project, we will be very grateful.
.. _Rasa UI: https://github.com/paschmann/rasa-ui .. _Rasa UI: https://github.com/paschmann/rasa-ui
.. _Articulate UI: https://spg.ai/projects/articulate .. _Articulate UI: https://github.com/Oceania2018/articulate-ui
.. _gitter: https://gitter.im/botsharpcore/Lobby .. _gitter: https://gitter.im/botsharpcore/Lobby

View file

@ -38,19 +38,41 @@ Point your web browser at http://localhost:5001 and enjoy Rasa-UI with BotSharp.
4. Integrate with `Rasa Talk`_ 4. Integrate with `Rasa Talk`_
Building BotSharp Building & Run locally
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
If you are a .NET developer and want to develop extensions or fix bug for BotSharp, you would CTRL + F5 to run it locally in debug mode. If you are a .NET developer and want to develop extensions or fix bug for BotSharp, you would CTRL + F5 to run it locally in debug mode.
Make sure the `Microsoft .NET Core`_ build environment is installed. Make sure the `Microsoft .NET Core`_ build environment and `Node.js`_ is installed.
Building solution using dotnet CLI (preferred). Building solution using dotnet CLI (preferred).
* Build NLU API
:: ::
PS D:\> git clone https://github.com/Oceania2018/BotSharp PS D:\> git clone https://github.com/Oceania2018/BotSharp
PS D:\> cd BotSharp PS D:\> cd BotSharp
PS D:\> dotnet build PS D:\> dotnet build -v m -o ../bin -c ARTICULATE
PS D:\> dotnet bin\BotSharp.WebHost.dll
Install in docker container If you don't have Redis installed, please update ArticulateAi.json:
::
"AgentStorage": "AgentStorageInRedis"
to
::
"AgentStorage": "AgentStorageInMemory"
* Build Chatbot Designer
::
PS D:\> git clone https://github.com/Oceania2018/articulate-ui
PS D:\> cd articulate-ui
PS D:\> npm install
PS D:\> npm start
Building docker image
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you just want to run BotSharp as a backend NLU engine, you can run it standalone in docker. If you just want to run BotSharp as a backend NLU engine, you can run it standalone in docker.
@ -100,9 +122,10 @@ Use BotSharp.NLP as a natural language processing toolkit alone.
.. _Botpress: https://github.com/botpress/botpress .. _Botpress: https://github.com/botpress/botpress
.. _Rasa UI: https://github.com/paschmann/rasa-ui .. _Rasa UI: https://github.com/paschmann/rasa-ui
.. _Articulate UI: https://spg.ai/projects/articulate .. _Articulate UI: https://github.com/Oceania2018/articulate-ui
.. _Rasa Talk: https://github.com/jackdh/RasaTalk .. _Rasa Talk: https://github.com/jackdh/RasaTalk
.. _Microsoft .NET Core: https://www.microsoft.com/net/download .. _Microsoft .NET Core: https://www.microsoft.com/net/download
.. _Node.js: https://nodejs.org
.. _Docker: https://www.docker.com .. _Docker: https://www.docker.com
.. |APIHomeScreenshot| image:: /static/screenshots/APIHome.png .. |APIHomeScreenshot| image:: /static/screenshots/APIHome.png