2018-07-12 15:07:05 +00:00
|
|
|
|
using BotSharp.Core.Models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Core.Engines.Dialogflow
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ApiAi : ApiAiBase, IBotPlatform
|
|
|
|
|
|
{
|
2018-07-19 03:31:17 +00:00
|
|
|
|
private AIDataService dataService;
|
2018-07-12 15:07:05 +00:00
|
|
|
|
|
|
|
|
|
|
public AIResponse TextRequest(AIRequest request)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (request == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException("request");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-07-19 03:31:17 +00:00
|
|
|
|
if(dataService == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
dataService = new AIDataService(AiConfig);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-07-12 15:07:05 +00:00
|
|
|
|
return dataService.Request(request);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-07-19 03:31:17 +00:00
|
|
|
|
public void Train()
|
2018-07-12 15:07:05 +00:00
|
|
|
|
{
|
2018-07-28 17:56:15 +00:00
|
|
|
|
|
2018-07-12 15:07:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|