linter
This commit is contained in:
parent
e929a46bee
commit
5870bd434c
|
|
@ -14,11 +14,10 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace BotSharp.Plugin.VertexAI.Providers
|
||||
{
|
||||
public class ChatCompletionProvider(
|
||||
VertexAIConfiguration config,
|
||||
ChatSettings settings,
|
||||
ILogger<TextCompletionProvider> logger,
|
||||
IServiceProvider services) : IChatCompletion
|
||||
public class ChatCompletionProvider(VertexAIConfiguration config,
|
||||
ChatSettings settings,
|
||||
ILogger<TextCompletionProvider> logger,
|
||||
IServiceProvider services) : IChatCompletion
|
||||
{
|
||||
public string Provider => "vertexai";
|
||||
private readonly VertexAIConfiguration _config = config;
|
||||
|
|
|
|||
|
|
@ -13,11 +13,10 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace BotSharp.Plugin.VertexAI.Providers
|
||||
{
|
||||
public class TextCompletionProvider(
|
||||
VertexAIConfiguration config,
|
||||
ChatSettings settings,
|
||||
ILogger<TextCompletionProvider> logger,
|
||||
IServiceProvider services) : ITextCompletion
|
||||
public class TextCompletionProvider(VertexAIConfiguration config,
|
||||
ChatSettings settings,
|
||||
ILogger<TextCompletionProvider> logger,
|
||||
IServiceProvider services) : ITextCompletion
|
||||
{
|
||||
public string Provider => "vertexai";
|
||||
private readonly VertexAIConfiguration _config = config;
|
||||
|
|
|
|||
|
|
@ -5,26 +5,24 @@ using BotSharp.Plugin.VertexAI.Providers;
|
|||
using LangChain.Providers.Google.VertexAI;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
|
||||
namespace BotSharp.Plugin.VertexAI
|
||||
namespace BotSharp.Plugin.VertexAI;
|
||||
|
||||
public class VertexAiPlugin : IBotSharpPlugin
|
||||
{
|
||||
public class VertexAiPlugin : IBotSharpPlugin
|
||||
{
|
||||
public string Id => "962ff441-2b40-4db4-b530-49efb1688a75";
|
||||
public string Name => "VertexAI";
|
||||
public string Description => "VertexAI Service including text generation, text to image and other AI services.";
|
||||
public string IconUrl => "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Vertex_AI_Logo.svg/480px-Vertex_AI_Logo.svg.png";
|
||||
public string Id => "962ff441-2b40-4db4-b530-49efb1688a75";
|
||||
public string Name => "VertexAI";
|
||||
public string Description => "VertexAI Service including text generation, text to image and other AI services.";
|
||||
public string IconUrl => "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Vertex_AI_Logo.svg/480px-Vertex_AI_Logo.svg.png";
|
||||
|
||||
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
||||
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
||||
{
|
||||
services.AddScoped(provider =>
|
||||
{
|
||||
services.AddScoped(provider =>
|
||||
{
|
||||
var settingService = provider.GetRequiredService<ISettingService>();
|
||||
return settingService.Bind<VertexAIConfiguration>("VertexAI");
|
||||
});
|
||||
services.AddScoped<IChatCompletion, ChatCompletionProvider>();
|
||||
services.AddScoped<ITextCompletion, TextCompletionProvider>();
|
||||
}
|
||||
var settingService = provider.GetRequiredService<ISettingService>();
|
||||
return settingService.Bind<VertexAIConfiguration>("VertexAI");
|
||||
});
|
||||
services.AddScoped<IChatCompletion, ChatCompletionProvider>();
|
||||
services.AddScoped<ITextCompletion, TextCompletionProvider>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue