From 44b1cdf002c175dd366f34087015344297aa99c0 Mon Sep 17 00:00:00 2001 From: octo-patch <266937838+octo-patch@users.noreply.github.com> Date: Mon, 7 Dec 2026 05:12:42 +0800 Subject: [PATCH] feat: add a MiniMax custom provider preset --- morphcode/internal/model/custom_provider.go | 8 ++++++ .../internal/model/custom_provider_test.go | 25 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 morphcode/internal/model/custom_provider_test.go diff --git a/morphcode/internal/model/custom_provider.go b/morphcode/internal/model/custom_provider.go index 7c24053e..0a9bac06 100644 --- a/morphcode/internal/model/custom_provider.go +++ b/morphcode/internal/model/custom_provider.go @@ -100,6 +100,14 @@ func BuiltinCustomProviderPresets() []ProviderPreset { {ID: "kimi-k2-0905-preview", Name: "Kimi K2", ContextWindow: 256_000}, }, }, + { + ID: "minimax", Name: "MiniMax", Protocol: ProtocolOpenAIChat, + BaseURL: "https://api.minimax.io/v1", RequiresKey: true, + DefaultModels: []CustomModelSpec{ + {ID: "MiniMax-M3.1-Flash", Name: "MiniMax-M3.1-Flash", ContextWindow: 1_000_000}, + {ID: "MiniMax-M3", Name: "MiniMax-M3", ContextWindow: 1_000_000}, + }, + }, { ID: "ollama", Name: "Ollama (로컬)", Protocol: ProtocolOpenAIChat, BaseURL: "http://127.0.0.1:11434/v1", RequiresKey: false, diff --git a/morphcode/internal/model/custom_provider_test.go b/morphcode/internal/model/custom_provider_test.go new file mode 100644 index 00000000..976ae606 --- /dev/null +++ b/morphcode/internal/model/custom_provider_test.go @@ -0,0 +1,25 @@ +package model + +import ( + "slices" + "testing" +) + +func TestMiniMaxPreset(t *testing.T) { + presets := BuiltinCustomProviderPresets() + idx := slices.IndexFunc(presets, func(p ProviderPreset) bool { return p.ID == "minimax" }) + if idx == -1 { + t.Fatal("MiniMax preset is missing") + } + preset := presets[idx] + if preset.Name != "MiniMax" || preset.BaseURL != "https://api.minimax.io/v1" || preset.Protocol != ProtocolOpenAIChat || !preset.RequiresKey { + t.Fatalf("unexpected MiniMax configuration: %+v", preset) + } + want := []CustomModelSpec{ + {ID: "MiniMax-M3.1-Flash", Name: "MiniMax-M3.1-Flash", ContextWindow: 1_000_000}, + {ID: "MiniMax-M3", Name: "MiniMax-M3", ContextWindow: 1_000_000}, + } + if !slices.Equal(preset.DefaultModels, want) { + t.Fatalf("unexpected default models: %+v", preset.DefaultModels) + } +}