mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
feat(models): add image model type support
Add a dedicated image model type so bots can use image API models without overloading chat model capabilities, while keeping existing chat-based image generation selectable.
This commit is contained in:
@@ -332,12 +332,20 @@ func (h *ProvidersHandler) ImportModels(c echo.Context) error {
|
||||
|
||||
for _, m := range remoteModels {
|
||||
modelType := models.ModelTypeChat
|
||||
if strings.TrimSpace(m.Type) == string(models.ModelTypeEmbedding) {
|
||||
switch strings.TrimSpace(m.Type) {
|
||||
case string(models.ModelTypeEmbedding):
|
||||
modelType = models.ModelTypeEmbedding
|
||||
case string(models.ModelTypeImage):
|
||||
modelType = models.ModelTypeImage
|
||||
}
|
||||
compatibilities := m.Compatibilities
|
||||
if len(compatibilities) == 0 {
|
||||
compatibilities = []string{models.CompatVision, models.CompatToolCall, models.CompatReasoning}
|
||||
switch modelType {
|
||||
case models.ModelTypeImage:
|
||||
compatibilities = []string{models.CompatGenerate, models.CompatEdit}
|
||||
case models.ModelTypeChat:
|
||||
compatibilities = []string{models.CompatVision, models.CompatToolCall, models.CompatReasoning}
|
||||
}
|
||||
}
|
||||
name := strings.TrimSpace(m.Name)
|
||||
if name == "" {
|
||||
|
||||
Reference in New Issue
Block a user