BotSharp/src/Plugins/BotSharp.Plugin.GoogleAI/Providers/ProviderHelper.cs

22 lines
625 B
C#
Raw Normal View History

2024-12-23 02:12:35 +00:00
using LLMSharp.Google.Palm;
using Mscc.GenerativeAI;
namespace BotSharp.Plugin.GoogleAi.Providers;
public static class ProviderHelper
{
public static GoogleAI GetGeminiClient(IServiceProvider services)
{
var settings = services.GetRequiredService<GoogleAiSettings>();
var client = new GoogleAI(settings.Gemini.ApiKey);
return client;
}
public static GooglePalmClient GetPalmClient(IServiceProvider services)
{
var settings = services.GetRequiredService<GoogleAiSettings>();
var client = new GooglePalmClient(settings.PaLM.ApiKey);
return client;
}
}