Skip to content

Commit d3d45a3

Browse files
committed
Ollama doesn't support image generation
Deleted the OllamaImageGenerations constant from ServiceConstants as it is no longer used. Also, set the Ollama backend to null in ImageGenServiceFactory and cleaned up unused usings in ImageGenService.cs.
1 parent 384758f commit d3d45a3

3 files changed

Lines changed: 1 addition & 5 deletions

File tree

src/MaIN.Services/Constants/ServiceConstants.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static class ApiUrls
4343
public const string XaiOpenAiChatCompletions = "https://api.x.ai/v1/chat/completions";
4444
public const string XaiModels = "https://api.x.ai/v1/models";
4545

46-
public const string OllamaImageGenerations = "https://ollama.com/v1/images/generations";
4746
public const string OllamaOpenAiChatCompletions = "https://ollama.com/v1/chat/completions";
4847
public const string OllamaModels = "https://ollama.com/v1/models";
4948
}

src/MaIN.Services/Services/ImageGenServices/ImageGenService.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using System.Linq;
3-
using System.Net.Http;
4-
using System.Threading.Tasks;
51
using MaIN.Domain.Configuration;
62
using MaIN.Domain.Entities;
73
using MaIN.Services.Constants;

src/MaIN.Services/Services/LLMService/Factory/ImageGenServiceFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ImageGenServiceFactory(IServiceProvider serviceProvider) : IImageGe
2020
BackendType.Anthropic => null,
2121
BackendType.Xai => new XaiImageGenService(serviceProvider.GetRequiredService<IHttpClientFactory>(),
2222
serviceProvider.GetRequiredService<MaINSettings>()),
23+
BackendType.Ollama => null,
2324
BackendType.Self => new ImageGenService(serviceProvider.GetRequiredService<IHttpClientFactory>(),
2425
serviceProvider.GetRequiredService<MaINSettings>()),
2526

0 commit comments

Comments
 (0)