Files
ChatBot/ChatBot/Services/ModelService.cs
Leonid Pershin b4f8df6816 clear
2025-10-16 07:43:03 +03:00

38 lines
969 B
C#

using ChatBot.Models.Configuration;
using Microsoft.Extensions.Options;
namespace ChatBot.Services
{
/// <summary>
/// Service for managing AI model
/// </summary>
public class ModelService
{
private readonly ILogger<ModelService> _logger;
private readonly string _currentModel;
public ModelService(ILogger<ModelService> logger, IOptions<OllamaSettings> ollamaSettings)
{
_logger = logger;
_currentModel = ollamaSettings.Value.DefaultModel;
}
/// <summary>
/// Initialize the service
/// </summary>
public Task InitializeAsync()
{
_logger.LogInformation("Using model: {Model}", _currentModel);
return Task.CompletedTask;
}
/// <summary>
/// Get the current model name
/// </summary>
public string GetCurrentModel()
{
return _currentModel;
}
}
}