Cancel the dependency on the database, restore the Bot to the file system, and separate the Bot NLP Engine and the pre-Bot Platform system. Complete the AgentImporterInDialogflow function.
This commit is contained in:
parent
409a150e11
commit
8ee00fab36
|
|
@ -51,7 +51,7 @@ namespace BotSharp.Core.UnitTest
|
||||||
|
|
||||||
agents.ForEach(agentHeader => {
|
agents.ForEach(agentHeader => {
|
||||||
var bot = new BotSharpAi();
|
var bot = new BotSharpAi();
|
||||||
bot.RestoreAgent<AgentImporterInDialogflow>(agentHeader);
|
bot.RestoreAgent<AgentImporterInDialogflow>();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,8 @@ namespace BotSharp.Core.Engines
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load agent summary
|
/// Load agent summary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="agentHeader"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Agent LoadAgent(AgentImportHeader agentHeader);
|
Agent LoadAgent();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load user customized entity type which defined in dictionary
|
/// Load user customized entity type which defined in dictionary
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace BotSharp.Core.Engines
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Agent LoadAgent(string id);
|
Agent LoadAgent(string id);
|
||||||
|
|
||||||
Agent LoadAgentFromFile<TAgentImporter>(string dataDir, AgentImportHeader agentHeader) where TAgentImporter : IAgentImporter, new();
|
Agent LoadAgentFromFile<TAgentImporter>(string dataDir) where TAgentImporter : IAgentImporter, new();
|
||||||
|
|
||||||
AIResponse TextRequest(AIRequest request);
|
AIResponse TextRequest(AIRequest request);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,12 @@
|
||||||
<DefineConstants>TRACE;MODEL_PER_CONTEXTS</DefineConstants>
|
<DefineConstants>TRACE;MODEL_PER_CONTEXTS</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Accounts\**" />
|
||||||
|
<EmbeddedResource Remove="Accounts\**" />
|
||||||
|
<None Remove="Accounts\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BotSharp.NLP" Version="0.2.3" />
|
<PackageReference Include="BotSharp.NLP" Version="0.2.3" />
|
||||||
<PackageReference Include="DotNetToolkit" Version="1.6.0" />
|
<PackageReference Include="DotNetToolkit" Version="1.6.0" />
|
||||||
|
|
|
||||||
|
|
@ -86,28 +86,27 @@ namespace BotSharp.Core.Engines
|
||||||
/// Restore a agent instance from backup json files
|
/// Restore a agent instance from backup json files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="importer"></param>
|
/// <param name="importer"></param>
|
||||||
/// <param name="agentHeader"></param>
|
|
||||||
/// <param name="dataDir"></param>
|
/// <param name="dataDir"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool RestoreAgent<TAgentImporter>(AgentImportHeader agentHeader) where TAgentImporter : IAgentImporter, new()
|
public bool RestoreAgent<TAgentImporter>() where TAgentImporter : IAgentImporter, new()
|
||||||
{
|
{
|
||||||
string dataDir = Path.Combine(DbInitializerPath, "Agents");
|
string dataDir = Path.Combine(DbInitializerPath, "Agents");
|
||||||
|
|
||||||
int row = dc.DbTran(() => {
|
int row = dc.DbTran(() => {
|
||||||
LoadAgentFromFile<TAgentImporter>(dataDir, agentHeader);
|
LoadAgentFromFile<TAgentImporter>(dataDir);
|
||||||
SaveAgent();
|
SaveAgent();
|
||||||
});
|
});
|
||||||
|
|
||||||
return row > 0;
|
return row > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Agent LoadAgentFromFile<TAgentImporter>(string dataDir, AgentImportHeader agentHeader) where TAgentImporter : IAgentImporter, new()
|
public Agent LoadAgentFromFile<TAgentImporter>(string dataDir) where TAgentImporter : IAgentImporter, new()
|
||||||
{
|
{
|
||||||
var importer = new TAgentImporter();
|
var importer = new TAgentImporter();
|
||||||
importer.AgentDir = dataDir;
|
importer.AgentDir = dataDir;
|
||||||
|
|
||||||
// Load agent summary
|
// Load agent summary
|
||||||
agent = importer.LoadAgent(agentHeader);
|
agent = importer.LoadAgent();
|
||||||
|
|
||||||
// Load user custom entities
|
// Load user custom entities
|
||||||
importer.LoadCustomEntities(agent);
|
importer.LoadCustomEntities(agent);
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,15 @@ namespace BotSharp.Core.Engines
|
||||||
/// <param name="agentName"></param>
|
/// <param name="agentName"></param>
|
||||||
/// <param name="agentDir"></param>
|
/// <param name="agentDir"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Agent LoadAgent(AgentImportHeader agentHeader)
|
public Agent LoadAgent()
|
||||||
{
|
{
|
||||||
|
// load meta
|
||||||
|
string metaJson = File.ReadAllText(Path.Combine(AgentDir, "meta.json"));
|
||||||
|
|
||||||
|
AgentImportHeader agentHeader = JsonConvert.DeserializeObject<AgentImportHeader>(metaJson);
|
||||||
|
|
||||||
// load agent profile
|
// load agent profile
|
||||||
string data = File.ReadAllText(Path.Combine(AgentDir, "Dialogflow", $"{agentHeader.Name}{Path.DirectorySeparatorChar}agent.json"));
|
string data = File.ReadAllText(Path.Combine(AgentDir, "agent.json"));
|
||||||
var agent = JsonConvert.DeserializeObject<DialogflowAgent>(data);
|
var agent = JsonConvert.DeserializeObject<DialogflowAgent>(data);
|
||||||
agent.Name = agentHeader.Name;
|
agent.Name = agentHeader.Name;
|
||||||
agent.Id = agentHeader.Id;
|
agent.Id = agentHeader.Id;
|
||||||
|
|
@ -54,7 +59,7 @@ namespace BotSharp.Core.Engines
|
||||||
public void LoadCustomEntities(Agent agent)
|
public void LoadCustomEntities(Agent agent)
|
||||||
{
|
{
|
||||||
agent.Entities = new List<EntityType>();
|
agent.Entities = new List<EntityType>();
|
||||||
string entityDir = Path.Combine(AgentDir, "Dialogflow", $"{agent.Name}{Path.DirectorySeparatorChar}entities");
|
string entityDir = Path.Combine(AgentDir, "entities");
|
||||||
if (!Directory.Exists(entityDir)) return;
|
if (!Directory.Exists(entityDir)) return;
|
||||||
|
|
||||||
Directory.EnumerateFiles(entityDir)
|
Directory.EnumerateFiles(entityDir)
|
||||||
|
|
@ -89,7 +94,7 @@ namespace BotSharp.Core.Engines
|
||||||
public void LoadIntents(Agent agent)
|
public void LoadIntents(Agent agent)
|
||||||
{
|
{
|
||||||
agent.Intents = new List<Intent>();
|
agent.Intents = new List<Intent>();
|
||||||
string intentDir = Path.Combine(AgentDir, "Dialogflow", $"{agent.Name}{Path.DirectorySeparatorChar}intents");
|
string intentDir = Path.Combine(AgentDir, "intents");
|
||||||
if (!Directory.Exists(intentDir)) return;
|
if (!Directory.Exists(intentDir)) return;
|
||||||
|
|
||||||
Directory.EnumerateFiles(intentDir)
|
Directory.EnumerateFiles(intentDir)
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,10 @@ namespace BotSharp.Core.Engines.Rasa
|
||||||
{
|
{
|
||||||
public string AgentDir { get; set; }
|
public string AgentDir { get; set; }
|
||||||
|
|
||||||
public Agent LoadAgent(AgentImportHeader agentHeader)
|
public Agent LoadAgent()
|
||||||
{
|
{
|
||||||
|
AgentImportHeader agentHeader = null;
|
||||||
|
|
||||||
var agent = new Agent();
|
var agent = new Agent();
|
||||||
agent.ClientAccessToken = Guid.NewGuid().ToString("N");
|
agent.ClientAccessToken = Guid.NewGuid().ToString("N");
|
||||||
agent.DeveloperAccessToken = Guid.NewGuid().ToString("N");
|
agent.DeveloperAccessToken = Guid.NewGuid().ToString("N");
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,12 @@ namespace BotSharp.Core.Engines
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load agent meta
|
/// Load agent meta
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="agentName"></param>
|
|
||||||
/// <param name="agentDir"></param>
|
/// <param name="agentDir"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Agent LoadAgent(AgentImportHeader agentHeader)
|
public Agent LoadAgent()
|
||||||
{
|
{
|
||||||
|
AgentImportHeader agentHeader = null;
|
||||||
|
|
||||||
// load agent profile
|
// load agent profile
|
||||||
string data = File.ReadAllText(Path.Combine(AgentDir, "Sebis", $"{agentHeader.Name}{Path.DirectorySeparatorChar}agent.json"));
|
string data = File.ReadAllText(Path.Combine(AgentDir, "Sebis", $"{agentHeader.Name}{Path.DirectorySeparatorChar}agent.json"));
|
||||||
var agent = JsonConvert.DeserializeObject<SebisAgent>(data);
|
var agent = JsonConvert.DeserializeObject<SebisAgent>(data);
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,12 @@ namespace BotSharp.RestApi
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Restore a agent from a uploaded zip file
|
/// Restore a agent from a uploaded zip file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <param name="file"></param>
|
/// <param name="file"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<ActionResult> Restore(IFormFile file)
|
public async Task<ActionResult> Restore(IFormFile uploadedFile)
|
||||||
{
|
{
|
||||||
if (file == null || file.Length == 0)
|
if (uploadedFile == null || uploadedFile.Length == 0)
|
||||||
{
|
{
|
||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
|
@ -61,15 +60,17 @@ namespace BotSharp.RestApi
|
||||||
|
|
||||||
using (var stream = new FileStream(filePath, FileMode.Create))
|
using (var stream = new FileStream(filePath, FileMode.Create))
|
||||||
{
|
{
|
||||||
await file.CopyToAsync(stream);
|
await uploadedFile.CopyToAsync(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
string dest = Path.Combine(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Projects", "", DateTime.UtcNow.ToString("MMddyyyyHHmm"));
|
string dest = Path.Combine(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Projects", uploadedFile.FileName.Split('.').First(), "model_" + DateTime.UtcNow.ToString("MMddyyyyHHmm"));
|
||||||
ZipFile.ExtractToDirectory(filePath, dest);
|
ZipFile.ExtractToDirectory(filePath, dest);
|
||||||
|
|
||||||
_platform.LoadAgentFromFile<AgentImporterInDialogflow>("", new AgentImportHeader { });
|
System.IO.File.Delete(filePath);
|
||||||
|
|
||||||
return Ok();
|
var agent = _platform.LoadAgentFromFile<AgentImporterInDialogflow>(dest);
|
||||||
|
|
||||||
|
return Ok(agent.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using BotSharp.Core.Accounts;
|
using DotNetToolkit;
|
||||||
using DotNetToolkit;
|
|
||||||
using DotNetToolkit.JwtHelper;
|
using DotNetToolkit.JwtHelper;
|
||||||
using EntityFrameworkCore.BootKit;
|
using EntityFrameworkCore.BootKit;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,12 @@
|
||||||
<DefineConstants>TRACE;MODE_DIALOGFLOW;RELEASE;NETCOREAPP;NETCOREAPP2_1;RELEASE;NETCOREAPP;NETCOREAPP2_1</DefineConstants>
|
<DefineConstants>TRACE;MODE_DIALOGFLOW;RELEASE;NETCOREAPP;NETCOREAPP2_1;RELEASE;NETCOREAPP;NETCOREAPP2_1</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Authentication\**" />
|
||||||
|
<EmbeddedResource Remove="Authentication\**" />
|
||||||
|
<None Remove="Authentication\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,7 @@ namespace BotSharp.RestApi.Rasa
|
||||||
var projectPath = Path.Combine(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Projects", request.Project);
|
var projectPath = Path.Combine(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Projects", request.Project);
|
||||||
var modelPath = Path.Combine(projectPath, request.Model);
|
var modelPath = Path.Combine(projectPath, request.Model);
|
||||||
|
|
||||||
_platform.LoadAgentFromFile<AgentImporterInRasa>(modelPath,
|
_platform.LoadAgentFromFile<AgentImporterInRasa>(modelPath);
|
||||||
new AgentImportHeader
|
|
||||||
{
|
|
||||||
Id = request.Project,
|
|
||||||
Name = request.Project
|
|
||||||
});
|
|
||||||
|
|
||||||
var aIResponse = _platform.TextRequest(new AIRequest
|
var aIResponse = _platform.TextRequest(new AIRequest
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,7 @@ namespace BotSharp.RestApi.Rasa
|
||||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var agent = _platform.LoadAgentFromFile<AgentImporterInRasa>(modelPath,
|
var agent = _platform.LoadAgentFromFile<AgentImporterInRasa>(modelPath);
|
||||||
new AgentImportHeader
|
|
||||||
{
|
|
||||||
Id = request.Project,
|
|
||||||
Name = project
|
|
||||||
});
|
|
||||||
|
|
||||||
var info = await trainer.Train(agent, new BotTrainOptions { Model = request.Model });
|
var info = await trainer.Train(agent, new BotTrainOptions { Model = request.Model });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,21 +15,33 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Remove="App_Data\AgentArchive\**" />
|
||||||
|
<Compile Remove="App_Data\Corpus\**" />
|
||||||
|
<Compile Remove="App_Data\DbInitializer\**" />
|
||||||
<Compile Remove="App_Data\ModelFiles\**" />
|
<Compile Remove="App_Data\ModelFiles\**" />
|
||||||
<Compile Remove="App_Data\NewFolder\**" />
|
<Compile Remove="App_Data\NewFolder\**" />
|
||||||
<Compile Remove="App_Data\Projects\**" />
|
<Compile Remove="App_Data\Projects\**" />
|
||||||
<Compile Remove="App_Data\TrainingFiles\**" />
|
<Compile Remove="App_Data\TrainingFiles\**" />
|
||||||
<Compile Remove="PublishOutput\**" />
|
<Compile Remove="PublishOutput\**" />
|
||||||
|
<Content Remove="App_Data\AgentArchive\**" />
|
||||||
|
<Content Remove="App_Data\Corpus\**" />
|
||||||
|
<Content Remove="App_Data\DbInitializer\**" />
|
||||||
<Content Remove="App_Data\ModelFiles\**" />
|
<Content Remove="App_Data\ModelFiles\**" />
|
||||||
<Content Remove="App_Data\NewFolder\**" />
|
<Content Remove="App_Data\NewFolder\**" />
|
||||||
<Content Remove="App_Data\Projects\**" />
|
<Content Remove="App_Data\Projects\**" />
|
||||||
<Content Remove="App_Data\TrainingFiles\**" />
|
<Content Remove="App_Data\TrainingFiles\**" />
|
||||||
<Content Remove="PublishOutput\**" />
|
<Content Remove="PublishOutput\**" />
|
||||||
|
<EmbeddedResource Remove="App_Data\AgentArchive\**" />
|
||||||
|
<EmbeddedResource Remove="App_Data\Corpus\**" />
|
||||||
|
<EmbeddedResource Remove="App_Data\DbInitializer\**" />
|
||||||
<EmbeddedResource Remove="App_Data\ModelFiles\**" />
|
<EmbeddedResource Remove="App_Data\ModelFiles\**" />
|
||||||
<EmbeddedResource Remove="App_Data\NewFolder\**" />
|
<EmbeddedResource Remove="App_Data\NewFolder\**" />
|
||||||
<EmbeddedResource Remove="App_Data\Projects\**" />
|
<EmbeddedResource Remove="App_Data\Projects\**" />
|
||||||
<EmbeddedResource Remove="App_Data\TrainingFiles\**" />
|
<EmbeddedResource Remove="App_Data\TrainingFiles\**" />
|
||||||
<EmbeddedResource Remove="PublishOutput\**" />
|
<EmbeddedResource Remove="PublishOutput\**" />
|
||||||
|
<None Remove="App_Data\AgentArchive\**" />
|
||||||
|
<None Remove="App_Data\Corpus\**" />
|
||||||
|
<None Remove="App_Data\DbInitializer\**" />
|
||||||
<None Remove="App_Data\ModelFiles\**" />
|
<None Remove="App_Data\ModelFiles\**" />
|
||||||
<None Remove="App_Data\NewFolder\**" />
|
<None Remove="App_Data\NewFolder\**" />
|
||||||
<None Remove="App_Data\Projects\**" />
|
<None Remove="App_Data\Projects\**" />
|
||||||
|
|
@ -37,44 +49,6 @@
|
||||||
<None Remove="PublishOutput\**" />
|
<None Remove="PublishOutput\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\agents.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\agent.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-album.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-album_entries_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-service.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-service_entries_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-sort.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-sort_entries_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\playlist.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\playlist_entries_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\song.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\song_entries_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music.play.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music.play_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_favorite.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_favorite_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_playlist.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_playlist_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.pause.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.pause_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.play.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.play_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.repeat.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.repeat_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.resume.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.resume_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.shuffle.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.shuffle_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_backward.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_backward_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_forward.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_forward_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.stop.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.stop_usersays_en.json" />
|
|
||||||
<Content Remove="App_Data\DbInitializer\Agents\Dialogflow\Spotify\package.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="App_Data\BotSharp.db" />
|
<None Remove="App_Data\BotSharp.db" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
@ -88,44 +62,6 @@
|
||||||
<ProjectReference Include="..\BotSharp.RestApi\BotSharp.RestApi.csproj" />
|
<ProjectReference Include="..\BotSharp.RestApi\BotSharp.RestApi.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\agents.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\agent.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-album.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-album_entries_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-service.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-service_entries_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-sort.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\music-sort_entries_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\playlist.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\playlist_entries_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\song.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\entities\song_entries_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music.play.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music.play_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_favorite.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_favorite_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_playlist.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.add_playlist_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.pause.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.pause_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.play.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.play_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.repeat.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.repeat_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.resume.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.resume_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.shuffle.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.shuffle_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_backward.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_backward_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_forward.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.skip_forward_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.stop.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\intents\music_player_control.stop_usersays_en.json" />
|
|
||||||
<None Include="App_Data\DbInitializer\Agents\Dialogflow\Spotify\package.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.3" />
|
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2" />
|
||||||
|
|
@ -136,4 +72,8 @@
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="3.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="App_Data\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
language: "zh"
|
|
||||||
|
|
||||||
pipeline:
|
|
||||||
- name: "nlp_mitie"
|
|
||||||
model: "data/total_word_feature_extractor_zh.dat"
|
|
||||||
- name: "tokenizer_jieba"
|
|
||||||
- name: "ner_mitie"
|
|
||||||
- name: "ner_synonyms"
|
|
||||||
- name: "intent_entity_featurizer_regex"
|
|
||||||
- name: "intent_featurizer_mitie"
|
|
||||||
- name: "intent_classifier_sklearn"
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
language: "en"
|
|
||||||
|
|
||||||
pipeline:
|
|
||||||
- name: "nlp_mitie"
|
|
||||||
model: "data/total_word_feature_extractor.dat"
|
|
||||||
- name: "tokenizer_mitie"
|
|
||||||
- name: "ner_mitie"
|
|
||||||
- name: "ner_synonyms"
|
|
||||||
- name: "intent_entity_featurizer_regex"
|
|
||||||
- name: "intent_featurizer_mitie"
|
|
||||||
- name: "intent_classifier_sklearn"
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
language: "en"
|
|
||||||
|
|
||||||
pipeline: "spacy_sklearn"
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace BotSharp.WebHost
|
||||||
{
|
{
|
||||||
public void Apply(Operation operation, OperationFilterContext context)
|
public void Apply(Operation operation, OperationFilterContext context)
|
||||||
{
|
{
|
||||||
if (operation.OperationId == "V1AgentRestoreByNamePost")
|
if (operation.OperationId == "V1AgentRestorePost")
|
||||||
{
|
{
|
||||||
operation.Parameters.Clear();
|
operation.Parameters.Clear();
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace BotSharp.WebHost
|
||||||
{
|
{
|
||||||
Name = "uploadedFile",
|
Name = "uploadedFile",
|
||||||
In = "formData",
|
In = "formData",
|
||||||
Description = "Upload Zip File",
|
Description = "Upload Zip File, meta.json is the extra data for customized function.",
|
||||||
Required = true,
|
Required = true,
|
||||||
Type = "file"
|
Type = "file"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue