Files
BeWoPlaner/Service/ServiceProxy/ServiceFacade.cs

59 lines
1.9 KiB
C#
Raw Normal View History

2025-03-19 16:30:27 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AICore.Facade.LLM;
using BeWo.Service.Core;
2025-12-02 16:58:43 +01:00
using BS.Shared;
2026-03-09 12:40:29 +01:00
using BS.Shared.Core;
2025-03-19 16:30:27 +01:00
namespace BeWo.Service.ServiceProxy
{
public static class ServiceFacade
{
//private static readonly Lazy<OpenWebApiClient> _OpenWebApiClient = new Lazy<OpenWebApiClient>(()
// => new OpenWebApiClient(
// MergedConfig.GetSetting(WebConfigSetting.OpenWebUIUrl),
// MergedConfig.GetSecretSetting(WebSecretConfigSetting.OpenWebUIKey)));
2025-12-02 17:13:49 +01:00
Merge branch 'master' into feature_rene_18_ai - kein kommentar... # Conflicts: # BeWo/BeWo.csproj # BeWo/BeWoApp.xaml.cs # BeWo/ServiceProxy/GeneratedAiEnhancedService.cs # BeWo/Services/BeWoControlFactory.cs # BeWo/Services/BeWoWindowFactory.cs # BeWo/Services/BeWoWindowService.cs # BeWo/Services/IControlFactory.cs # BeWo/Services/IWindowFactory.cs # BeWo/Services/IWindowService.cs # BeWo/View/BeWoFileView.xaml # BeWo/View/Detail/Report/AbwesenheitsView.xaml # BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs # BeWo/app.config # BeWoAllReports.sln # BeWoPlanerMobil.sln # BeWoPlanerMobil/.vs/BeWoPlanerMobil.csproj.dtbcache.json # BeWoTests.sln # Dakota/DakotaUtils.cs # Dakota/Logic/DakotaInfoCreator.cs # Dakota/Models/DakotaFile.cs # Data/Access/GenericDAO.cs # Data/Access/SearchDAO.cs # Data/Data.csproj # Host/Web.config # Server/Components/ServerUtils/ApiFacade/WebClientFacade.cs # Service/BeWoServiceEnums.cs # Service/Core/ServiceHelper.cs # Service/Core/ServiceValidator.cs # Service/Extensions/ServiceEnumExtension.cs # Service/Service.csproj # Service/ServiceContracts/Enhanced/IAiEnhancedService.cs # Service/ServiceContracts/Enhanced/IOperationsEnhancedService.cs # Service/ServiceImplementations/EmployeeServiceImp.cs # Service/ServiceImplementations/Enhanced/AiEnhancedServiceImp.cs # Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs # Service/ServiceProxy/OpenWebUIFacade.cs # Service/ServiceProxy/ServiceFacade.cs # Service/ServiceUtils/DistanceCalculator/GoogleDistanceMatrixAPI.cs # Shared/BeWoEntityEnums.cs # Shared/Core/AppError.cs # Shared/Core/Facade/WebClientFacade.cs # Shared/Core/WebClientFacade.cs # Shared/Shared.csproj
2025-11-28 12:07:35 +01:00
private static readonly Lazy<OllamaApiClient> _OllamaApiClient = new Lazy<OllamaApiClient>(()
2025-12-02 17:13:49 +01:00
=> new OllamaApiClient(
MergedConfig.GetSetting(WebConfigSetting.OllamaUrl),
MergedConfig.GetSecretSetting(WebSecretConfigSetting.OllamaKey)));
2025-12-02 16:58:43 +01:00
private static readonly Lazy<OllamaApiClient> _Ollama2ApiClient = new Lazy<OllamaApiClient>(()
2025-12-02 17:13:49 +01:00
=> new OllamaApiClient(
MergedConfig.GetSetting(WebConfigSetting.Ollama2Url),
2026-03-09 12:40:29 +01:00
MergedConfig.GetSecretSetting(WebSecretConfigSetting.Ollama2Key),
2025-12-02 17:13:49 +01:00
AiModelSource.ollama2));
private static readonly Lazy<XRechnungApiClient> _XRechnungFacade = new Lazy<XRechnungApiClient>(()
=> new XRechnungApiClient());
2025-03-19 16:30:27 +01:00
public static OllamaApiClient OllamaApiClient => _OllamaApiClient.Value;
2025-12-02 16:58:43 +01:00
public static OllamaApiClient Ollama2ApiClient => _Ollama2ApiClient.Value;
public static XRechnungApiClient XRechnung => _XRechnungFacade.Value;
2025-12-02 16:58:43 +01:00
public static BaseLLMApiClient GetLLMApiClientByConfig(AiModelSource aiModelSource)
{
switch (aiModelSource)
{
case AiModelSource.openwebui:
2026-03-09 13:51:33 +01:00
throw new NotImplementedException();
2025-12-02 16:58:43 +01:00
case AiModelSource.ollama:
return OllamaApiClient;
case AiModelSource.ollama2:
return Ollama2ApiClient;
}
throw new NotImplementedException("err653463");
}
public static BaseLLMApiClient[] GetActiveApiClients()
{
return new BaseLLMApiClient[] { OllamaApiClient, Ollama2ApiClient };
}
2025-03-19 16:30:27 +01:00
}
}