forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIPlatformBuilder.cs
52 lines (45 loc) · 1.66 KB
/
IPlatformBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using BotSharp.Platform.Models;
using BotSharp.Platform.Models.AiRequest;
using BotSharp.Platform.Models.AiResponse;
using BotSharp.Platform.Models.MachineLearning;
using System.Threading.Tasks;
namespace BotSharp.Platform.Abstraction
{
/// <summary>
/// Platform abstraction
/// Implement this interface to build a Chatbot platform
/// </summary>
public interface IPlatformBuilder<TAgent>
{
/// <summary>
/// Agent storage
/// </summary>
IAgentStorage<TAgent> Storage { get; set; }
/// <summary>
/// Parse options for the incoming text or voice request from the sender.
/// </summary>
// DialogRequestOptions RequestOptions { get; set; }
/// <summary>
/// Convert platform specific data to standard training corpus format
/// </summary>
/// <param name="agent"></param>
/// <returns></returns>
Task<TrainingCorpus> ExtractorCorpus(TAgent agent);
/// <summary>
/// Load agent from files.
/// There must contain a meta.json
/// </summary>
/// <param name="dataDir"></param>
/// <returns></returns>
Task<TAgent> LoadAgentFromFile<TImporter>(string dataDir) where TImporter : IAgentImporter<TAgent>, new();
/// <summary>
///
/// </summary>
/// <typeparam name="TStorage"></typeparam>
/// <param name="agent"></param>
/// <returns></returns>
Task<bool> SaveAgent(TAgent agent);
Task<ModelMetaData> Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options);
Task<AiResponse> TextRequest(AiRequest request);
}
}