csharp4405de34 | 1 | namespace CascadeIDE.Services; |
| 2 | |
| 3 | public interface IOllamaService |
| 4 | { |
| 5 | Task<bool> IsAvailableAsync(CancellationToken cancellationToken = default); |
| 6 | Task<IReadOnlyList<string>> GetModelNamesAsync(CancellationToken cancellationToken = default); |
| 7 | /// <summary>Детали модели из API: возможности, размер параметров, контекст, лицензия.</summary> |
| 8 | Task<Models.OllamaModelDetails?> GetModelDetailsAsync(string modelName, CancellationToken cancellationToken = default); |
| 9 | IAsyncEnumerable<string> StreamChatAsync(string model, IReadOnlyList<ChatMessage> messages, CancellationToken cancellationToken = default); |
| 10 | /// <summary>Скачивает модель через Ollama API (POST /api/pull), стримит статусы.</summary> |
| 11 | IAsyncEnumerable<string> PullModelAsync(string modelName, CancellationToken cancellationToken = default); |
| 12 | } |
| 13 | |
| 14 | public sealed record ChatMessage(string Role, string Content); |
| 15 | |
View only · write via MCP/CIDE