This commit is contained in:
@@ -17,13 +17,13 @@ public class OllamaMessage
|
||||
public static class OllamaService
|
||||
{
|
||||
private static readonly HttpClient _httpClient = new() { Timeout = TimeSpan.FromMinutes(5) };
|
||||
private const string BaseUrl = "http://localhost:11434/api";
|
||||
private static string BaseUrl => SettingsManager.Current.OllamaBaseUrl;
|
||||
|
||||
public static async IAsyncEnumerable<string> SendChatStreamAsync(string model, List<OllamaMessage> messages, string? toolsJson = null)
|
||||
{
|
||||
var requestBody = new Dictionary<string, object>
|
||||
{
|
||||
{ "model", model },
|
||||
{ "model", string.IsNullOrEmpty(model) ? SettingsManager.Current.OllamaModel : model },
|
||||
{ "messages", messages },
|
||||
{ "stream", true } // ВКЛЮЧАЕМ СТРИМИНГ
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user