BotSharp/Platform.Articulate/Controllers/TrainController.cs

35 lines
791 B
C#
Raw Normal View History

2018-10-01 01:27:57 +00:00
using BotSharp.Core;
using Microsoft.AspNetCore.Mvc;
using Platform.Articulate.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace Platform.Articulate.Controllers
{
#if ARTICULATE
[Route("[controller]")]
public class TrainController : ControllerBase
{
private ArticulateAi<AgentStorageInRedis<AgentModel>, AgentModel> builder;
public TrainController()
{
builder = new ArticulateAi<AgentStorageInRedis<AgentModel>, AgentModel>();
}
[HttpGet("/agent/{agentId}/train")]
public AgentModel TrainAgent([FromRoute] string agentId)
{
var agent = builder.GetAgentById(agentId);
agent.Status = "Ready";
2018-10-01 01:27:57 +00:00
return agent;
}
}
#endif
}