XYenon on Discord (10-29):10c85e1femarked glm-5.3-flash, deepseek-v4.1-flash and deepseek-v4.1-flash-economy text-only and left kimi-k3 unmarked, so their images were described by another model instead of sent to them.10c85e1fetook arkPlanImages from the plans' /api/coding/v3/models input_modalities, which #1216 (XYenon) showed isn't the plans' list. Nothing read it at run time; the values were copied into presets.go. arkPlanImages now follows Ark's plan docs (Coding Plan 套餐概览 docs/82379/1925114 and Agent Plan 2366394, read 10-29): - glm-5.3-flash "为原生多模态模型,支持图片输入", deepseek-v4.1-flash "原生具备多模态视觉理解能力", -economy "支持多模态输入": now true (were false). - kimi-k3 "原生支持视觉理解", kimi-k2.8-preview "支持文本和图片输入", minimax-m3 "支持多模态视觉理解" (Coding Plan page): now true (were left to models.dev). - The Doubao Seed models and kimi-k3.1-pro: the docs don't say either way; they keep true from10c85e1fe(tongzhenbao's fix). - deepseek-v4-flash and -pro stay false (DeepSeek's text-only V4; the docs give them no image input). ark-code-latest and glm-5.3 are left to models.dev as before. Volcengine only: the map is read only by the two Ark plan regions. Tests: - TestArkPlanModelsSeeAsTheDocsSay (new): the six models the docs call image-taking are marked so by planModels. - TestArkPlanModelThatSeesIsSentTheImage: glm-5.3-flash now gets the image itself; the text-only one described is deepseek-v4-pro. Broken by hand: with presets.go at origin/main (10c85e1fe's map), both are red: the new test names all six models, and glm-5.3-flash was sent the describer's text. Run on mote at this tree (base172e65c80): gofmt -l clean; go vet ./internal/provider ./internal/gateway on darwin, linux (-tags nogui) and windows ok; go test -count=1 -timeout 45m ./internal/provider ./internal/gateway ./internal/catalog: all ok (provider 98.6s, gateway 524.7s, catalog 0.7s). Rebased ontod9431dd2e(ZCode mover min, GUI files): go test -count=1 ./internal/provider ok again there (96.4s). Not tried: a real image request to a Coding or Agent Plan model (no Volcengine account here).
47 lines
2.3 KiB
Go
47 lines
2.3 KiB
Go
package gateway
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/yetone/magpie/internal/provider"
|
|
)
|
|
|
|
// tongzhenbao on X: an image to Volcengine Ark's Coding Plan took 100+s to
|
|
// the first token. The plan's /models lists none of its models, and
|
|
// models.dev's resellers disagree on doubao-seed-2.1-pro, so magpie took
|
|
// it for text-only and had another model describe every image before Ark
|
|
// was asked. Ark's own list says it sees: its image goes to it as sent, and
|
|
// the describer isn't asked. A plan model that is text-only
|
|
// (deepseek-v4-pro) still has its image described.
|
|
func TestArkPlanModelThatSeesIsSentTheImage(t *testing.T) {
|
|
s, u := eyed(t)
|
|
up := strings.TrimSuffix(mustFind(t, "probe").Chat, "/v1")
|
|
if err := provider.Save(provider.Provider{ID: "volcengine", Name: "Volcengine Ark", Preset: "volcengine", Chat: up + "/api/coding/v3", Key: "ark-k",
|
|
Models: []string{"doubao-seed-2.1-pro", "glm-5.3-flash", "deepseek-v4-pro"}}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, model := range []string{"doubao-seed-2.1-pro", "glm-5.3-flash", "deepseek-v4-pro"} {
|
|
body := `{"model":"volcengine/` + model + `","input":[{"role":"user","content":[{"type":"input_text","text":"read"},{"type":"input_image","image_url":"data:image/png;base64,aGVsbG8="}]}]}`
|
|
rec := httptest.NewRecorder()
|
|
s.Handler().ServeHTTP(rec, httptest.NewRequest("POST", "/v1/responses", strings.NewReader(body)))
|
|
if rec.Code != 200 {
|
|
t.Fatalf("%s: %d %s", model, rec.Code, rec.Body.String())
|
|
}
|
|
}
|
|
if got := u.sent("doubao-seed-2.1-pro"); len(got) != 1 || !strings.Contains(got[0], "aGVsbG8=") || strings.Contains(got[0], "HELLO") {
|
|
t.Fatalf("doubao-seed-2.1-pro, which Ark says sees, was sent %v", got)
|
|
}
|
|
// XYenon: the plan docs say glm-5.3-flash takes images.
|
|
if got := u.sent("glm-5.3-flash"); len(got) != 1 || !strings.Contains(got[0], "aGVsbG8=") || strings.Contains(got[0], "HELLO") {
|
|
t.Fatalf("glm-5.3-flash, which Ark's docs say sees, was sent %v", got)
|
|
}
|
|
if got := u.sent("deepseek-v4-pro"); len(got) != 1 || strings.Contains(got[0], "aGVsbG8=") || !strings.Contains(got[0], "HELLO") {
|
|
t.Fatalf("deepseek-v4-pro, which is text-only, was sent %v", got)
|
|
}
|
|
if n := len(u.sent("eye")); n != 1 {
|
|
t.Fatalf("the describer was asked %d times, want once (for deepseek-v4-pro alone)", n)
|
|
}
|
|
}
|