Ollama2 aktiviert

This commit is contained in:
2025-12-02 17:13:49 +01:00
parent 44b6125fe3
commit 20c8798cdf
5 changed files with 26 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ using System.Text.Json;
using BS.Shared.Interface;
using BeWo.ServerUtils.ApiFacade;
using BS.Shared.Logger;
using BS.Shared;
namespace AICore.Facade.LLM
{

View File

@@ -15,9 +15,14 @@ namespace AICore.Facade.LLM
{
public class OllamaApiClient : BaseLLMApiClient
{
public OllamaApiClient(string base_url, string api_key) : base(base_url, api_key)
{
private AiModelSource _aiModelSource;
public OllamaApiClient(string base_url, string api_key, AiModelSource modelSource = AiModelSource.ollama) : base(base_url, api_key)
{
_aiModelSource = modelSource;
if (modelSource != AiModelSource.ollama && modelSource != AiModelSource.ollama2)
throw new NotImplementedException("err4548975");
}
public override ApiResponse<IEnumerable<AiModelDC>> GetAiModelle()
@@ -48,7 +53,7 @@ namespace AICore.Facade.LLM
throw new NotImplementedException();
}
var data = response.Data.models.Select(x => new AiModelDC(BS.Shared.AiModelSource.ollama, x.name, x.details.max_context_size));
var data = response.Data.models.Select(x => new AiModelDC(_aiModelSource, x.name, x.details.max_context_size));
return ApiResponse<IEnumerable<AiModelDC>>.SuccessResponse(data);
}

View File

@@ -48,7 +48,7 @@ namespace AICore.Facade.LLM
throw new NotImplementedException();
}
var data = response.Data.data.Select(x => new AiModelDC(BS.Shared.AiModelSource.openwebui, x.name, x.details?.max_context_size ?? -2));
var data = response.Data.data.Select(x => new AiModelDC(AiModelSource.openwebui, x.name, x.details?.max_context_size ?? -2));
return ApiResponse<IEnumerable<AiModelDC>>.SuccessResponse(data);
}