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 { /// /// Platform abstraction /// Implement this interface to build a Chatbot platform /// public interface IPlatformBuilder { TAgent Agent { get; set; } /// /// Agent storage /// IAgentStorage Storage { get; set; } /// /// Parse options for the incoming text or voice request from the sender. /// // DialogRequestOptions RequestOptions { get; set; } /// /// Convert platform specific data to standard training corpus format /// /// /// Task ExtractorCorpus(TAgent agent); /// /// Load agent from files. /// There must contain a meta.json /// /// /// Task LoadAgentFromFile(string dataDir) where TImporter : IAgentImporter, new(); /// /// /// /// /// /// Task SaveAgent(TAgent agent); Task Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options); Task TextRequest(AiRequest request); Task AssembleResult(AiRequest request, AiResponse response); Task FallbackResponse(AiRequest request); } }