Ollama2 aktiviert
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user