2018-10-29 02:16:55 +00:00
|
|
|
|
using BotSharp.Core;
|
|
|
|
|
|
using BotSharp.Core.AgentStorage;
|
2018-12-07 22:57:26 +00:00
|
|
|
|
using BotSharp.Core.ContextStorage;
|
2018-10-29 02:16:55 +00:00
|
|
|
|
using BotSharp.Core.Modules;
|
2019-03-17 00:55:55 +00:00
|
|
|
|
using BotSharp.Platform.Abstractions;
|
2018-10-29 02:16:55 +00:00
|
|
|
|
using BotSharp.Platform.Dialogflow.Models;
|
|
|
|
|
|
using BotSharp.Platform.Models;
|
2018-12-09 15:57:34 +00:00
|
|
|
|
using BotSharp.Platform.Models.Contexts;
|
2018-10-29 02:16:55 +00:00
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Platform.Dialogflow
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ModuleInjector : IModule
|
|
|
|
|
|
{
|
|
|
|
|
|
public void ConfigureServices(IServiceCollection services, IConfiguration config)
|
|
|
|
|
|
{
|
|
|
|
|
|
services.AddSingleton<IPlatformBuilder<AgentModel>, DialogflowAi<AgentModel>>();
|
|
|
|
|
|
services.AddSingleton<DialogflowAi<AgentModel>>();
|
|
|
|
|
|
AgentStorageServiceRegister.Register<AgentModel>(services);
|
|
|
|
|
|
PlatformConfigServiceRegister.Register<PlatformSettings>("dialogflowAi", services, config);
|
2018-12-07 22:57:26 +00:00
|
|
|
|
ContextStorageServiceRegister.Register<AIContext>(services);
|
2018-10-29 02:16:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|