From b66481a953fe2c0cfceebeae10c4002cfbb3ed0d Mon Sep 17 00:00:00 2001 From: XYenon Date: Thu, 8 Oct 2026 18:15:54 +0800 Subject: [PATCH] provider, gateway: Volcengine plans expose their own models by kind (#1265) --- docs/subsystems/providers-accounts.md | 2 +- internal/gateway/draw.go | 7 +- internal/gateway/draw_test.go | 18 +++ internal/gateway/embeddings.go | 25 +++- internal/gateway/embeddings_test.go | 54 +++++++ internal/gateway/video.go | 90 +++++++++--- internal/gateway/video_test.go | 144 +++++++++++++++++++ internal/gateway/volcengine_fixtures_test.go | 73 ++++++++++ internal/provider/models.go | 40 +++++- internal/provider/presets.go | 32 +++-- internal/provider/volcengine_test.go | 49 ++++++- 11 files changed, 493 insertions(+), 41 deletions(-) create mode 100644 internal/gateway/volcengine_fixtures_test.go diff --git a/docs/subsystems/providers-accounts.md b/docs/subsystems/providers-accounts.md index a1b5b4544..26c73820f 100644 --- a/docs/subsystems/providers-accounts.md +++ b/docs/subsystems/providers-accounts.md @@ -50,7 +50,7 @@ keys and accounts per request is in [Gateway routing and fallback](gateway-routi - When `logins.json` cannot be decoded as saved accounts, reads keep the accounts read before. Before saving a change, `keepUnreadLogins` copies the original file aside, including valid JSON with invalid account field types, so its credentials can be recovered. If the existing file cannot be read or the backup fails, saving returns the error and leaves the original file unchanged. A missing file can be created normally. - A switched-off provider (`Off`, #163) stays saved. The gateway says it is off instead of saying the model is unknown. - A provider removed or switched off takes its models out of the catalog. [Agent wiring](agent-wiring.md)'s `Reseat` moves agents off them. -- A preset marked `NoList` uses its preset model list instead of requesting `/models`, and ignores previously fetched lists, including their protocol and key restrictions, unless the user sets `ModelsURL` or chooses a region marked `Lists`. Volcengine Ark's Coding Plan and Agent Plan use this path: Coding's `/api/coding/v3/models` returns a general Ark catalog instead of the plan's model ids, while Agent's `/api/plan/v3/models` returns 404. Ark's pay-as-you-go region still fetches its own list. [`presets.go`](../../internal/provider/presets.go) defines these choices; `List`, `fetch` and `live` in [`models.go`](../../internal/provider/models.go) apply them when adding, refreshing and reading cached models. `TestVolcengineModelLists` checks that the plans make no list requests, ignore old cached lists and return their preset models; pay-as-you-go and an explicit list URL still make requests. +- A preset marked `NoList` uses its preset model list instead of requesting `/models`, and ignores previously fetched lists, including their protocol and key restrictions, unless the user sets `ModelsURL` or chooses a region marked `Lists`. Each region can carry a different list. Volcengine Ark's Coding Plan and Agent Plan use separate preset lists. Both plans include their embedding model separately from agents' chat-model lists; Agent Plan additionally exposes its image- and video-generation models to Settings → Images; Ark itself refuses video generation on Small and Medium Agent Plans, which include it only in the Large and Max tiers. Models magpie does not yet serve (Agent Plan's speech models) are not advertised. Ark's pay-as-you-go region still fetches its own list. Coding's `/api/coding/v3/models` returns a general Ark catalog instead of the plan's model ids, while Agent's `/api/plan/v3/models` returns 404. [`presets.go`](../../internal/provider/presets.go) defines these choices; `List`, `fetch`, `live`, `planModels`, `PlanEmbeddings`, `PlanDrawers` and `PlanVideos` in [`models.go`](../../internal/provider/models.go) apply them when adding, refreshing and reading cached models. `TestVolcengineModelLists` checks that the plans make no list requests, ignore old cached lists and return their own preset models; pay-as-you-go and an explicit list URL still make requests. - A gateway key held to some accounts (#905) is held to those of the providers its list names: a provider it names no account of, the key uses as it always did. The list keeps an account by its stable id — `logins.json`'s `id`, set once written and kept through renames; the agents that keep no logins (and plugins) are known by a hash of the account's name, so an account renamed there drops out of a key's list, holding it closer, never wider. Storing an id for every agent is a larger change, not this one's. - A sub2api key's windows are fixed: each starts at the key's first request after it was empty, aligned to the relay's day, and a window not started yet says `used 0` with no `reset_at`, so it is taken to renew a span from now. They count this key's spend only, not the relay's accounts behind it. `ForgetBalances` (a key or Balance URL changed) has every key's windows read again at its next ask, a read begun before dropped; until then the last reading stands, fresher than the card's, which routing's reads never write. A key changed is another key (`keyID`), with windows of its own. - Whether a Codex account spends its credits (`CodexNoCredits` in settings, opt-out, by lower-cased email) is the gateway's routing only. It never changes which account Codex is signed in to: `NextLogin` moves off an account at its routing's spent share, 100% at most, credits or not. diff --git a/internal/gateway/draw.go b/internal/gateway/draw.go index 0dc5381eb..ae79b68fa 100644 --- a/internal/gateway/draw.go +++ b/internal/gateway/draw.go @@ -147,8 +147,11 @@ func Drawers(p provider.Provider) []catalog.Model { if p.Account != nil || (p.Base(provider.Chat) == "" && p.Base(provider.Responses) == "") { return nil } - var out []catalog.Model - have := map[string]bool{} + out := p.PlanDrawers() + have := make(map[string]bool, len(out)) + for _, m := range out { + have[m.ID] = true + } for _, c := range p.Catalogs() { for _, m := range catalog.Drawers(c) { if !have[m.ID] { diff --git a/internal/gateway/draw_test.go b/internal/gateway/draw_test.go index 97e0fb020..64f9a035c 100644 --- a/internal/gateway/draw_test.go +++ b/internal/gateway/draw_test.go @@ -9,6 +9,7 @@ import ( "net/http/httptest" "os" "path/filepath" + "slices" "strings" "sync" "testing" @@ -261,6 +262,23 @@ func TestAspectOf(t *testing.T) { } } +func TestVolcengineAgentPlanDrawers(t *testing.T) { + p, err := provider.FromPreset("volcengine") + if err != nil { + t.Fatal(err) + } + pr := provider.Preset("volcengine") + p.Chat, p.Responses, p.Anthropic = pr.Regions[1].Chat, pr.Regions[1].Responses, pr.Regions[1].Anthropic + ds, want := Drawers(p), p.PlanDrawers() + if len(ds) == 0 || !slices.EqualFunc(ds, want, func(a, b catalog.Model) bool { return a.ID == b.ID }) { + t.Fatalf("Agent Plan drawers: %+v, want preset plan's %+v", ds, want) + } + p.Chat, p.Responses, p.Anthropic = pr.Regions[0].Chat, pr.Regions[0].Responses, pr.Regions[0].Anthropic + if ds := Drawers(p); len(ds) != 0 { + t.Fatalf("Coding Plan drawers: %+v", ds) + } +} + func TestCatalogDrawers(t *testing.T) { fresh(t) for _, id := range catalog.Providers() { diff --git a/internal/gateway/embeddings.go b/internal/gateway/embeddings.go index 423193a59..b6c819e69 100644 --- a/internal/gateway/embeddings.go +++ b/internal/gateway/embeddings.go @@ -46,7 +46,7 @@ func (s *Server) retrieve(path, operation string) http.HandlerFunc { who := callerOf(r) call := Call{Time: start, From: provider.Chat, Agent: who.agent, Via: who.via, Model: asked} usage.Saw(agentOf(r)) - p, model, ok := provider.Resolve(asked) + p, model, ok := resolveRetrievalModel(asked) if !ok { msg := fmt.Sprintf("magpie knows no model %q", asked) if off, isOff := provider.SwitchedOff(asked); isOff { @@ -155,6 +155,29 @@ func (s *Server) retrieve(path, operation string) http.HandlerFunc { } } +// resolveRetrievalModel also finds a preset plan's embedding model by its +// bare id. Such models stay out of agents' chat-model lists, so the general +// resolver does not otherwise see them there. +func resolveRetrievalModel(id string) (provider.Provider, string, bool) { + if p, model, ok := provider.Resolve(id); ok { + return p, model, true + } + if strings.Contains(id, "/") { + return provider.Provider{}, "", false + } + for _, p := range provider.All() { + if !p.On() || p.DecideOnly() { + continue + } + for _, m := range p.PlanEmbeddings() { + if m.ID == id { + return p, id, true + } + } + } + return provider.Provider{}, "", false +} + // retrieveFrom posts body to url as the provider signs its requests, and // reads the answer; a failure's code is the vendor's, with its message. func (s *Server) retrieveFrom(ctx context.Context, p provider.Provider, url string, body []byte) ([]byte, int, error) { diff --git a/internal/gateway/embeddings_test.go b/internal/gateway/embeddings_test.go index f0bb721a0..5155d0805 100644 --- a/internal/gateway/embeddings_test.go +++ b/internal/gateway/embeddings_test.go @@ -1,6 +1,7 @@ package gateway import ( + "encoding/json" "io" "net/http" "net/http/httptest" @@ -107,6 +108,59 @@ func TestEmbeddingsGoToTheModelsProvider(t *testing.T) { } } +func TestVolcengineEmbeddingResponses(t *testing.T) { + type response struct { + Object string `json:"object"` + Model string `json:"model"` + Data []struct { + Object string `json:"object"` + Index int `json:"index"` + Embedding []float64 `json:"embedding"` + } `json:"data"` + Usage struct { + Prompt int `json:"prompt_tokens"` + Total int `json:"total_tokens"` + } `json:"usage"` + } + for name, fixture := range map[string]string{"Coding Plan": volcengineCodingEmbeddingResponse, "Agent Plan": volcengineAgentEmbeddingResponse} { + var out response + if err := json.Unmarshal([]byte(fixture), &out); err != nil { + t.Fatal(err) + } + if out.Object != "list" || !strings.HasPrefix(out.Model, "doubao-embedding-vision") || len(out.Data) != 1 || out.Data[0].Object != "embedding" || len(out.Data[0].Embedding) != 2048 || out.Usage.Prompt != 23 || out.Usage.Total != 23 { + t.Fatalf("%s embedding response: %+v", name, out) + } + } +} + +func TestPresetPlanEmbeddingResolvesOutsideChatModels(t *testing.T) { + fresh(t) + p, err := provider.FromPreset("volcengine") + if err != nil { + t.Fatal(err) + } + pr := provider.Preset("volcengine") + p.ID = "ark-agent" + p.Chat, p.Responses, p.Anthropic = pr.Regions[1].Chat, pr.Regions[1].Responses, pr.Regions[1].Anthropic + p.Key = "key" + if err := provider.Save(p); err != nil { + t.Fatal(err) + } + embed := p.PlanEmbeddings() + if len(embed) == 0 { + t.Fatal("Agent Plan has no preset embedding model") + } + for _, m := range p.Exposed() { + if m.ID == embed[0].ID { + t.Fatalf("embedding model exposed for chat: %+v", m) + } + } + got, model, ok := resolveRetrievalModel(embed[0].ID) + if !ok || got.ID != p.ID || model != embed[0].ID { + t.Fatalf("bare embedding resolved to %q/%q, %v", got.ID, model, ok) + } +} + func TestRerankGoesToTheModelsProvider(t *testing.T) { s, l := shelved(t) code, raw := postRetrieval(t, s, "/v1/rerank", `{"model":"lib/rerank-1","query":"magpie","documents":["a crow","a magpie"],"top_n":2,"return_documents":true}`) diff --git a/internal/gateway/video.go b/internal/gateway/video.go index cc965f2d2..a14d63bb0 100644 --- a/internal/gateway/video.go +++ b/internal/gateway/video.go @@ -35,10 +35,10 @@ import ( // for it again. It says who is making the video, video_.., so the gateway keeps nothing. // -// Only a Grok subscription makes videos so far, at the Imagine API of the -// backend Grok Build talks to: /videos/generations -// starts one and answers with its request_id, and /videos/{request_id} is -// answered 202 while it is made and 200 with the video's URL when it is. +// A Grok subscription uses the Imagine API of the backend Grok Build talks +// to: /videos/generations starts one and answers +// with its request_id. Volcengine Agent Plan uses Ark's asynchronous content +// generation tasks under its /api/plan/v3 base. // // Another magpie's videos (a Remote magpie's, #545) are asked of it, at its // own videos API: its id for one goes, encoded, in the id given here, and @@ -57,7 +57,8 @@ var grokVideoAspects = []string{"1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3 const maxVideoBytes = 512 << 20 // Videomakers are the models a provider can make videos with: a Grok -// subscription's, and those another magpie listed as its own. +// subscription's, another magpie's, and a preset plan's models when magpie +// implements that vendor's video API. func Videomakers(p provider.Provider) []catalog.Model { if p.IsRemoteMagpie() { out := catalog.LiveVideomakers(p.ID) @@ -66,6 +67,9 @@ func Videomakers(p provider.Provider) []catalog.Model { } return out } + if out := p.PlanVideos(); len(out) > 0 { + return out + } if !drawsGrok(p) { return nil } @@ -265,6 +269,31 @@ func pixelResolution(size string) string { return "480p" } +// volcengineVideoBody is f as Ark's content-generation API takes it: text +// and images in content, with image roles distinguishing the first frame from +// subject references, plus duration, ratio and resolution as separate fields. +func volcengineVideoBody(model string, f filming) []byte { + content := []map[string]any{{"type": "text", "text": f.Prompt}} + if f.Start != nil { + content = append(content, map[string]any{"type": "image_url", "image_url": map[string]string{"url": f.Start.dataURL()}, "role": "first_frame"}) + } + for _, pic := range f.References { + content = append(content, map[string]any{"type": "image_url", "image_url": map[string]string{"url": pic.dataURL()}, "role": "reference_image"}) + } + req := map[string]any{"model": model, "content": content} + if f.Seconds != "" { + req["duration"], _ = strconv.Atoi(f.Seconds) + } + if ar := aspectAmong(f.Size, grokVideoAspects); ar != "" { + req["ratio"] = ar + } + if res := pixelResolution(f.Size); res != "" { + req["resolution"] = res + } + b, _ := json.Marshal(req) + return b +} + // grokVideoBody is f as Grok's video API takes it: the duration in whole // seconds, an aspect ratio and a resolution rather than a size, the first // frame as image and the subjects to draw from as reference_images. What @@ -343,7 +372,11 @@ type videoState struct { URL string `json:"url"` Duration float64 `json:"duration"` } `json:"video"` - Error struct { + Content struct { + VideoURL string `json:"video_url"` + } `json:"content"` + Duration float64 `json:"duration"` + Error struct { Code string `json:"code"` Message string `json:"message"` } `json:"error"` @@ -353,9 +386,11 @@ type videoState struct { func videoObject(id, model string, started time.Time, st videoState, f filming) map[string]any { status, progress := "queued", 0 switch st.Status { - case "done": + case "done", "succeeded": status, progress = "completed", 100 - case "failed", "expired": + case "running": + status, progress = "in_progress", st.Progress + case "failed", "expired", "cancelled": status, progress = "failed", st.Progress default: if st.Progress > 0 { @@ -372,13 +407,18 @@ func videoObject(id, model string, started time.Time, st videoState, f filming) switch { case st.Video.Duration > 0: obj["seconds"] = strconv.FormatFloat(st.Video.Duration, 'f', -1, 64) + case st.Duration > 0: + obj["seconds"] = strconv.FormatFloat(st.Duration, 'f', -1, 64) case f.Seconds != "": obj["seconds"] = f.Seconds } if status == "failed" { code, msg := st.Error.Code, st.Error.Message - if st.Status == "expired" { + switch st.Status { + case "expired": code, msg = "expired", "the vendor no longer keeps this video" + case "cancelled": + code, msg = "cancelled", "the video was cancelled" } if msg == "" { msg = "the video failed" @@ -395,7 +435,7 @@ func videoMaker(id string) (p provider.Provider, vendorID string, started time.T return p, "", started, fmt.Errorf("%q isn't the id of a video magpie is making", id) } found, ferr := provider.Find(pid) - if ferr != nil || !drawsGrok(*found) && !found.IsRemoteMagpie() { + if ferr != nil || !drawsGrok(*found) && !found.IsRemoteMagpie() && len(found.PlanVideos()) == 0 { return p, "", started, fmt.Errorf("no provider %q makes videos here", pid) } if signer(*found) != by { @@ -463,7 +503,11 @@ func remoteVideoURL(p provider.Provider, vendorID, suffix string) string { // videoStatus asks the vendor how a video is going. func (s *Server) videoStatus(ctx context.Context, p provider.Provider, vendorID string) (videoState, int, error) { var st videoState - b, code, err := s.sendAs(ctx, p, http.MethodGet, strings.TrimRight(p.Base(provider.Responses), "/")+"/videos/"+url.PathEscape(vendorID), "", nil, true) + at := strings.TrimRight(p.Base(provider.Responses), "/") + "/videos/" + url.PathEscape(vendorID) + if p.Preset == "volcengine" { + at = strings.TrimRight(p.Base(provider.Responses), "/") + "/contents/generations/tasks/" + url.PathEscape(vendorID) + } + b, code, err := s.sendAs(ctx, p, http.MethodGet, at, "", nil, true) if err != nil { return st, code, err } @@ -536,9 +580,10 @@ func (s *Server) videosCreate(w http.ResponseWriter, r *http.Request) { } call.Provider, call.To = p.ID, provider.Chat remote := p.IsRemoteMagpie() + volcengine := p.Preset == "volcengine" && slices.ContainsFunc(p.PlanVideos(), func(m catalog.Model) bool { return m.ID == model }) // any grok-imagine-video*, not only those listed: the vendor's newer ones work before magpie names them - if !remote && (len(Videomakers(p)) == 0 || !strings.HasPrefix(model, "grok-imagine-video")) { - fail(400, fmt.Sprintf("%s/%s can't make videos: magpie makes videos with a Grok subscription's grok-imagine-video", p.ID, model)) + if !remote && !volcengine && (len(Videomakers(p)) == 0 || !strings.HasPrefix(model, "grok-imagine-video")) { + fail(400, fmt.Sprintf("%s/%s can't make videos: magpie makes videos with a Grok subscription's grok-imagine-video or Volcengine Agent Plan's Seedance models", p.ID, model)) return } var unmask func() @@ -548,11 +593,17 @@ func (s *Server) videosCreate(w http.ResponseWriter, r *http.Request) { // it can't make at, field := strings.TrimRight(p.Base(provider.Responses), "/")+"/videos/generations", "request_id" var body []byte - if remote { + switch { + case remote: at, field, body = strings.TrimRight(p.Base(provider.Chat), "/")+"/videos", "id", remoteVideoBody(model, f) - } else if body, err = grokVideoBody(model, f); err != nil { - fail(400, err.Error()) - return + case volcengine: + at, field, body = strings.TrimRight(p.Base(provider.Responses), "/")+"/contents/generations/tasks", "id", volcengineVideoBody(model, f) + default: + body, err = grokVideoBody(model, f) + if err != nil { + fail(400, err.Error()) + return + } } ctx, cancel := context.WithTimeout(r.Context(), drawTimeout) defer cancel() @@ -643,7 +694,7 @@ func (s *Server) videosContent(w http.ResponseWriter, r *http.Request) { writeError(w, provider.Chat, code, err.Error()) return } - if st.Status != "done" { + if st.Status != "done" && st.Status != "succeeded" { obj := videoObject(id, "", time.Time{}, st, filming{}) msg := fmt.Sprintf("the video isn't ready: it is %v", obj["status"]) if e, ok := obj["error"].(map[string]string); ok { @@ -652,6 +703,9 @@ func (s *Server) videosContent(w http.ResponseWriter, r *http.Request) { writeError(w, provider.Chat, 409, msg) return } + if st.Video.URL == "" { + st.Video.URL = st.Content.VideoURL + } if st.Video.URL == "" { writeError(w, provider.Chat, 502, p.Name+" made the video but gave no URL for it") return diff --git a/internal/gateway/video_test.go b/internal/gateway/video_test.go index 4386cbf59..64adc8b60 100644 --- a/internal/gateway/video_test.go +++ b/internal/gateway/video_test.go @@ -8,11 +8,13 @@ import ( "mime/multipart" "net/http" "net/http/httptest" + "slices" "strings" "sync" "testing" "time" + "github.com/yetone/magpie/internal/catalog" "github.com/yetone/magpie/internal/provider" "github.com/yetone/magpie/internal/settings" ) @@ -119,6 +121,148 @@ func errorOf(obj map[string]any) string { return "" } +func TestVolcengineAgentPlanVideos(t *testing.T) { + p, err := provider.FromPreset("volcengine") + if err != nil { + t.Fatal(err) + } + pr := provider.Preset("volcengine") + p.Chat, p.Responses, p.Anthropic = pr.Regions[1].Chat, pr.Regions[1].Responses, pr.Regions[1].Anthropic + ms, want := Videomakers(p), p.PlanVideos() + if len(ms) == 0 || !slices.EqualFunc(ms, want, func(a, b catalog.Model) bool { return a.ID == b.ID }) { + t.Fatalf("Agent Plan videos: %+v, want preset plan's %+v", ms, want) + } + p.Chat, p.Responses, p.Anthropic = pr.Regions[0].Chat, pr.Regions[0].Responses, pr.Regions[0].Anthropic + if ms := Videomakers(p); len(ms) != 0 { + t.Fatalf("Coding Plan videos: %+v", ms) + } +} + +func TestVolcengineVideoBody(t *testing.T) { + f := filming{Prompt: "a magpie", Seconds: "6", Size: "1280x720", Start: &picture{Mime: "image/png", Data: []byte("png")}, References: []picture{{URL: "https://example.test/ref.png"}}} + var got map[string]any + if err := json.Unmarshal(volcengineVideoBody("doubao-seedance-2.5", f), &got); err != nil { + t.Fatal(err) + } + if got["model"] != "doubao-seedance-2.5" || got["duration"] != float64(6) || got["resolution"] != "720p" || got["ratio"] != "16:9" { + t.Fatalf("body: %+v", got) + } + content, _ := got["content"].([]any) + if len(content) != 3 { + t.Fatalf("content: %+v", got["content"]) + } + first, _ := content[1].(map[string]any) + reference, _ := content[2].(map[string]any) + if first["role"] != "first_frame" || reference["role"] != "reference_image" { + t.Fatalf("image roles: %+v", content) + } +} + +func TestVolcengineVideoIsStartedPolledAndFetched(t *testing.T) { + fresh(t) + var mu sync.Mutex + var paths, bodies []string + asked := map[string]int{} + var up *httptest.Server + up = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + body, _ := io.ReadAll(r.Body) + mu.Lock() + defer mu.Unlock() + paths = append(paths, r.Method+" "+r.URL.Path) + bodies = append(bodies, string(body)) + if r.URL.Path != "/ark/video.mp4" && r.Header.Get("Authorization") != "Bearer key" { + w.WriteHeader(401) + return + } + w.Header().Set("Content-Type", "application/json") + switch { + case r.Method == http.MethodPost && r.URL.Path == "/api/plan/v3/contents/generations/tasks" && strings.Contains(string(body), "FAILING"): + io.WriteString(w, volcengineVideoFailedCreateResponse) + case r.Method == http.MethodPost && r.URL.Path == "/api/plan/v3/contents/generations/tasks": + io.WriteString(w, volcengineVideoCreateResponse) + case r.Method == http.MethodGet && r.URL.Path == "/api/plan/v3/contents/generations/tasks/cgt-20261008165954-4sc9n": + asked["success"]++ + if asked["success"] == 1 { + io.WriteString(w, volcengineVideoRunningResponse) + } else { + io.WriteString(w, strings.Replace(volcengineVideoSucceededResponse, "VIDEO_URL", up.URL+"/ark/video.mp4", 1)) + } + case r.Method == http.MethodGet && r.URL.Path == "/api/plan/v3/contents/generations/tasks/cgt-20261008165955-bgckq": + io.WriteString(w, volcengineVideoFailedResponse) + case r.Method == http.MethodGet && r.URL.Path == "/ark/video.mp4": + w.Header().Set("Content-Type", "video/mp4") + io.WriteString(w, "ark-video-bytes") + default: + w.WriteHeader(404) + io.WriteString(w, `{"error":{"code":"not_found","message":"unexpected path"}}`) + } + })) + t.Cleanup(up.Close) + + p, err := provider.FromPreset("volcengine") + if err != nil { + t.Fatal(err) + } + p.ID, p.Key = "ark-agent", "key" + p.Chat, p.Responses = up.URL+"/api/plan/v3", up.URL+"/api/plan/v3" + p.Anthropic = up.URL + "/api/plan" + if err := provider.Save(p); err != nil { + t.Fatal(err) + } + + s := New() + code, obj, raw, _ := request(t, s, http.MethodPost, "/v1/videos", "application/json", `{"model":"ark-agent/doubao-seedance-2.0-mini","prompt":"a magpie","seconds":5,"size":"854x480"}`) + if code != 200 || obj["status"] != "queued" || obj["model"] != "ark-agent/doubao-seedance-2.0-mini" { + t.Fatalf("create: %d %s", code, raw) + } + id, _ := obj["id"].(string) + code, obj, raw, _ = request(t, s, http.MethodGet, "/v1/videos/"+id, "", "") + if code != 200 || obj["status"] != "in_progress" { + t.Fatalf("running: %d %s", code, raw) + } + code, obj, raw, _ = request(t, s, http.MethodGet, "/v1/videos/"+id, "", "") + if code != 200 || obj["status"] != "completed" || obj["seconds"] != "5" { + t.Fatalf("succeeded: %d %s", code, raw) + } + code, _, raw, head := request(t, s, http.MethodGet, "/v1/videos/"+id+"/content", "", "") + if code != 200 || string(raw) != "ark-video-bytes" || head.Get("Content-Type") != "video/mp4" { + t.Fatalf("content: %d %q %v", code, raw, head) + } + + code, failed, raw, _ := request(t, s, http.MethodPost, "/v1/videos", "application/json", `{"model":"ark-agent/doubao-seedance-2.0-mini","prompt":"FAILING"}`) + if code != 200 { + t.Fatalf("create failing: %d %s", code, raw) + } + code, failed, raw, _ = request(t, s, http.MethodGet, "/v1/videos/"+failed["id"].(string), "", "") + errObj, _ := failed["error"].(map[string]any) + if code != 200 || failed["status"] != "failed" || errObj["code"] != "OutputVideoSensitiveContentDetected.PolicyViolation" || !strings.Contains(errObj["message"].(string), "copyright restrictions") { + t.Fatalf("failed: %d %s", code, raw) + } + + mu.Lock() + defer mu.Unlock() + if len(paths) < 7 || paths[0] != "POST /api/plan/v3/contents/generations/tasks" || !strings.Contains(bodies[0], `"content":[`) || !strings.Contains(bodies[0], `"duration":5`) || !slices.Contains(paths, "GET /ark/video.mp4") { + t.Fatalf("upstream paths %v, create body %s", paths, bodies[0]) + } +} + +func TestVolcengineVideoState(t *testing.T) { + var st videoState + if err := json.Unmarshal([]byte(`{"status":"succeeded","model":"doubao-seedance-2.5","content":{"video_url":"https://example.test/video.mp4"},"duration":5}`), &st); err != nil { + t.Fatal(err) + } + obj := videoObject("video_volcengine.task.1.0", "volcengine/"+st.Model, time.Unix(1, 0), st, filming{}) + if obj["status"] != "completed" || obj["progress"] != 100 || obj["seconds"] != "5" || st.Content.VideoURL != "https://example.test/video.mp4" { + t.Fatalf("completed state: %+v, object: %+v", st, obj) + } + for status, want := range map[string]string{"queued": "queued", "running": "in_progress", "cancelled": "failed"} { + st = videoState{Status: status} + if got := videoObject("id", "model", time.Unix(1, 0), st, filming{})["status"]; got != want { + t.Errorf("%s became %v, want %s", status, got, want) + } + } +} + func TestVideomakersAreAGrokSubscriptions(t *testing.T) { grokSignedIn(t) newGrokMedia(t) diff --git a/internal/gateway/volcengine_fixtures_test.go b/internal/gateway/volcengine_fixtures_test.go new file mode 100644 index 000000000..c0a01767e --- /dev/null +++ b/internal/gateway/volcengine_fixtures_test.go @@ -0,0 +1,73 @@ +package gateway + +// These are literal Volcengine Ark replies captured with Coding Plan and Agent +// Plan keys on 2026-10-08. The successful video's signed artifact URL +// contained a temporary credential, so that one value alone is replaced with +// VIDEO_URL. Everything else, including both complete embedding vectors, is +// unchanged. +const volcengineCodingEmbeddingResponse = `{"created":1791450147,"id":"0217914501473213a391e43edef5299850de6066b8d72e29b2241","data":[{"embedding":[0.036376953125,-0.024658203125,-0.0150146484375,0.0198974609375,-0.0111083984375,0.0213623046875,-0.01519775390625,0.0164794921875,-0.000827789306640625,-0.005340576171875,0.00022411346435546875,-0.040771484375,0.036376953125,-0.01092529296875,-0.018798828125,0.0146484375,-0.0419921875,0.02978515625,0.00750732421875,-0.00799560546875,0.00121307373046875,0.0233154296875,-0.0103759765625,0.0059814453125,-0.010986328125,0.034423828125,0.0004425048828125,0.01409912109375,0.00238037109375,-0.032958984375,0.01263427734375,0.02685546875,-0.0113525390625,-0.0037994384765625,0.0057373046875,0.032470703125,0.01226806640625,-0.0057373046875,-0.00921630859375,-0.00518798828125,0.0108642578125,0.0103759765625,0.033935546875,0.00653076171875,-0.00579833984375,0.01171875,-0.046630859375,-0.0196533203125,-0.007537841796875,-0.03564453125,0.0272216796875,0.006591796875,0.00347900390625,-0.0146484375,-0.0028839111328125,-0.005706787109375,0.022216796875,0.004302978515625,-0.0123291015625,-0.00653076171875,0.029296875,-0.005462646484375,0.06298828125,0.003204345703125,-0.0031585693359375,-0.0172119140625,-0.038818359375,-0.016357421875,0.0157470703125,0.00157928466796875,-0.00921630859375,0.0260009765625,-0.00188446044921875,-0.039306640625,-0.039794921875,0.0308837890625,0.0322265625,-0.0245361328125,-0.011962890625,0.016357421875,-0.031982421875,-0.0311279296875,0.0042724609375,-0.0308837890625,-0.00384521484375,0.0211181640625,-0.01397705078125,0.01171875,0.0281982421875,0.0130615234375,0.0234375,0.011474609375,0.0172119140625,0.00335693359375,0.004486083984375,-0.0228271484375,-0.000255584716796875,-0.002655029296875,0.00141143798828125,-0.031982421875,0.007049560546875,-0.04931640625,-0.0034332275390625,0.003173828125,0.0260009765625,-0.01611328125,0.0135498046875,0.031982421875,-0.000919342041015625,-0.0146484375,-0.0294189453125,0.0281982421875,-0.053466796875,-0.0283203125,0.033447265625,0.00069427490234375,-0.0027618408203125,0.03173828125,0.061767578125,-0.03759765625,-0.0296630859375,-0.0301513671875,0.00347900390625,0.030029296875,0.042236328125,-0.0252685546875,-0.0038909912109375,-0.0294189453125,0.025634765625,0.0111083984375,0.02001953125,-0.020263671875,-0.004974365234375,-0.011474609375,0.0235595703125,-0.038330078125,-0.005218505859375,-0.01708984375,0.0032501220703125,0.007537841796875,0.0010528564453125,-0.0157470703125,-0.006622314453125,-0.036376953125,-0.027099609375,0.0010223388671875,-0.1455078125,-0.006439208984375,-0.0272216796875,0.013916015625,0.0018310546875,0.007232666015625,-0.00201416015625,-0.005401611328125,0.0098876953125,-0.00848388671875,0.0096435546875,0.0233154296875,-0.00677490234375,-0.0020599365234375,0.015625,-0.00147247314453125,-0.01043701171875,-0.00823974609375,-0.00750732421875,0.01177978515625,-0.021728515625,0.0050048828125,0.036376953125,-0.02783203125,0.003082275390625,0.017578125,-0.0120849609375,-0.000732421875,-0.00201416015625,-0.00018215179443359375,0.01171875,-0.008056640625,-0.021240234375,-0.009521484375,0.003631591796875,-0.04052734375,0.00970458984375,0.0091552734375,0.01483154296875,-0.03466796875,-0.00897216796875,-0.013427734375,0.03564453125,0.0260009765625,0.01007080078125,-0.0137939453125,-0.029296875,0.00390625,0.01092529296875,-0.00146484375,0.01165771484375,-0.0172119140625,-0.0021209716796875,-0.006988525390625,0.02197265625,0.01556396484375,0.00555419921875,0.0159912109375,0.0179443359375,-0.003448486328125,0.002044677734375,0.040771484375,0.037841796875,0.041259765625,-0.034423828125,0.0174560546875,0.002655029296875,0.01324462890625,-0.00933837890625,0.02392578125,-0.033935546875,-0.033935546875,0.006256103515625,0.01190185546875,-0.00909423828125,-0.016845703125,0.01544189453125,-0.00225830078125,0.0301513671875,0.031982421875,0.030029296875,-0.0089111328125,0.0157470703125,-0.021240234375,-0.04248046875,-0.033203125,0.018310546875,0.025390625,-0.019775390625,-0.009033203125,0.03564453125,0.0169677734375,-0.0267333984375,-0.0123291015625,-0.0057373046875,0.04150390625,-0.0301513671875,0.01214599609375,0.0029144287109375,-0.0225830078125,-0.047119140625,-0.0703125,0.029052734375,0.07177734375,-0.0069580078125,-0.037109375,-0.000102996826171875,-0.041259765625,0.052734375,-0.00726318359375,0.01544189453125,-0.01324462890625,-0.0146484375,-0.0120849609375,0.017333984375,0.0380859375,0.0263671875,0.01092529296875,-0.018310546875,-0.01153564453125,-0.028564453125,0.00732421875,0.00860595703125,-0.011474609375,0.005401611328125,-0.0341796875,-0.01483154296875,-0.00537109375,0.02783203125,0.0023193359375,0.0150146484375,-0.00008821487426757812,-0.004302978515625,0.0115966796875,-0.00726318359375,0.07275390625,0.0238037109375,0.022216796875,0.043212890625,0.000705718994140625,0.0081787109375,0.016357421875,0.0137939453125,0.0189208984375,0.0157470703125,0.0002689361572265625,-0.0322265625,0.03271484375,-0.004364013671875,0.049072265625,-0.0023040771484375,-0.0257568359375,-0.004058837890625,-0.0130615234375,0.01129150390625,0.02197265625,-0.00830078125,0.00244140625,0.042724609375,-0.011962890625,-0.0400390625,0.01129150390625,-0.0252685546875,-0.0034942626953125,-0.03271484375,0.01177978515625,-0.024169921875,0.00157928466796875,-0.00335693359375,0.01123046875,-0.04248046875,0.00848388671875,0.005645751953125,0.01263427734375,0.011474609375,0.022705078125,0.013916015625,0.00136566162109375,0.00885009765625,-0.025634765625,-0.022705078125,-0.009033203125,-0.015380859375,0.00054931640625,-0.0026397705078125,-0.0250244140625,-0.042724609375,-0.0023651123046875,-0.019287109375,0.05712890625,-0.010986328125,0.007049560546875,0.0220947265625,-0.00421142578125,0.0194091796875,-0.0380859375,-0.01397705078125,0.016845703125,0.05224609375,0.00010585784912109375,0.004302978515625,-0.00122833251953125,-0.00176239013671875,-0.0162353515625,0.00750732421875,-0.0274658203125,0.00274658203125,-0.007415771484375,-0.00171661376953125,-0.00848388671875,-0.0225830078125,-0.01019287109375,-0.0034332275390625,-0.022216796875,-0.0098876953125,0.01318359375,0.0137939453125,0.017822265625,0.00396728515625,-0.0260009765625,0.03369140625,0.022705078125,0.00933837890625,0.0019073486328125,0.025634765625,0.01318359375,-0.02099609375,0.0172119140625,0.00836181640625,0.0021209716796875,-0.025634765625,0.03173828125,-0.00970458984375,-0.008056640625,-0.0181884765625,0.0003414154052734375,-0.0233154296875,-0.00616455078125,0.02001953125,0.005950927734375,0.02001953125,0.0245361328125,-0.037353515625,-0.01544189453125,0.00494384765625,0.015380859375,-0.050048828125,-0.048583984375,-0.024658203125,0.0281982421875,-0.0267333984375,-0.000637054443359375,-0.042236328125,0.0169677734375,0.02001953125,-0.01190185546875,-0.0172119140625,0.004669189453125,0.03125,-0.06396484375,-0.006439208984375,-0.011474609375,-0.02294921875,-0.0213623046875,0.0025482177734375,-0.046630859375,0.041015625,-0.0004425048828125,0.0037078857421875,-0.0126953125,-0.022216796875,-0.00921630859375,-0.0052490234375,0.01519775390625,0.0172119140625,0.00140380859375,-0.00604248046875,-0.00653076171875,0.0159912109375,-0.046142578125,-0.0130615234375,0.00457763671875,0.005950927734375,0.0050048828125,-0.0050048828125,0.0218505859375,0.0024566650390625,0.003997802734375,0.016845703125,-0.00183868408203125,0.01336669921875,0.00116729736328125,-0.000377655029296875,-0.000827789306640625,0.016845703125,-0.0167236328125,0.00286865234375,0.0016326904296875,0.01397705078125,-0.00860595703125,0.020751953125,-0.0245361328125,0.04931640625,-0.004302978515625,0.0024566650390625,0.00830078125,-0.03515625,-0.023193359375,-0.0294189453125,0.01611328125,0.01519775390625,0.024169921875,0.0078125,0.0186767578125,-0.01141357421875,-0.03662109375,-0.0267333984375,0.025634765625,-0.0146484375,0.03369140625,-0.053466796875,-0.0174560546875,0.00750732421875,0.033935546875,0.000125885009765625,-0.000873565673828125,0.0478515625,-0.0113525390625,0.015380859375,0.015625,-0.021728515625,-0.030517578125,0.03466796875,-0.000926971435546875,-0.06005859375,0.003662109375,0.015869140625,0.0211181640625,0.0169677734375,0.024658203125,0.024658203125,0.0103759765625,0.03466796875,-0.004791259765625,-0.00848388671875,0.00933837890625,0.001983642578125,0.0013885498046875,-0.0103759765625,0.0194091796875,0.0098876953125,-0.005340576171875,-0.0030670166015625,-0.0233154296875,0.02685546875,0.0076904296875,0.033203125,0.007354736328125,0.01263427734375,0.022705078125,-0.000827789306640625,0.0004863739013671875,0.046630859375,0.0294189453125,-0.000949859619140625,-0.00994873046875,0.00396728515625,-0.0074462890625,0.011962890625,0.0233154296875,0.005096435546875,-0.0087890625,0.00860595703125,0.0439453125,-0.002288818359375,0.017578125,0.01055908203125,-0.00921630859375,0.02001953125,-0.0186767578125,0.01251220703125,0.0018157958984375,-0.050537109375,-0.0257568359375,0.01434326171875,-0.02001953125,0.01025390625,-0.01373291015625,0.050537109375,0.02294921875,-0.01043701171875,0.08544921875,0.010498046875,0.0218505859375,0.005950927734375,-0.0196533203125,0.0185546875,-0.03076171875,-0.0048828125,0.0250244140625,-0.024169921875,-0.002899169921875,0.001953125,-0.001129150390625,-0.0257568359375,0.033935546875,0.00689697265625,-0.009765625,-0.0301513671875,-0.00286865234375,0.0211181640625,0.05859375,-0.01324462890625,0.005645751953125,0.03857421875,-0.0137939453125,0.00390625,-0.0174560546875,0.0283203125,0.00029754638671875,-0.03466796875,-0.006988525390625,-0.0033416748046875,0.0137939453125,0.0301513671875,-0.01336669921875,-0.007415771484375,0.03271484375,-0.00147247314453125,0.00634765625,-0.0184326171875,0.026123046875,0.0103759765625,-0.02392578125,-0.0281982421875,0.004608154296875,-0.006256103515625,0.00010728836059570312,0.006805419921875,-0.004180908203125,0.027587890625,0.01904296875,-0.01318359375,0.015869140625,0.0107421875,-0.0234375,0.016845703125,-0.004669189453125,-0.02783203125,0.0238037109375,0.041748046875,0.015625,0.0096435546875,-0.01263427734375,-0.007415771484375,0.004852294921875,0.031982421875,-0.0257568359375,-0.007232666015625,0.0213623046875,-0.01019287109375,-0.021728515625,0.03955078125,0.00787353515625,-0.0024566650390625,0.01904296875,0.00762939453125,-0.0123291015625,-0.0159912109375,-0.00518798828125,0.00946044921875,-0.01300048828125,0.03125,0.01025390625,0.0203857421875,0.027099609375,0.02978515625,-0.0019989013671875,-0.00726318359375,0.0012969970703125,0.0048828125,-0.007354736328125,-0.0281982421875,0.0126953125,0.01416015625,-0.002410888671875,0.0361328125,-0.00921630859375,-0.0267333984375,-0.016845703125,-0.00860595703125,0.01129150390625,0.01129150390625,0.0024871826171875,0.02392578125,-0.00433349609375,-0.01043701171875,0.00147247314453125,0.00052642822265625,0.00830078125,-0.0301513671875,-0.04443359375,0.03857421875,0.02001953125,0.0196533203125,-0.049072265625,0.003662109375,0.0235595703125,-0.01904296875,0.01324462890625,-0.016845703125,-0.052001953125,-0.007781982421875,0.01214599609375,0.00933837890625,0.0025634765625,-0.018310546875,0.031494140625,0.03369140625,0.0186767578125,0.0303955078125,-0.003448486328125,-0.0208740234375,-0.007049560546875,0.00567626953125,0.0211181640625,-0.004486083984375,-0.0103759765625,0.049072265625,-0.037353515625,0.00130462646484375,-0.033203125,0.056640625,0.025634765625,-0.00151824951171875,0.00994873046875,-0.036865234375,0.02392578125,-0.0732421875,0.00762939453125,0.013916015625,0.01708984375,-0.0076904296875,-0.051513671875,0.00445556640625,-0.01025390625,-0.010009765625,0.00982666015625,0.005218505859375,0.03662109375,0.004302978515625,0.00604248046875,-0.034912109375,0.01019287109375,0.0013885498046875,0.031982421875,-0.0311279296875,-0.01361083984375,0.007171630859375,0.017578125,-0.0242919921875,-0.007415771484375,0.046142578125,0.0162353515625,-0.00689697265625,0.00714111328125,-0.00933837890625,0.0223388671875,0.002685546875,-0.01300048828125,0.015869140625,-0.03076171875,-0.01507568359375,0.0135498046875,-0.001220703125,-0.0037078857421875,-0.00482177734375,-0.029052734375,-0.0245361328125,-0.04248046875,-0.01409912109375,-0.09326171875,-0.01153564453125,0.0087890625,0.0257568359375,0.0279541015625,0.0294189453125,0.00201416015625,-0.005462646484375,-0.018310546875,0.0162353515625,0.0029449462890625,-0.012451171875,0.009033203125,0.023193359375,0.000659942626953125,-0.00384521484375,-0.01397705078125,0.0233154296875,-0.052978515625,-0.01251220703125,-0.00836181640625,0.01904296875,-0.043701171875,0.0107421875,-0.0107421875,-0.0260009765625,-0.0206298828125,-0.0189208984375,-0.0303955078125,-0.0030364990234375,-0.0211181640625,-0.0087890625,-0.003082275390625,0.006683349609375,-0.01300048828125,0.0069580078125,0.01904296875,-0.00982666015625,-0.021240234375,0.0137939453125,0.0003719329833984375,0.018310546875,-0.0103759765625,-0.01226806640625,0.0091552734375,-0.020263671875,-0.012451171875,-0.0146484375,-0.01708984375,0.0128173828125,-0.017333984375,-0.0164794921875,0.0224609375,0.00244140625,-0.007049560546875,-0.005340576171875,0.003448486328125,0.033447265625,-0.005645751953125,0.00750732421875,-0.0007781982421875,-0.03076171875,0.00531005859375,0.01373291015625,0.0172119140625,0.00049591064453125,0.0087890625,-0.0111083984375,0.021240234375,0.00604248046875,-0.0087890625,0.01263427734375,-0.00811767578125,0.04345703125,0.01373291015625,0.02392578125,0.01171875,-0.0361328125,0.006866455078125,0.00872802734375,0.013916015625,-0.01214599609375,0.00927734375,-0.0179443359375,0.00885009765625,0.0228271484375,0.01806640625,-0.015380859375,-0.0031585693359375,0.0023040771484375,0.0021820068359375,0.0026092529296875,-0.037841796875,-0.045166015625,-0.01507568359375,0.004119873046875,0.036376953125,-0.002105712890625,-0.0211181640625,-0.000850677490234375,-0.00970458984375,0.021728515625,0.004486083984375,0.031494140625,0.00144195556640625,0.0225830078125,-0.0120849609375,0.0322265625,-0.025634765625,-0.0050048828125,-0.01129150390625,-0.0286865234375,0.00689697265625,-0.004302978515625,0.0303955078125,0.0341796875,-0.0130615234375,-0.01129150390625,-0.032958984375,0.0257568359375,0.0172119140625,0.0164794921875,-0.017578125,0.013427734375,-0.00787353515625,-0.00921630859375,0.0211181640625,0.03369140625,-0.0164794921875,0.0208740234375,0.01708984375,0.00970458984375,-0.01507568359375,0.0235595703125,-0.02978515625,0.01287841796875,-0.00958251953125,-0.013916015625,0.00122833251953125,0.0107421875,-0.0281982421875,0.028564453125,0.0159912109375,0.00146484375,0.0123291015625,0.004302978515625,-0.007049560546875,-0.002410888671875,-0.01708984375,0.00836181640625,0.041748046875,0.029052734375,0.0020751953125,-0.03759765625,0.00823974609375,0.00396728515625,-0.00185394287109375,0.015869140625,-0.01251220703125,-0.0169677734375,-0.007354736328125,0.0111083984375,0.0164794921875,0.0166015625,0.005706787109375,0.033203125,-0.00193023681640625,0.03076171875,0.0194091796875,0.006805419921875,-0.0052490234375,-0.0218505859375,0.00921630859375,-0.00086212158203125,-0.00274658203125,-0.01507568359375,-0.0361328125,-0.0235595703125,0.02294921875,0.000766754150390625,-0.06787109375,0.02978515625,-0.007781982421875,0.0137939453125,-0.019775390625,-0.0225830078125,0.00010776519775390625,-0.0252685546875,-0.0184326171875,0.0201416015625,-0.00897216796875,0.00762939453125,-0.0164794921875,-0.002197265625,0.008056640625,-0.050048828125,-0.0152587890625,-0.0191650390625,-0.00115203857421875,0.003997802734375,0.0235595703125,-0.005218505859375,-0.010986328125,0.0111083984375,0.0263671875,-0.0198974609375,0.045166015625,0.0006256103515625,-0.019287109375,-0.0084228515625,-0.0198974609375,-0.03271484375,-0.003936767578125,0.04833984375,-0.002777099609375,0.00335693359375,-0.031494140625,-0.0078125,-0.020751953125,-0.019775390625,-0.0169677734375,0.0233154296875,-0.038818359375,-0.0169677734375,0.032958984375,-0.00171661376953125,0.0002002716064453125,0.00019168853759765625,0.01287841796875,-0.040283203125,0.00634765625,0.03564453125,-0.035888671875,0.0045166015625,0.000514984130859375,-0.01171875,-0.0267333984375,-0.01025390625,-0.033203125,-0.0031280517578125,0.005340576171875,-0.0191650390625,-0.00311279296875,0.0225830078125,0.0135498046875,0.01904296875,0.0281982421875,-0.003082275390625,0.021728515625,0.0213623046875,-0.018310546875,0.0260009765625,0.02685546875,0.0260009765625,0.0260009765625,-0.01507568359375,-0.0137939453125,0.033203125,0.0186767578125,-0.007720947265625,-0.00238037109375,0.00250244140625,-0.0087890625,0.0169677734375,-0.00098419189453125,0.00994873046875,0.0145263671875,-0.043212890625,-0.0128173828125,0.01171875,-0.0130615234375,0.006072998046875,0.0172119140625,-0.00946044921875,0.01611328125,0.00019741058349609375,-0.021484375,-0.0252685546875,-0.03564453125,0.026123046875,0.03857421875,0.007080078125,0.0167236328125,0.00567626953125,0.01055908203125,-0.01324462890625,-0.02490234375,-0.017822265625,0.0081787109375,0.01129150390625,0.0179443359375,0.024658203125,-0.0084228515625,-0.037353515625,-0.0120849609375,-0.00714111328125,0.005859375,-0.025390625,0.006072998046875,0.00189971923828125,0.020751953125,-0.004302978515625,0.006500244140625,-0.021728515625,-0.00011920928955078125,0.0128173828125,0.047119140625,-0.0194091796875,0.02001953125,0.006622314453125,0.0078125,0.017578125,-0.025634765625,-0.0189208984375,0.022216796875,-0.020263671875,0.004425048828125,0.017578125,0.044677734375,-0.005645751953125,0.01446533203125,-0.0172119140625,0.01226806640625,-0.037353515625,0.004974365234375,0.01318359375,-0.0115966796875,0.016845703125,0.003662109375,-0.02001953125,0.006683349609375,-0.01904296875,-0.01263427734375,0.0211181640625,0.0294189453125,-0.054443359375,0.01153564453125,-0.00183868408203125,-0.006072998046875,-0.005218505859375,-0.003814697265625,-0.0194091796875,0.0098876953125,-0.0036773681640625,-0.01123046875,0.0281982421875,-0.0017852783203125,0.03515625,0.01904296875,-0.01708984375,0.0172119140625,0.00506591796875,-0.0235595703125,0.0035400390625,0.00070953369140625,0.037353515625,-0.006256103515625,0.00102996826171875,-0.003448486328125,-0.00537109375,0.0260009765625,-0.040771484375,0.044189453125,-0.00118255615234375,0.00994873046875,0.0107421875,-0.0015411376953125,-0.0084228515625,-0.0111083984375,0.0211181640625,0.018798828125,-0.003173828125,-0.01104736328125,-0.0238037109375,-0.01177978515625,0.00689697265625,0.046875,-0.038818359375,-0.00299072265625,-0.00714111328125,-0.0137939453125,0.009765625,-0.0242919921875,0.01153564453125,-0.01226806640625,0.00069427490234375,-0.00244140625,-0.009033203125,-0.017578125,-0.01434326171875,-0.00537109375,0.017822265625,-0.015869140625,-0.010498046875,0.017578125,0.016845703125,0.00010061264038085938,0.017578125,-0.00057220458984375,0.00616455078125,-0.00927734375,0.013916015625,-0.001678466796875,0.002655029296875,-0.0111083984375,-0.0194091796875,0.0093994140625,0.042724609375,0.03369140625,-0.0189208984375,-0.0034942626953125,0.01263427734375,0.016845703125,-0.02001953125,0.005767822265625,-0.0191650390625,0.0076904296875,-0.04345703125,0.015625,-0.01190185546875,0.024169921875,0.0013427734375,-0.0245361328125,-0.020263671875,-0.02197265625,0.0003662109375,0.0113525390625,0.02783203125,0.028564453125,0.00726318359375,-0.0101318359375,-0.00006103515625,-0.0000553131103515625,-0.0341796875,-0.0301513671875,0.0028076171875,-0.07177734375,-0.00909423828125,-0.010009765625,-0.034423828125,-0.005889892578125,0.009033203125,0.017333984375,0.0016326904296875,0.01007080078125,-0.010986328125,-0.0235595703125,0.007537841796875,-0.02001953125,-0.036865234375,-0.00421142578125,-0.01153564453125,0.0157470703125,-0.022216796875,0.01446533203125,0.003814697265625,0.0076904296875,0.0078125,0.01226806640625,0.01171875,0.06005859375,-0.05078125,-0.0458984375,-0.0159912109375,-0.01446533203125,-0.01434326171875,-0.0234375,0.0103759765625,0.033935546875,0.02978515625,-0.00189971923828125,0.015869140625,-0.01007080078125,0.0224609375,0.013916015625,-0.0142822265625,-0.000789642333984375,0.0198974609375,-0.00848388671875,0.01092529296875,0.0208740234375,0.0213623046875,-0.044921875,0.00732421875,0.01318359375,0.01904296875,0.037841796875,-0.0186767578125,-0.034423828125,0.03271484375,-0.005126953125,0.0224609375,-0.0186767578125,0.0025634765625,0.025634765625,0.000667572021484375,-0.044677734375,0.034912109375,0.04443359375,0.021240234375,0.005340576171875,-0.00860595703125,-0.00439453125,-0.02490234375,0.0018157958984375,0.01129150390625,-0.030517578125,-0.0137939453125,0.03515625,-0.025390625,0.025390625,-0.007049560546875,0.023193359375,-0.0263671875,0.0107421875,0.0026397705078125,-0.00372314453125,-0.0203857421875,-0.0257568359375,0.002471923828125,0.0013885498046875,-0.0274658203125,-0.023193359375,-0.050048828125,0.01904296875,-0.032958984375,-0.00970458984375,-0.01397705078125,-0.0103759765625,0.0037689208984375,-0.00604248046875,0.0027923583984375,-0.0050048828125,-0.03515625,0.0498046875,-0.0234375,-0.0478515625,-0.0023345947265625,0.00107574462890625,0.0026702880859375,0.025634765625,0.007354736328125,0.004852294921875,0.0267333984375,-0.0028839111328125,0.004150390625,0.007354736328125,-0.025390625,-0.00518798828125,0.046142578125,-0.00518798828125,-0.00836181640625,0.01373291015625,0.006072998046875,0.0159912109375,-0.032958984375,0.0233154296875,-0.0103759765625,-0.017578125,-0.029052734375,-0.01190185546875,0.0233154296875,-0.010009765625,0.01483154296875,-0.0301513671875,0.0128173828125,-0.037353515625,-0.00750732421875,0.00811767578125,0.01214599609375,0.024169921875,-0.0296630859375,0.0113525390625,0.031982421875,-0.0250244140625,-0.0206298828125,-0.005218505859375,0.0228271484375,0.00555419921875,-0.00445556640625,0.00634765625,-0.0126953125,-0.01141357421875,0.00131988525390625,0.0142822265625,0.0111083984375,0.0311279296875,0.02099609375,-0.006683349609375,0.031982421875,0.005889892578125,0.032958984375,0.002197265625,-0.01708984375,0.03369140625,-0.007781982421875,-0.005584716796875,0.00604248046875,-0.02001953125,-0.005706787109375,0.0037078857421875,0.0135498046875,-0.006439208984375,-0.00909423828125,-0.021484375,-0.0048828125,-0.0196533203125,-0.036376953125,-0.002105712890625,0.0026702880859375,0.02294921875,0.0174560546875,-0.0146484375,0.0211181640625,-0.0034332275390625,0.062255859375,0.013427734375,0.00518798828125,-0.00201416015625,-0.026123046875,-0.024658203125,-0.03662109375,0.02294921875,0.020263671875,0.01373291015625,0.009521484375,0.0026397705078125,0.06298828125,0.0303955078125,0.0203857421875,0.016845703125,0.00238037109375,-0.043701171875,0.01129150390625,-0.01806640625,0.0230712890625,-0.052734375,0.0040283203125,0.03955078125,-0.030029296875,-0.01397705078125,-0.0016021728515625,-0.03759765625,0.045166015625,0.0152587890625,-0.0078125,0.01177978515625,-0.034423828125,0.0303955078125,0.039306640625,-0.0208740234375,-0.0279541015625,0.0035247802734375,0.007537841796875,-0.001983642578125,0.00162506103515625,-0.031982421875,-0.02685546875,-0.0260009765625,-0.0126953125,0.009521484375,-0.027587890625,-0.0218505859375,0.0203857421875,0.0390625,-0.037353515625,0.046875,0.03369140625,0.01287841796875,-0.0002536773681640625,0.0216064453125,0.011474609375,0.0224609375,-0.0242919921875,0.01007080078125,0.021240234375,-0.0120849609375,0.007781982421875,-0.0091552734375,0.028564453125,0.00762939453125,-0.031982421875,0.017333984375,-0.00823974609375,-0.01190185546875,-0.00811767578125,0.01263427734375,0.050537109375,0.031982421875,0.007598876953125,0.024658203125,-0.01507568359375,-0.01019287109375,0.0203857421875,-0.02783203125,-0.0185546875,0.03076171875,0.008056640625,0.0245361328125,0.040283203125,-0.00162506103515625,0.0400390625,0.032470703125,-0.0111083984375,0.00372314453125,0.062255859375,-0.0286865234375,-0.01544189453125,0.0179443359375,0.03662109375,-0.042236328125,0.0033416748046875,0.0029144287109375,0.000713348388671875,-0.0098876953125,-0.02197265625,-0.0126953125,0.0208740234375,0.00836181640625,-0.0390625,-0.003448486328125,0.00885009765625,-0.01300048828125,-0.047119140625,0.01806640625,-0.046630859375,-0.01544189453125,0.0087890625,0.0272216796875,-0.0189208984375,-0.018310546875,-0.0283203125,0.00311279296875,0.0145263671875,0.005462646484375,0.0057373046875,0.007720947265625,-0.027099609375,-0.03662109375,0.0242919921875,-0.0218505859375,0.0303955078125,0.01104736328125,-0.006622314453125,-0.00823974609375,0.017822265625,0.0169677734375,0.01177978515625,0.02783203125,-0.01336669921875,0.0166015625,0.00421142578125,-0.002349853515625,0.00060272216796875,0.0035400390625,-0.06787109375,-0.0024871826171875,0.03466796875,-0.002105712890625,0.000881195068359375,0.0208740234375,0.0181884765625,-0.0054931640625,0.0037994384765625,-0.001922607421875,-0.0014190673828125,-0.02099609375,0.013916015625,-0.01287841796875,-0.0091552734375,0.00830078125,-0.01092529296875,0.00579833984375,0.01336669921875,0.01025390625,0.0203857421875,0.03564453125,0.0301513671875,0.0020751953125,-0.011962890625,-0.00823974609375,0.01190185546875,0.03564453125,0.022216796875,0.018798828125,0.06884765625,-0.000545501708984375,0.0198974609375,0.002532958984375,0.02783203125,-0.00970458984375,-0.0196533203125,-0.032470703125,0.03173828125,0.006439208984375,-0.0135498046875,-0.0189208984375,-0.0159912109375,0.01055908203125,0.0013275146484375,0.021484375,0.0224609375,-0.0089111328125,-0.001190185546875,0.03564453125,0.003997802734375,-0.03515625,0.0107421875,0.00101470947265625,0.0035247802734375,-0.01068115234375,0.0172119140625,-0.01129150390625,0.00933837890625,-0.003997802734375,-0.01507568359375,-0.01287841796875,-0.02099609375,-0.012451171875,-0.017578125,-0.00860595703125,-0.0054931640625,0.01080322265625,0.0126953125,-0.016357421875,-0.0123291015625,0.0087890625,-0.005889892578125,0.0106201171875,0.0172119140625,-0.0186767578125,-0.03662109375,-0.0157470703125,0.019287109375,-0.030517578125,-0.0286865234375,-0.0181884765625,-0.0159912109375,0.007171630859375,-0.0130615234375,0.0263671875,0.007598876953125,0.050537109375,0.021484375,-0.01318359375,0.0078125,-0.0260009765625,-0.0233154296875,-0.010498046875,0.003204345703125,-0.02001953125,0.050048828125,-0.00347900390625,-0.0026397705078125,-0.010498046875,0.006072998046875,-0.0015411376953125,0.0225830078125,0.008056640625,0.0400390625,0.0001373291015625,0.0021514892578125,0.0162353515625,0.0069580078125,-0.03173828125,0.030517578125,0.0115966796875,-0.02978515625,-0.0029296875,0.123046875,-0.0034332275390625,0.040771484375,-0.01336669921875,-0.01251220703125,0.016357421875,0.00787353515625,0.0098876953125,0.00506591796875,0.04296875,-0.0108642578125,0.05419921875,0.00933837890625,-0.02783203125,0.040771484375,0.00011444091796875,-0.003387451171875,0.0006256103515625,0.0220947265625,-0.04443359375,0.0458984375,0.01336669921875,-0.0283203125,-0.015869140625,0.052001953125,0.012451171875,0.0164794921875,0.00799560546875,-0.0267333984375,0.004119873046875,0.00811767578125,0.006256103515625,-0.0027008056640625,0.000457763671875,-0.04833984375,-0.0164794921875,-0.0458984375,0.01556396484375,0.000499725341796875,0.011474609375,0.0400390625,0.0021820068359375,-0.013916015625,0.01611328125,-0.016845703125,-0.03271484375,-0.005859375,-0.0120849609375,-0.0052490234375,0.01708984375,0.00726318359375,-0.006439208984375,0.003997802734375,0.04931640625,-0.017333984375,0.0003414154052734375,0.006805419921875,-0.0027923583984375,-0.0011138916015625,-0.0164794921875,-0.007781982421875,0.0242919921875,0.017822265625,-0.002777099609375,0.0038604736328125,0.0150146484375,-0.004547119140625,-0.002685546875,0.0137939453125,-0.020751953125,0.017578125,0.01611328125,0.0036163330078125,-0.0130615234375,-0.01153564453125,0.00640869140625,0.01361083984375,-0.0033416748046875,0.00238037109375,-0.0250244140625,-0.003753662109375,0.01019287109375,0.0045166015625,-0.025634765625,-0.00018596649169921875,0.037353515625,-0.039306640625,-0.0164794921875,-0.0301513671875,0.0152587890625,-0.017333984375,-0.0018768310546875,0.0245361328125,0.01214599609375,0.0150146484375,0.000247955322265625,0.02294921875,-0.0186767578125,-0.01287841796875,-0.006622314453125,0.0123291015625,0.006134033203125,-0.01092529296875,-0.0186767578125,-0.0091552734375,-0.0059814453125,0.055908203125,0.017822265625,0.0106201171875,-0.0050048828125,0.01300048828125,0.005096435546875,0.01019287109375,0.006134033203125,0.01251220703125,0.0220947265625,0.0120849609375,-0.024658203125,-0.0002117156982421875,0.0024261474609375,0.006622314453125,-0.007781982421875,0.0179443359375,0.0242919921875,-0.00982666015625,-0.0069580078125,0.0111083984375,-0.0169677734375,-0.035400390625,-0.00141143798828125,0.01214599609375,0.007720947265625,-0.030517578125,-0.025390625,0.0023956298828125,-0.0196533203125,0.01300048828125,0.06591796875,0.01470947265625,0.0152587890625,-0.0172119140625,0.0179443359375,0.0263671875,0.018310546875,-0.002716064453125,-0.0257568359375,0.02001953125,-0.00025177001953125,-0.018310546875,0.0208740234375,0.01336669921875,-0.00970458984375,-0.0130615234375,0.0157470703125,-0.035400390625,0.0164794921875,0.002532958984375,-0.005645751953125,-0.000171661376953125,-0.0030364990234375,-0.0279541015625,0.00015735626220703125,-0.01043701171875,0.0203857421875,-0.0179443359375,0.016845703125,0.02392578125,0.050048828125,0.0108642578125,-0.0264892578125,-0.00185394287109375,0.005950927734375,-0.018310546875,0.009765625,-0.00787353515625,0.01043701171875,-0.043701171875,0.0115966796875,-0.0260009765625,0.0220947265625,0.02294921875,0.02294921875,0.02490234375,-0.01287841796875,-0.0234375,-0.01300048828125,0.0059814453125,-0.0048828125,-0.0252685546875,0.0263671875,0.007049560546875,-0.0018157958984375,0.00421142578125,-0.04248046875,-0.0022430419921875,-0.01055908203125,-0.0142822265625,0.01409912109375,-0.00799560546875,-0.00604248046875,0.007781982421875,-0.01416015625,-0.0038909912109375,0.007171630859375,0.00970458984375,-0.001495361328125,0.003936767578125,-0.037353515625,-0.0238037109375,0.005706787109375,-0.0283203125,0.01287841796875,0.0086669921875,0.01470947265625,-0.0174560546875,0.0223388671875,-0.03662109375,0.00653076171875,-0.00927734375,-0.004150390625,-0.0242919921875,-0.032958984375,0.0145263671875,0.0014495849609375,-0.00823974609375,-0.028564453125,-0.013427734375,0.0294189453125,0.04931640625,0.0162353515625,-0.0230712890625,0.00787353515625,0.00933837890625,-0.0091552734375,0.030517578125,-0.044921875,0.01190185546875,-0.002532958984375,0.038330078125,-0.00244140625,0.0157470703125,0.016845703125,-0.0498046875,-0.000453948974609375,-0.0478515625,-0.01190185546875,0.043701171875,0.0213623046875,0.0036773681640625,0.00640869140625,0.000885009765625,0.0108642578125,0.032958984375,-0.0245361328125,0.03955078125,0.0089111328125,0.00286865234375,-0.0028228759765625,-0.007171630859375,0.0281982421875,-0.04296875,0.00372314453125,0.0283203125,0.021240234375,0.01904296875,-0.0108642578125,-0.0286865234375,0.00170135498046875,-0.049072265625,0.00531005859375,-0.0057373046875,-0.01190185546875,0.0137939453125,-0.00396728515625,-0.013916015625,0.0025634765625,0.0225830078125,0.01519775390625,0.0137939453125,-0.004669189453125,0.0150146484375,0.0146484375,-0.00067138671875,-0.004913330078125,-0.018310546875,-0.04296875,-0.056640625,-0.03515625,-0.0274658203125,0.0301513671875,0.0069580078125,0.029296875,0.001922607421875,0.0057373046875,0.0135498046875,0.00286865234375,0.020263671875,0.01397705078125,-0.0012969970703125,0.00225830078125,-0.01116943359375,0.0189208984375,-0.01361083984375,0.007232666015625,0.0233154296875,0.018310546875,0.04052734375,0.01263427734375,0.016845703125,-0.0069580078125,-0.005859375,-0.04052734375,-0.009521484375,0.0038604736328125,-0.00140380859375,0.02099609375,-0.0096435546875,0.01544189453125,0.0220947265625,0.00634765625,-0.0003070831298828125,-0.0322265625,0.00121307373046875,0.01446533203125,0.01470947265625,0.0023345947265625,0.024169921875,0.01397705078125,-0.0107421875,-0.00823974609375,0.01068115234375,0.03466796875,0.024169921875,-0.01409912109375,-0.00799560546875,0.0196533203125,0.006988525390625,-0.00128936767578125,0.033935546875,-0.00653076171875,0.044189453125,-0.01007080078125,-0.00848388671875,0.018310546875,0.034423828125,0.00921630859375,-0.037109375,0.0033416748046875,-0.0186767578125,0.01263427734375,0.028564453125,0.00616455078125,0.0029296875,-0.01519775390625,-0.03125,-0.005126953125,0.004852294921875,0.016845703125,0.0035400390625,-0.031494140625,-0.00176239013671875,0.02783203125,-0.00927734375,-0.0128173828125,-0.004302978515625,-0.050537109375,-0.0245361328125,0.00015354156494140625,0.0029449462890625,0.035888671875,-0.00335693359375,0.057373046875,0.0034942626953125,0.0235595703125,0.00176239013671875,-0.0123291015625,-0.03662109375,0.0002880096435546875,-0.053466796875,0.006439208984375,-0.002197265625,-0.00007104873657226562,0.021484375,-0.005279541015625,0.044677734375,-0.0308837890625,-0.0024261474609375,-0.01361083984375,-0.0036773681640625,-0.01092529296875,0.003387451171875,0.00127410888671875,0.005462646484375,0.01556396484375,0.004364013671875,0.0478515625,0.002685546875,-0.004852294921875,0.020751953125,-0.003936767578125,0.03515625,0.005615234375,0.0145263671875,0.006134033203125,-0.01043701171875,-0.0089111328125,0.0179443359375,0.009521484375,-0.01373291015625,0.01361083984375,-0.06298828125,-0.000499725341796875,0.028564453125,0.028564453125,-0.022216796875,0.00970458984375,-0.0021514892578125,-0.0076904296875,0.05859375,-0.002410888671875,-0.07763671875,0.0211181640625,0.0211181640625,0.004241943359375,-0.004913330078125,0.06884765625,-0.028564453125,-0.0296630859375,-0.0556640625,0.0084228515625,0.0033416748046875,-0.005645751953125,-0.0142822265625,-0.0108642578125,0.011962890625,-0.030029296875,-0.00677490234375,0.0169677734375,-0.00146484375,0.005859375,0.005828857421875,0.00848388671875,0.0211181640625,0.030517578125,0.014892578125,-0.032470703125,-0.010986328125,0.006683349609375,-0.0010986328125,0.0004520416259765625,0.003448486328125,0.01055908203125],"index":0,"object":"embedding"}],"model":"doubao-embedding-vision","object":"list","usage":{"prompt_tokens":23,"total_tokens":23}}` + +const volcengineAgentEmbeddingResponse = `{"created":1791450147,"id":"0217914501476757820404c56ac6dd9ce215ba8b602495ab75245","data":[{"embedding":[0.036865234375,-0.02392578125,-0.01495361328125,0.0201416015625,-0.010986328125,0.0225830078125,-0.0137939453125,0.016845703125,-0.002166748046875,-0.00592041015625,-0.0002593994140625,-0.042236328125,0.03466796875,-0.01165771484375,-0.0189208984375,0.016357421875,-0.0419921875,0.0302734375,0.00823974609375,-0.007080078125,0.00115203857421875,0.023681640625,-0.0107421875,0.0072021484375,-0.01025390625,0.035888671875,0.00165557861328125,0.0130615234375,0.00262451171875,-0.031494140625,0.01251220703125,0.02587890625,-0.01202392578125,-0.0022735595703125,0.00543212890625,0.0291748046875,0.0115966796875,-0.0033111572265625,-0.00799560546875,-0.004302978515625,0.0101318359375,0.0106201171875,0.036865234375,0.00567626953125,-0.0033721923828125,0.012939453125,-0.04638671875,-0.0181884765625,-0.0086669921875,-0.0341796875,0.0279541015625,0.00799560546875,0.0030975341796875,-0.0152587890625,-0.0017242431640625,-0.00469970703125,0.0244140625,0.0027313232421875,-0.0115966796875,-0.005340576171875,0.02978515625,-0.007080078125,0.0625,0.001983642578125,-0.00323486328125,-0.0166015625,-0.0390625,-0.0184326171875,0.016357421875,-0.00173187255859375,-0.01007080078125,0.0272216796875,-0.002685546875,-0.0390625,-0.039306640625,0.032470703125,0.031982421875,-0.0250244140625,-0.0113525390625,0.01611328125,-0.031982421875,-0.03125,0.0037841796875,-0.0306396484375,-0.0024871826171875,0.0224609375,-0.014892578125,0.01214599609375,0.02734375,0.0125732421875,0.02392578125,0.01123046875,0.0186767578125,0.003448486328125,0.006195068359375,-0.022705078125,-0.00115203857421875,-0.001800537109375,0.001129150390625,-0.032958984375,0.00701904296875,-0.05029296875,-0.002655029296875,0.004791259765625,0.026123046875,-0.0174560546875,0.013427734375,0.033203125,-0.000530242919921875,-0.01348876953125,-0.0302734375,0.026611328125,-0.052490234375,-0.026123046875,0.032470703125,-0.00016117095947265625,-0.003631591796875,0.032470703125,0.06201171875,-0.03515625,-0.0322265625,-0.0269775390625,0.004241943359375,0.030517578125,0.044189453125,-0.0250244140625,-0.0052490234375,-0.031005859375,0.02685546875,0.010009765625,0.01904296875,-0.020263671875,-0.00494384765625,-0.0115966796875,0.02197265625,-0.036865234375,-0.004730224609375,-0.0159912109375,0.00160980224609375,0.00701904296875,-0.00035858154296875,-0.015625,-0.006927490234375,-0.0361328125,-0.026123046875,0.000885009765625,-0.1416015625,-0.00762939453125,-0.025390625,0.01531982421875,0.0003871917724609375,0.004730224609375,-0.00067901611328125,-0.00469970703125,0.0093994140625,-0.00958251953125,0.0096435546875,0.0228271484375,-0.005523681640625,-0.001129150390625,0.017333984375,-0.000492095947265625,-0.0089111328125,-0.0103759765625,-0.00872802734375,0.0126953125,-0.020751953125,0.00396728515625,0.036865234375,-0.029052734375,0.0025482177734375,0.0169677734375,-0.0130615234375,-0.001708984375,-0.0030517578125,0.0002574920654296875,0.0126953125,-0.00885009765625,-0.0213623046875,-0.0098876953125,0.003143310546875,-0.041259765625,0.00994873046875,0.00958251953125,0.01324462890625,-0.034912109375,-0.00921630859375,-0.014404296875,0.035400390625,0.024658203125,0.01123046875,-0.0147705078125,-0.0286865234375,0.004241943359375,0.01141357421875,-0.00086212158203125,0.0108642578125,-0.01708984375,-0.0028228759765625,-0.007537841796875,0.021240234375,0.01287841796875,0.00372314453125,0.0177001953125,0.017578125,-0.004241943359375,0.002471923828125,0.04052734375,0.036865234375,0.039306640625,-0.035400390625,0.018310546875,0.0030975341796875,0.0133056640625,-0.008056640625,0.0250244140625,-0.031005859375,-0.03271484375,0.006011962890625,0.0157470703125,-0.00830078125,-0.01611328125,0.015625,-0.0025787353515625,0.029541015625,0.031005859375,0.0294189453125,-0.009033203125,0.01531982421875,-0.0216064453125,-0.041015625,-0.033935546875,0.01806640625,0.02587890625,-0.018798828125,-0.00958251953125,0.03466796875,0.01544189453125,-0.0291748046875,-0.01397705078125,-0.0028533935546875,0.041015625,-0.02978515625,0.01202392578125,0.00262451171875,-0.0224609375,-0.04931640625,-0.0703125,0.0301513671875,0.07177734375,-0.0064697265625,-0.037841796875,0.00131988525390625,-0.040771484375,0.051513671875,-0.00762939453125,0.017333984375,-0.013671875,-0.015869140625,-0.01214599609375,0.018310546875,0.039306640625,0.026123046875,0.0101318359375,-0.0184326171875,-0.01116943359375,-0.028076171875,0.00775146484375,0.0086669921875,-0.00970458984375,0.006622314453125,-0.034912109375,-0.01422119140625,-0.005401611328125,0.02587890625,0.003692626953125,0.0159912109375,-0.000530242919921875,-0.003509521484375,0.011962890625,-0.00970458984375,0.072265625,0.0250244140625,0.02099609375,0.04345703125,-0.00109100341796875,0.00787353515625,0.0159912109375,0.0137939453125,0.0177001953125,0.0177001953125,0.0010833740234375,-0.0322265625,0.032470703125,-0.0045166015625,0.048828125,-0.0031890869140625,-0.0240478515625,-0.0023040771484375,-0.01324462890625,0.01202392578125,0.0206298828125,-0.00836181640625,0.0023040771484375,0.043701171875,-0.0115966796875,-0.041259765625,0.01239013671875,-0.0250244140625,-0.004302978515625,-0.034423828125,0.01251220703125,-0.0235595703125,0.00433349609375,-0.0030975341796875,0.01123046875,-0.04345703125,0.008056640625,0.004913330078125,0.01214599609375,0.01129150390625,0.0218505859375,0.01470947265625,0.000850677490234375,0.01007080078125,-0.02587890625,-0.0244140625,-0.01123046875,-0.015625,0.000888824462890625,-0.0042724609375,-0.0228271484375,-0.0400390625,-0.00225830078125,-0.0205078125,0.05615234375,-0.0107421875,0.008544921875,0.021484375,-0.006011962890625,0.020751953125,-0.0380859375,-0.0164794921875,0.018798828125,0.052978515625,0.00147247314453125,0.004547119140625,0.00000356137752532959,-0.0040283203125,-0.0167236328125,0.00628662109375,-0.029052734375,0.0032806396484375,-0.007080078125,-0.001495361328125,-0.01055908203125,-0.02197265625,-0.0115966796875,-0.0018463134765625,-0.023193359375,-0.01080322265625,0.01312255859375,0.014892578125,0.0181884765625,0.003265380859375,-0.026123046875,0.033203125,0.0203857421875,0.0107421875,0.0020751953125,0.025390625,0.01275634765625,-0.0233154296875,0.0164794921875,0.007293701171875,0.000518798828125,-0.025146484375,0.032470703125,-0.0101318359375,-0.00830078125,-0.0174560546875,0.000186920166015625,-0.0244140625,-0.00628662109375,0.0206298828125,0.00653076171875,0.0206298828125,0.023681640625,-0.037109375,-0.0162353515625,0.00665283203125,0.01422119140625,-0.05078125,-0.048828125,-0.0262451171875,0.0284423828125,-0.0250244140625,-0.00030517578125,-0.041259765625,0.0167236328125,0.01953125,-0.0113525390625,-0.020263671875,0.0048828125,0.0302734375,-0.0654296875,-0.006561279296875,-0.01141357421875,-0.0233154296875,-0.0224609375,0.0028228759765625,-0.045654296875,0.04052734375,0.00225830078125,0.0034942626953125,-0.0133056640625,-0.0213623046875,-0.00921630859375,-0.0052490234375,0.01434326171875,0.0172119140625,0.00009965896606445312,-0.0064697265625,-0.00469970703125,0.0157470703125,-0.045654296875,-0.0133056640625,0.005828857421875,0.004974365234375,0.0052490234375,-0.0057373046875,0.0224609375,0.001800537109375,0.0037384033203125,0.016845703125,-0.0014801025390625,0.0147705078125,0.0019378662109375,-0.0003509521484375,-0.00159454345703125,0.018310546875,-0.01611328125,0.004791259765625,0.00119781494140625,0.0137939453125,-0.0091552734375,0.0201416015625,-0.024658203125,0.0478515625,-0.00506591796875,0.0030975341796875,0.00933837890625,-0.0361328125,-0.0233154296875,-0.029052734375,0.0177001953125,0.0145263671875,0.0224609375,0.00811767578125,0.019775390625,-0.01422119140625,-0.03759765625,-0.0255126953125,0.025146484375,-0.0140380859375,0.033447265625,-0.058349609375,-0.015869140625,0.00823974609375,0.03466796875,0.00095367431640625,-0.00015354156494140625,0.0478515625,-0.010009765625,0.0169677734375,0.0167236328125,-0.0224609375,-0.03173828125,0.0341796875,-0.000640869140625,-0.06298828125,0.004669189453125,0.0166015625,0.0208740234375,0.0155029296875,0.02587890625,0.0240478515625,0.00994873046875,0.0361328125,-0.004608154296875,-0.0072021484375,0.00830078125,0.000598907470703125,0.0038604736328125,-0.01287841796875,0.01953125,0.00921630859375,-0.005096435546875,-0.00250244140625,-0.02392578125,0.026611328125,0.01019287109375,0.032958984375,0.006988525390625,0.01141357421875,0.022216796875,0.000461578369140625,0.0002613067626953125,0.0478515625,0.0284423828125,-0.00160980224609375,-0.0091552734375,0.004180908203125,-0.00885009765625,0.01123046875,0.0255126953125,0.00689697265625,-0.00665283203125,0.009521484375,0.04345703125,-0.000957489013671875,0.0172119140625,0.011962890625,-0.0096435546875,0.0201416015625,-0.018798828125,0.0133056640625,0.0014801025390625,-0.051025390625,-0.0255126953125,0.01507568359375,-0.01953125,0.00994873046875,-0.0115966796875,0.051025390625,0.0255126953125,-0.01080322265625,0.08642578125,0.00982666015625,0.0225830078125,0.006561279296875,-0.019287109375,0.017333984375,-0.031982421875,-0.00390625,0.0269775390625,-0.0233154296875,-0.0029144287109375,0.0005645751953125,-0.0004444122314453125,-0.0240478515625,0.03466796875,0.0086669921875,-0.009765625,-0.0308837890625,-0.00372314453125,0.0205078125,0.05908203125,-0.01251220703125,0.0068359375,0.039306640625,-0.0145263671875,0.0019378662109375,-0.01611328125,0.02880859375,0.000942230224609375,-0.033935546875,-0.0059814453125,-0.0030059814453125,0.01416015625,0.0283203125,-0.01312255859375,-0.005615234375,0.033203125,-0.00124359130859375,0.005157470703125,-0.0184326171875,0.0272216796875,0.01104736328125,-0.0244140625,-0.028076171875,0.006378173828125,-0.004425048828125,-0.00010776519775390625,0.006072998046875,-0.0052490234375,0.0264892578125,0.020263671875,-0.01385498046875,0.016845703125,0.00811767578125,-0.0250244140625,0.018798828125,-0.00482177734375,-0.0283203125,0.026123046875,0.0380859375,0.0157470703125,0.00970458984375,-0.014404296875,-0.00665283203125,0.005615234375,0.032470703125,-0.025390625,-0.0079345703125,0.021728515625,-0.00994873046875,-0.02099609375,0.038818359375,0.0074462890625,-0.003173828125,0.019775390625,0.0089111328125,-0.01171875,-0.0147705078125,-0.005523681640625,0.0078125,-0.01275634765625,0.0308837890625,0.00909423828125,0.0211181640625,0.0269775390625,0.0286865234375,-0.0021514892578125,-0.00848388671875,0.00152587890625,0.0050048828125,-0.0079345703125,-0.0302734375,0.01251220703125,0.0133056640625,-0.0019073486328125,0.036865234375,-0.007171630859375,-0.0269775390625,-0.01806640625,-0.00970458984375,0.009765625,0.01031494140625,0.004302978515625,0.0250244140625,-0.003509521484375,-0.0106201171875,0.0022735595703125,0.002166748046875,0.00860595703125,-0.02978515625,-0.044921875,0.0380859375,0.01904296875,0.020263671875,-0.04736328125,0.00531005859375,0.0250244140625,-0.01953125,0.0125732421875,-0.01531982421875,-0.05029296875,-0.00653076171875,0.012939453125,0.01019287109375,0.0031890869140625,-0.0184326171875,0.0302734375,0.033203125,0.018798828125,0.0294189453125,-0.003692626953125,-0.021484375,-0.006256103515625,0.007110595703125,0.0203857421875,-0.00421142578125,-0.0108642578125,0.048095703125,-0.037353515625,0.000827789306640625,-0.032958984375,0.058349609375,0.026611328125,-0.002716064453125,0.0084228515625,-0.038330078125,0.0225830078125,-0.0703125,0.00897216796875,0.01507568359375,0.0166015625,-0.0078125,-0.05078125,0.0045166015625,-0.01104736328125,-0.00994873046875,0.0089111328125,0.005340576171875,0.0361328125,0.00506591796875,0.004547119140625,-0.03564453125,0.0096435546875,0.00183868408203125,0.03173828125,-0.03271484375,-0.01324462890625,0.0067138671875,0.0162353515625,-0.0224609375,-0.006195068359375,0.0478515625,0.01611328125,-0.0081787109375,0.006622314453125,-0.00726318359375,0.0224609375,0.0028533935546875,-0.013671875,0.01385498046875,-0.03173828125,-0.0162353515625,0.01422119140625,-0.0020599365234375,-0.004669189453125,-0.003448486328125,-0.0279541015625,-0.0247802734375,-0.042724609375,-0.01611328125,-0.08984375,-0.01220703125,0.0081787109375,0.0250244140625,0.0283203125,0.0286865234375,0.0017242431640625,-0.00531005859375,-0.0198974609375,0.0174560546875,0.00323486328125,-0.01312255859375,0.01025390625,0.0216064453125,0.0003509521484375,-0.0032196044921875,-0.012939453125,0.023681640625,-0.052490234375,-0.01275634765625,-0.0079345703125,0.019287109375,-0.042236328125,0.01129150390625,-0.01251220703125,-0.02587890625,-0.0206298828125,-0.018798828125,-0.0302734375,-0.00341796875,-0.0206298828125,-0.01104736328125,-0.00341796875,0.0068359375,-0.01220703125,0.006256103515625,0.0194091796875,-0.0093994140625,-0.02001953125,0.01239013671875,0.00119781494140625,0.018798828125,-0.00848388671875,-0.011962890625,0.009521484375,-0.0189208984375,-0.0125732421875,-0.0147705078125,-0.0167236328125,0.0118408203125,-0.01708984375,-0.0162353515625,0.023193359375,0.0022125244140625,-0.00579833984375,-0.006561279296875,0.0031280517578125,0.03271484375,-0.00628662109375,0.00799560546875,-0.0010833740234375,-0.030517578125,0.006622314453125,0.01361083984375,0.017578125,0.000244140625,0.01007080078125,-0.01116943359375,0.0234375,0.004852294921875,-0.00946044921875,0.01220703125,-0.00848388671875,0.043212890625,0.01287841796875,0.02392578125,0.01202392578125,-0.036376953125,0.006744384765625,0.01007080078125,0.01434326171875,-0.00994873046875,0.00885009765625,-0.016845703125,0.00958251953125,0.0235595703125,0.0177001953125,-0.0155029296875,-0.003509521484375,0.002166748046875,0.000934600830078125,0.0031280517578125,-0.036376953125,-0.048095703125,-0.014404296875,0.0037384033203125,0.0361328125,-0.0032196044921875,-0.0203857421875,-0.001678466796875,-0.00958251953125,0.0228271484375,0.00457763671875,0.03173828125,0.00136566162109375,0.0220947265625,-0.01239013671875,0.032470703125,-0.02587890625,-0.004119873046875,-0.01165771484375,-0.0308837890625,0.005859375,-0.0040283203125,0.02880859375,0.03369140625,-0.01470947265625,-0.010986328125,-0.033935546875,0.026123046875,0.0159912109375,0.0167236328125,-0.0169677734375,0.01214599609375,-0.00823974609375,-0.0081787109375,0.021240234375,0.033935546875,-0.0189208984375,0.021484375,0.017333984375,0.01068115234375,-0.0157470703125,0.0240478515625,-0.030517578125,0.01458740234375,-0.0118408203125,-0.015625,0.0003452301025390625,0.00994873046875,-0.026611328125,0.028076171875,0.0159912109375,0.00106048583984375,0.013671875,0.00396728515625,-0.0057373046875,-0.0014801025390625,-0.016357421875,0.00994873046875,0.040283203125,0.02880859375,0.00128936767578125,-0.037353515625,0.007110595703125,0.0037384033203125,-0.00170135498046875,0.01458740234375,-0.0123291015625,-0.016357421875,-0.007110595703125,0.010009765625,0.01611328125,0.0169677734375,0.006378173828125,0.03369140625,-0.002166748046875,0.031005859375,0.019775390625,0.007354736328125,-0.00360107421875,-0.0206298828125,0.0093994140625,-0.00000959634780883789,-0.0027008056640625,-0.0166015625,-0.03466796875,-0.0234375,0.023193359375,0.00008153915405273438,-0.06787109375,0.031494140625,-0.007080078125,0.01214599609375,-0.0198974609375,-0.0242919921875,0.00156402587890625,-0.024658203125,-0.0181884765625,0.0205078125,-0.00811767578125,0.00738525390625,-0.0137939453125,-0.0013580322265625,0.00860595703125,-0.050048828125,-0.0157470703125,-0.0206298828125,-0.001312255859375,0.0028533935546875,0.0244140625,-0.00616455078125,-0.0091552734375,0.0140380859375,0.02685546875,-0.0213623046875,0.044677734375,0.0022125244140625,-0.0205078125,-0.00775146484375,-0.0186767578125,-0.033447265625,-0.00077056884765625,0.048095703125,-0.0031280517578125,0.0027923583984375,-0.03125,-0.005706787109375,-0.02099609375,-0.0198974609375,-0.01806640625,0.023193359375,-0.0390625,-0.017333984375,0.031005859375,-0.0020599365234375,0.0010528564453125,0.0012054443359375,0.011962890625,-0.03955078125,0.0074462890625,0.03759765625,-0.03466796875,0.004119873046875,0.001312255859375,-0.0126953125,-0.0269775390625,-0.00885009765625,-0.033935546875,-0.006072998046875,0.00408935546875,-0.0184326171875,-0.002166748046875,0.0244140625,0.0137939453125,0.017333984375,0.026611328125,-0.002532958984375,0.02099609375,0.0205078125,-0.0194091796875,0.0247802734375,0.026611328125,0.0255126953125,0.0264892578125,-0.01507568359375,-0.01611328125,0.034912109375,0.0174560546875,-0.0093994140625,-0.0028533935546875,0.00299072265625,-0.010498046875,0.0169677734375,-0.00150299072265625,0.01214599609375,0.0140380859375,-0.043212890625,-0.01251220703125,0.01251220703125,-0.01239013671875,0.00616455078125,0.01806640625,-0.00946044921875,0.01513671875,-0.000385284423828125,-0.0191650390625,-0.026611328125,-0.035888671875,0.0283203125,0.03857421875,0.007476806640625,0.0162353515625,0.00579833984375,0.00946044921875,-0.0166015625,-0.0240478515625,-0.0179443359375,0.007354736328125,0.0113525390625,0.018798828125,0.0247802734375,-0.0089111328125,-0.033447265625,-0.013427734375,-0.0064697265625,0.004913330078125,-0.0244140625,0.00592041015625,0.001953125,0.0225830078125,-0.006195068359375,0.006378173828125,-0.0205078125,-0.000270843505859375,0.01123046875,0.04638671875,-0.0179443359375,0.0198974609375,0.0086669921875,0.00823974609375,0.0189208984375,-0.0257568359375,-0.0191650390625,0.020263671875,-0.020263671875,0.0048828125,0.018310546875,0.044921875,-0.006072998046875,0.01214599609375,-0.0166015625,0.01220703125,-0.0390625,0.004608154296875,0.01220703125,-0.01141357421875,0.0166015625,0.0035552978515625,-0.02099609375,0.006256103515625,-0.0169677734375,-0.011474609375,0.020751953125,0.0306396484375,-0.052978515625,0.010498046875,-0.0030059814453125,-0.006103515625,-0.005218505859375,-0.004791259765625,-0.0198974609375,0.0086669921875,-0.004669189453125,-0.0118408203125,0.026123046875,-0.003173828125,0.033935546875,0.0201416015625,-0.0167236328125,0.0169677734375,0.0052490234375,-0.0234375,0.0036773681640625,0.0005645751953125,0.037841796875,-0.0064697265625,0.00128936767578125,-0.00396728515625,-0.0064697265625,0.025390625,-0.04345703125,0.046875,-0.00131988525390625,0.01019287109375,0.01220703125,-0.00118255615234375,-0.00897216796875,-0.01068115234375,0.020263671875,0.0179443359375,-0.0030364990234375,-0.01177978515625,-0.0247802734375,-0.01123046875,0.006805419921875,0.046875,-0.039794921875,-0.000762939453125,-0.0052490234375,-0.01348876953125,0.01007080078125,-0.0247802734375,0.01068115234375,-0.0107421875,0.000782012939453125,-0.001617431640625,-0.008056640625,-0.01806640625,-0.01416015625,-0.006011962890625,0.0189208984375,-0.0145263671875,-0.01068115234375,0.0164794921875,0.0162353515625,-0.000637054443359375,0.016357421875,0.00067901611328125,0.006439208984375,-0.007659912109375,0.013671875,-0.00124359130859375,0.002105712890625,-0.01214599609375,-0.0185546875,0.009765625,0.04345703125,0.033203125,-0.018798828125,-0.00390625,0.01397705078125,0.01544189453125,-0.019287109375,0.0074462890625,-0.019287109375,0.0072021484375,-0.043212890625,0.01611328125,-0.011962890625,0.0228271484375,0.0021209716796875,-0.0244140625,-0.01953125,-0.0218505859375,0.00116729736328125,0.010498046875,0.0291748046875,0.0294189453125,0.00848388671875,-0.00994873046875,0.000537872314453125,-0.000873565673828125,-0.0341796875,-0.0294189453125,0.004150390625,-0.07275390625,-0.008544921875,-0.009765625,-0.035400390625,-0.004791259765625,0.0101318359375,0.018310546875,0.000759124755859375,0.00927734375,-0.0118408203125,-0.023193359375,0.008056640625,-0.0206298828125,-0.03564453125,-0.00628662109375,-0.01165771484375,0.016845703125,-0.0216064453125,0.01324462890625,0.005096435546875,0.008056640625,0.00811767578125,0.016357421875,0.01165771484375,0.060546875,-0.05224609375,-0.0458984375,-0.016845703125,-0.0169677734375,-0.01220703125,-0.0225830078125,0.00848388671875,0.03466796875,0.0299072265625,-0.00030517578125,0.0155029296875,-0.0098876953125,0.022705078125,0.013671875,-0.0126953125,-0.000396728515625,0.0216064453125,-0.0078125,0.010498046875,0.0211181640625,0.0205078125,-0.045654296875,0.00775146484375,0.012939453125,0.0185546875,0.038330078125,-0.0201416015625,-0.033935546875,0.032470703125,-0.00360107421875,0.021240234375,-0.0189208984375,0.0020599365234375,0.025390625,0.0002422332763671875,-0.04541015625,0.033203125,0.045166015625,0.0206298828125,0.005706787109375,-0.0096435546875,-0.00555419921875,-0.0262451171875,0.00150299072265625,0.010986328125,-0.029541015625,-0.01507568359375,0.03515625,-0.024658203125,0.0257568359375,-0.006195068359375,0.022705078125,-0.0284423828125,0.0111083984375,0.0029296875,-0.00457763671875,-0.022216796875,-0.02587890625,0.004486083984375,0.002166748046875,-0.0284423828125,-0.02099609375,-0.049560546875,0.018798828125,-0.03369140625,-0.01031494140625,-0.01348876953125,-0.00970458984375,0.004638671875,-0.006103515625,0.00244140625,-0.003997802734375,-0.03662109375,0.0517578125,-0.0230712890625,-0.048095703125,-0.0020751953125,0.001129150390625,0.003265380859375,0.02392578125,0.006011962890625,0.005157470703125,0.028076171875,-0.0014190673828125,0.004241943359375,0.007568359375,-0.02392578125,-0.00469970703125,0.046630859375,-0.004241943359375,-0.00762939453125,0.01214599609375,0.0068359375,0.0167236328125,-0.031982421875,0.0242919921875,-0.00982666015625,-0.01806640625,-0.029541015625,-0.011962890625,0.023681640625,-0.00946044921875,0.0140380859375,-0.0279541015625,0.01220703125,-0.037841796875,-0.00848388671875,0.0078125,0.012939453125,0.0257568359375,-0.0302734375,0.0108642578125,0.02880859375,-0.025390625,-0.01953125,-0.0057373046875,0.0250244140625,0.0048828125,-0.004302978515625,0.00616455078125,-0.01348876953125,-0.01220703125,0.0016632080078125,0.01397705078125,0.01202392578125,0.02978515625,0.021484375,-0.00689697265625,0.031005859375,0.00701904296875,0.033203125,0.002532958984375,-0.0185546875,0.03369140625,-0.0068359375,-0.007171630859375,0.00506591796875,-0.0194091796875,-0.006744384765625,0.00616455078125,0.01348876953125,-0.00592041015625,-0.00946044921875,-0.0213623046875,-0.00518798828125,-0.0201416015625,-0.035888671875,-0.000396728515625,0.0021209716796875,0.0247802734375,0.01953125,-0.014892578125,0.020263671875,-0.0048828125,0.0625,0.0137939453125,0.004913330078125,-0.0020294189453125,-0.02734375,-0.0244140625,-0.0361328125,0.02294921875,0.020263671875,0.0133056640625,0.00958251953125,0.003326416015625,0.06396484375,0.032958984375,0.020263671875,0.0166015625,0.001312255859375,-0.04541015625,0.00958251953125,-0.017333984375,0.0234375,-0.05322265625,0.00506591796875,0.038818359375,-0.031494140625,-0.014404296875,-0.0019073486328125,-0.0390625,0.04541015625,0.0137939453125,-0.00823974609375,0.01092529296875,-0.03466796875,0.029541015625,0.039306640625,-0.0205078125,-0.0308837890625,0.0022125244140625,0.00830078125,-0.00160980224609375,0.00262451171875,-0.032470703125,-0.0262451171875,-0.025390625,-0.01458740234375,0.0101318359375,-0.02587890625,-0.0224609375,0.0206298828125,0.039794921875,-0.03759765625,0.0458984375,0.032470703125,0.01312255859375,-0.0003681182861328125,0.023681640625,0.01251220703125,0.0228271484375,-0.0220947265625,0.009033203125,0.0224609375,-0.01239013671875,0.007080078125,-0.00811767578125,0.0283203125,0.0078125,-0.0299072265625,0.0159912109375,-0.0079345703125,-0.01214599609375,-0.009521484375,0.01214599609375,0.048095703125,0.0306396484375,0.0084228515625,0.0244140625,-0.0152587890625,-0.010009765625,0.020751953125,-0.0279541015625,-0.0181884765625,0.0301513671875,0.00738525390625,0.02685546875,0.041259765625,-0.00141143798828125,0.0419921875,0.03271484375,-0.01031494140625,0.0033111572265625,0.061279296875,-0.0284423828125,-0.0152587890625,0.0185546875,0.036865234375,-0.043212890625,0.001434326171875,0.00174713134765625,0.0002536773681640625,-0.0098876953125,-0.0220947265625,-0.01251220703125,0.0203857421875,0.009033203125,-0.03662109375,-0.003509521484375,0.00946044921875,-0.01275634765625,-0.04931640625,0.01708984375,-0.04638671875,-0.01458740234375,0.00830078125,0.027587890625,-0.0184326171875,-0.01953125,-0.02880859375,0.0029296875,0.01422119140625,0.0059814453125,0.005126953125,0.0106201171875,-0.0272216796875,-0.035888671875,0.023193359375,-0.0235595703125,0.02978515625,0.0123291015625,-0.007354736328125,-0.0089111328125,0.018798828125,0.017333984375,0.01043701171875,0.0283203125,-0.013671875,0.017333984375,0.003173828125,-0.001953125,0.0004425048828125,0.0028076171875,-0.0673828125,-0.00188446044921875,0.03466796875,-0.0020294189453125,0.000568389892578125,0.0216064453125,0.018798828125,-0.005157470703125,0.004058837890625,-0.0030059814453125,-0.00189208984375,-0.0206298828125,0.0130615234375,-0.01287841796875,-0.00958251953125,0.007354736328125,-0.0108642578125,0.0048828125,0.01348876953125,0.00994873046875,0.0203857421875,0.03564453125,0.029541015625,0.0009307861328125,-0.0106201171875,-0.007110595703125,0.0118408203125,0.036865234375,0.022705078125,0.01806640625,0.06640625,-0.00160980224609375,0.018798828125,0.001953125,0.02734375,-0.00982666015625,-0.018798828125,-0.032958984375,0.0302734375,0.00616455078125,-0.0145263671875,-0.0181884765625,-0.0140380859375,0.00982666015625,0.002288818359375,0.0206298828125,0.0218505859375,-0.008056640625,-0.000720977783203125,0.036865234375,0.004791259765625,-0.0361328125,0.01324462890625,0.000713348388671875,0.0045166015625,-0.0103759765625,0.017333984375,-0.01068115234375,0.007659912109375,-0.0030975341796875,-0.015625,-0.01312255859375,-0.0208740234375,-0.0133056640625,-0.0177001953125,-0.0096435546875,-0.00592041015625,0.009033203125,0.01324462890625,-0.0172119140625,-0.01141357421875,0.009765625,-0.00494384765625,0.01177978515625,0.0174560546875,-0.017822265625,-0.0361328125,-0.0147705078125,0.0206298828125,-0.0299072265625,-0.027587890625,-0.0185546875,-0.0172119140625,0.00665283203125,-0.014404296875,0.028076171875,0.00836181640625,0.051025390625,0.0203857421875,-0.01397705078125,0.007568359375,-0.0262451171875,-0.0234375,-0.0101318359375,0.0032806396484375,-0.0206298828125,0.052490234375,-0.00286865234375,-0.0004596710205078125,-0.0108642578125,0.005157470703125,-0.00016498565673828125,0.0224609375,0.00665283203125,0.039794921875,0.00006961822509765625,0.001861572265625,0.017333984375,0.006622314453125,-0.032470703125,0.031982421875,0.0118408203125,-0.028076171875,-0.00165557861328125,0.12353515625,-0.00262451171875,0.040283203125,-0.0140380859375,-0.01312255859375,0.0177001953125,0.0081787109375,0.00927734375,0.005157470703125,0.04345703125,-0.01068115234375,0.05224609375,0.0101318359375,-0.0286865234375,0.0419921875,-0.0004253387451171875,-0.00274658203125,-0.00135040283203125,0.0225830078125,-0.043212890625,0.048828125,0.01177978515625,-0.02978515625,-0.01507568359375,0.051513671875,0.01214599609375,0.0159912109375,0.0068359375,-0.025390625,0.0036773681640625,0.009033203125,0.0064697265625,-0.0021209716796875,0.00147247314453125,-0.048828125,-0.0174560546875,-0.045654296875,0.0140380859375,-0.00049591064453125,0.01214599609375,0.0419921875,0.00213623046875,-0.01470947265625,0.01513671875,-0.0185546875,-0.031005859375,-0.00616455078125,-0.0115966796875,-0.00634765625,0.0181884765625,0.00958251953125,-0.0042724609375,0.004058837890625,0.048583984375,-0.0186767578125,0.00109100341796875,0.0057373046875,-0.003173828125,-0.0004024505615234375,-0.0172119140625,-0.006195068359375,0.0247802734375,0.01708984375,-0.00445556640625,0.005523681640625,0.0145263671875,-0.004241943359375,-0.0032196044921875,0.01507568359375,-0.02197265625,0.01611328125,0.0169677734375,0.003143310546875,-0.01470947265625,-0.0107421875,0.0064697265625,0.01507568359375,-0.00482177734375,0.00046539306640625,-0.026123046875,-0.00457763671875,0.009033203125,0.005340576171875,-0.025146484375,-0.001220703125,0.036865234375,-0.0390625,-0.017822265625,-0.031494140625,0.014404296875,-0.0177001953125,-0.0020294189453125,0.02587890625,0.01202392578125,0.0140380859375,-0.0004825592041015625,0.024658203125,-0.0166015625,-0.01531982421875,-0.0078125,0.01275634765625,0.006195068359375,-0.0101318359375,-0.0177001953125,-0.0098876953125,-0.00726318359375,0.0576171875,0.01953125,0.01116943359375,-0.00433349609375,0.01361083984375,0.005462646484375,0.01104736328125,0.005523681640625,0.009033203125,0.0244140625,0.01141357421875,-0.02587890625,-0.000934600830078125,0.0020751953125,0.00872802734375,-0.005828857421875,0.017333984375,0.0235595703125,-0.0108642578125,-0.00634765625,0.01214599609375,-0.01531982421875,-0.0361328125,-0.00177764892578125,0.010986328125,0.0091552734375,-0.0294189453125,-0.0244140625,0.00213623046875,-0.0184326171875,0.01361083984375,0.0673828125,0.01434326171875,0.0162353515625,-0.0169677734375,0.0172119140625,0.0255126953125,0.0186767578125,-0.00115966796875,-0.026123046875,0.0196533203125,-0.000957489013671875,-0.0172119140625,0.0216064453125,0.01495361328125,-0.0093994140625,-0.01507568359375,0.016845703125,-0.035888671875,0.01611328125,0.0021209716796875,-0.005340576171875,0.00055694580078125,-0.0021209716796875,-0.0286865234375,-0.0015869140625,-0.0101318359375,0.0196533203125,-0.017333984375,0.01611328125,0.0240478515625,0.05078125,0.01153564453125,-0.026123046875,-0.0029449462890625,0.00823974609375,-0.019287109375,0.01141357421875,-0.00762939453125,0.00921630859375,-0.0439453125,0.0103759765625,-0.02734375,0.0206298828125,0.02392578125,0.0225830078125,0.0247802734375,-0.01171875,-0.0228271484375,-0.01202392578125,0.004241943359375,-0.004791259765625,-0.0234375,0.0262451171875,0.006439208984375,-0.0033111572265625,0.0036773681640625,-0.042724609375,-0.000553131103515625,-0.009521484375,-0.01470947265625,0.01422119140625,-0.007720947265625,-0.006072998046875,0.0086669921875,-0.01495361328125,-0.00634765625,0.006744384765625,0.0107421875,-0.00115203857421875,0.00183868408203125,-0.0361328125,-0.0247802734375,0.006561279296875,-0.0299072265625,0.01239013671875,0.00927734375,0.0147705078125,-0.0177001953125,0.023193359375,-0.0361328125,0.00592041015625,-0.0093994140625,-0.003143310546875,-0.0233154296875,-0.032958984375,0.01531982421875,0.00150299072265625,-0.00701904296875,-0.0279541015625,-0.01202392578125,0.0294189453125,0.05322265625,0.01806640625,-0.024658203125,0.00848388671875,0.01068115234375,-0.0089111328125,0.0308837890625,-0.044189453125,0.01104736328125,-0.00531005859375,0.0390625,-0.00286865234375,0.016357421875,0.01507568359375,-0.051513671875,0.000087738037109375,-0.049560546875,-0.01251220703125,0.0439453125,0.0235595703125,0.0030364990234375,0.005279541015625,0.0010528564453125,0.01068115234375,0.033447265625,-0.025146484375,0.040283203125,0.01019287109375,0.002655029296875,-0.0018157958984375,-0.007293701171875,0.0277099609375,-0.0439453125,0.0023956298828125,0.028076171875,0.021728515625,0.0184326171875,-0.01080322265625,-0.0294189453125,0.000885009765625,-0.048828125,0.004058837890625,-0.007720947265625,-0.0115966796875,0.01348876953125,-0.00341796875,-0.01385498046875,0.003173828125,0.0233154296875,0.0159912109375,0.01361083984375,-0.003936767578125,0.01495361328125,0.01611328125,-0.0024871826171875,-0.00390625,-0.017822265625,-0.042724609375,-0.05810546875,-0.0361328125,-0.02685546875,0.028076171875,0.007720947265625,0.02978515625,0.00299072265625,0.00531005859375,0.01385498046875,0.0028839111328125,0.0174560546875,0.0140380859375,-0.00107574462890625,0.0014495849609375,-0.01251220703125,0.02001953125,-0.0140380859375,0.007293701171875,0.0220947265625,0.0203857421875,0.041748046875,0.01397705078125,0.0167236328125,-0.00628662109375,-0.006744384765625,-0.0390625,-0.00872802734375,0.0032196044921875,-0.001007080078125,0.022216796875,-0.00958251953125,0.0140380859375,0.0213623046875,0.006439208984375,0.00156402587890625,-0.03173828125,-0.000232696533203125,0.01458740234375,0.015869140625,0.0023040771484375,0.0255126953125,0.0147705078125,-0.00958251953125,-0.006744384765625,0.00946044921875,0.033935546875,0.023193359375,-0.01324462890625,-0.006195068359375,0.0191650390625,0.00909423828125,0.0004329681396484375,0.034912109375,-0.00592041015625,0.045654296875,-0.008544921875,-0.007537841796875,0.0194091796875,0.033203125,0.0093994140625,-0.037109375,0.005157470703125,-0.016357421875,0.013427734375,0.02880859375,0.006072998046875,0.004058837890625,-0.01416015625,-0.029541015625,-0.004913330078125,0.00592041015625,0.01806640625,0.002532958984375,-0.031494140625,-0.0020904541015625,0.0286865234375,-0.010498046875,-0.01324462890625,-0.002960205078125,-0.051513671875,-0.02587890625,0.00116729736328125,0.0030975341796875,0.035400390625,-0.005096435546875,0.057373046875,-0.0003795623779296875,0.023193359375,-0.000019550323486328125,-0.01348876953125,-0.036865234375,0.00067901611328125,-0.052978515625,0.0068359375,-0.002410888671875,-0.0020294189453125,0.0191650390625,-0.00396728515625,0.044921875,-0.0308837890625,-0.00183868408203125,-0.0126953125,-0.004364013671875,-0.009765625,0.003509521484375,0.0004825592041015625,0.005157470703125,0.01495361328125,0.005218505859375,0.046630859375,0.00164031982421875,-0.005523681640625,0.0233154296875,-0.006378173828125,0.03369140625,0.005096435546875,0.01513671875,0.006805419921875,-0.01104736328125,-0.01007080078125,0.0191650390625,0.0103759765625,-0.01495361328125,0.013671875,-0.0625,0.00007343292236328125,0.028076171875,0.027587890625,-0.0228271484375,0.009765625,-0.00335693359375,-0.009765625,0.057373046875,-0.00140380859375,-0.07666015625,0.021240234375,0.0198974609375,0.0038299560546875,-0.0037841796875,0.068359375,-0.02734375,-0.02978515625,-0.055908203125,0.0072021484375,0.003631591796875,-0.00421142578125,-0.0147705078125,-0.01092529296875,0.01123046875,-0.028076171875,-0.005706787109375,0.0164794921875,-0.0014801025390625,0.005859375,0.00592041015625,0.00775146484375,0.020263671875,0.0322265625,0.0147705078125,-0.032958984375,-0.0091552734375,0.006988525390625,-0.00159454345703125,0.00109100341796875,0.0030975341796875,0.01220703125],"index":0,"object":"embedding"}],"model":"doubao-embedding-vision-251215","object":"list","usage":{"prompt_tokens":23,"total_tokens":23}}` + +const volcengineVideoCreateResponse = `{ + "id": "cgt-20261008165954-4sc9n" +}` + +const volcengineVideoRunningResponse = `{ + "id": "cgt-20261008165954-4sc9n", + "model": "doubao-seedance-2.0-mini", + "status": "running", + "created_at": 1791449995, + "updated_at": 1791449995, + "service_tier": "default", + "execution_expires_after": 172800, + "generate_audio": true, + "draft": false, + "priority": 0 +}` + +const volcengineVideoSucceededResponse = `{ + "id": "cgt-20261008165954-4sc9n", + "model": "doubao-seedance-2.0-mini", + "status": "succeeded", + "content": { + "video_url": "VIDEO_URL" + }, + "usage": { + "completion_tokens": 48400, + "total_tokens": 48400 + }, + "created_at": 1791449995, + "updated_at": 1791450109, + "seed": 14410, + "resolution": "480p", + "ratio": "1:1", + "duration": 5, + "framespersecond": 24, + "service_tier": "default", + "execution_expires_after": 172800, + "generate_audio": true, + "draft": false, + "priority": 0 +}` + +const volcengineVideoFailedCreateResponse = `{ + "id": "cgt-20261008165955-bgckq" +}` + +const volcengineVideoFailedResponse = `{ + "id": "cgt-20261008165955-bgckq", + "model": "doubao-seedance-2.0-mini", + "status": "failed", + "error": { + "code": "OutputVideoSensitiveContentDetected.PolicyViolation", + "message": "The request failed because the output video may be related to copyright restrictions. Request id: 02179144999552100000000000000000000ffffac155925e93938" + }, + "created_at": 1791449995, + "updated_at": 1791450125, + "service_tier": "default", + "execution_expires_after": 172800, + "generate_audio": true, + "draft": false, + "priority": 0 +}` diff --git a/internal/provider/models.go b/internal/provider/models.go index 77fa7b42d..769596548 100644 --- a/internal/provider/models.go +++ b/internal/provider/models.go @@ -518,14 +518,14 @@ func basePath(raw string) string { // or gives the plan's when the list has none; a plan with models but no // Only gives them only when there is no list. Any other provider's list is // as it came. A region with models of its own (Tencent Cloud's Token Plan, -// beside TokenHub's pay as you go) is a plan with those. +// or one of Volcengine's plans) is a plan with those. func (p Provider) planModels(ms []catalog.Model) []catalog.Model { pr := Preset(p.Preset) if pr == nil { return ms } models := pr.Models - if r := p.regionOf(pr); r != nil && len(r.Models) > 0 { + if r := p.regionOf(pr); r != nil && r.Models != nil { models = r.Models } if pr.Only == "" && (len(models) == 0 || len(ms) > 0) { @@ -571,6 +571,42 @@ func (p Provider) planModels(ms []catalog.Model) []catalog.Model { return out } +// PlanEmbeddings are the embedding models explicitly included in the preset +// region's plan. They are resolved by the embeddings API but kept out of +// agents' chat-model lists. +func (p Provider) PlanEmbeddings() []catalog.Model { + return p.planMedia(func(r *Region) []string { return r.Embeddings }, false, false) +} + +// PlanDrawers are the image-generation models explicitly included in the +// preset region's plan. They are separate from its chat models. +func (p Provider) PlanDrawers() []catalog.Model { + return p.planMedia(func(r *Region) []string { return r.Drawers }, true, false) +} + +// PlanVideos are the video-generation models explicitly included in the +// preset region's plan. +func (p Provider) PlanVideos() []catalog.Model { + return p.planMedia(func(r *Region) []string { return r.Videos }, false, true) +} + +func (p Provider) planMedia(ids func(*Region) []string, draws, films bool) []catalog.Model { + pr := Preset(p.Preset) + if pr == nil { + return nil + } + r := p.regionOf(pr) + if r == nil { + return nil + } + models := ids(r) + out := make([]catalog.Model, 0, len(models)) + for _, id := range models { + out = append(out, catalog.Model{ID: id, Name: id, Provider: p.ID, Draws: draws, Films: films}) + } + return out +} + // fixV1 adds the /v1 an OpenAI-style base URL was given without, when // the models were found only under it: base/models didn't answer and // base/v1/models did. The list is asked for at both, but a request goes diff --git a/internal/provider/presets.go b/internal/provider/presets.go index 555d95800..85b2a22c8 100644 --- a/internal/provider/presets.go +++ b/internal/provider/presets.go @@ -82,9 +82,14 @@ type Region struct { // than the preset's (Tencent Cloud's pay as you go, beside its plan's // none), is that entry's id. Catalog string `json:"catalog,omitempty"` - // Models are a plan's, for a region that is one beside pay as you go - // (PresetDef.Models, for the region alone). - Models []string `json:"models,omitempty"` + // Models are a plan's text models, for a region that is one beside + // another plan or pay as you go (PresetDef.Models, for the region alone). + // Embeddings, Drawers and Videos are its non-chat models, kept apart from + // agents' model pickers. + Models []string `json:"models,omitempty"` + Embeddings []string `json:"embeddings,omitempty"` + Drawers []string `json:"drawers,omitempty"` + Videos []string `json:"videos,omitempty"` // Decide is the region's decision API, for a preset that routes groups Decide string `json:"decide,omitempty"` } @@ -266,16 +271,21 @@ var presets = []PresetDef{ Note: "火山方舟 · Coding / Agent Plan", Website: "https://www.volcengine.com/docs/82379/1925114", KeysURL: "https://ark.volcengine.com/region:cn-beijing/apikey", RegionLabel: "Plan", Regions: []Region{ - {ID: "coding", Name: "Coding Plan", Chat: "https://ark.cn-beijing.volces.com/api/coding/v3", Responses: "https://ark.cn-beijing.volces.com/api/coding/v3", Anthropic: "https://ark.cn-beijing.volces.com/api/coding"}, - {ID: "agent", Name: "Agent Plan", Chat: "https://ark.cn-beijing.volces.com/api/plan/v3", Responses: "https://ark.cn-beijing.volces.com/api/plan/v3", Anthropic: "https://ark.cn-beijing.volces.com/api/plan"}, + {ID: "coding", Name: "Coding Plan", Chat: "https://ark.cn-beijing.volces.com/api/coding/v3", Responses: "https://ark.cn-beijing.volces.com/api/coding/v3", Anthropic: "https://ark.cn-beijing.volces.com/api/coding", + Models: []string{"ark-code-latest", "doubao-seed-evolving", "doubao-seed-2.1-pro", "doubao-seed-2.1-lite", "doubao-seed-2.1-turbo", + "doubao-seed-2.0-mini", "minimax-m3", "glm-5.3", "glm-5.3-flash", "deepseek-v4.1-flash", "deepseek-v4-flash", "deepseek-v4-pro", + "kimi-k2.7-code", "kimi-k2.8-preview", "kimi-k3"}, + Embeddings: []string{"doubao-embedding-vision"}}, + {ID: "agent", Name: "Agent Plan", Chat: "https://ark.cn-beijing.volces.com/api/plan/v3", Responses: "https://ark.cn-beijing.volces.com/api/plan/v3", Anthropic: "https://ark.cn-beijing.volces.com/api/plan", + Models: []string{"ark-code-latest", "doubao-seed-evolving", "doubao-seed-2.1-pro", "doubao-seed-2.1-lite", "doubao-seed-2.1-turbo", + "doubao-seed-2.0-mini", "minimax-m3", "glm-5.3", "glm-5.3-flash", "deepseek-v4.1-flash", "deepseek-v4-flash", "deepseek-v4-pro", + "kimi-k2.7-code", "kimi-k2.8-preview", "kimi-k3"}, + Embeddings: []string{"doubao-embedding-vision"}, + Drawers: []string{"doubao-seedream-5-0-pro"}, + Videos: []string{"doubao-seedance-2.0", "doubao-seedance-2.0-fast", "doubao-seedance-2.0-mini", "doubao-seedance-2.5"}}, {ID: "api", Name: "Pay as you go", Chat: "https://ark.cn-beijing.volces.com/api/v3", Responses: "https://ark.cn-beijing.volces.com/api/v3", Lists: true}, }, - NoList: true, - // the plans' model names, lowercase as their quick-start pages list - // them; ark-code-latest is whichever the console has picked - Models: []string{"ark-code-latest", "doubao-seed-evolving", "doubao-seed-2.1-pro", "doubao-seed-2.1-lite", "doubao-seed-2.0-mini", - "minimax-m3", "glm-5.3", "glm-5.3-flash", "deepseek-v4.1-flash", "deepseek-v4-flash", "deepseek-v4-pro", - "kimi-k2.7-code", "kimi-k2.8-preview", "kimi-k3"}}, + NoList: true}, {ID: "qwen", Name: "Qwen", Icon: "qwen-color", Kind: KindVendor, Catalog: "alibaba", Chat: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1", Anthropic: "https://dashscope-intl.aliyuncs.com/apps/anthropic", Note: "DashScope · intl", diff --git a/internal/provider/volcengine_test.go b/internal/provider/volcengine_test.go index efd421bbd..6c7b99cfc 100644 --- a/internal/provider/volcengine_test.go +++ b/internal/provider/volcengine_test.go @@ -28,13 +28,50 @@ func TestVolcengineArkPlans(t *testing.T) { pr.Regions[2].Chat != "https://ark.cn-beijing.volces.com/api/v3" || pr.Regions[2].Anthropic != "" { t.Fatalf("plans: %+v", pr.Regions) } - for _, id := range pr.Models { - if id != strings.ToLower(id) { - t.Fatalf("model ids are lowercase, as the quick-start page has them: %q", id) + coding, agent, payg := pr.Regions[0], pr.Regions[1], pr.Regions[2] + if pr.Models != nil || coding.Models == nil || agent.Models == nil || payg.Models != nil { + t.Fatalf("model sources aren't defined per plan: coding %v, agent %v, pay as you go %v", coding.Models, agent.Models, payg.Models) + } + if len(coding.Embeddings) == 0 || len(agent.Embeddings) == 0 || len(payg.Embeddings) != 0 { + t.Fatalf("embedding models by plan: coding %v, agent %v, pay as you go %v", coding.Embeddings, agent.Embeddings, payg.Embeddings) + } + if len(coding.Drawers) != 0 || len(coding.Videos) != 0 || len(agent.Drawers) == 0 || len(agent.Videos) == 0 || len(payg.Drawers) != 0 || len(payg.Videos) != 0 { + t.Fatalf("media models aren't confined to Agent Plan: coding %+v, agent %+v, pay as you go %+v", coding, agent, payg) + } + for _, models := range [][]string{coding.Models, coding.Embeddings, agent.Models, agent.Embeddings, agent.Drawers, agent.Videos} { + for _, id := range models { + if id != strings.ToLower(id) { + t.Fatalf("model ids are lowercase, as the quick-start page has them: %q", id) + } } } - if got := p.planModels(nil); len(got) != len(pr.Models) || got[0].ID != "ark-code-latest" { - t.Fatalf("plan's: %+v", got) + if got := modelIDs(p.planModels(nil)); !slices.Equal(got, coding.Models) { + t.Fatalf("Coding Plan models: %v, want preset region's %v", got, coding.Models) + } + if got := modelIDs(p.PlanEmbeddings()); !slices.Equal(got, coding.Embeddings) { + t.Fatalf("Coding Plan embeddings: %v, want preset region's %v", got, coding.Embeddings) + } + for _, id := range coding.Embeddings { + if slices.Contains(modelIDs(p.Available()), id) || slices.Contains(modelIDs(p.Exposed()), id) { + t.Fatalf("embedding model %q exposed as a chat model", id) + } + } + p.atRegionOf(pr, agent) + if got := modelIDs(p.planModels(nil)); !slices.Equal(got, agent.Models) { + t.Fatalf("Agent Plan models: %v, want preset region's %v", got, agent.Models) + } + if got := modelIDs(p.PlanEmbeddings()); !slices.Equal(got, agent.Embeddings) { + t.Fatalf("Agent Plan embeddings: %v, want preset region's %v", got, agent.Embeddings) + } + if got := modelIDs(p.PlanDrawers()); !slices.Equal(got, agent.Drawers) { + t.Fatalf("Agent Plan drawers: %v, want preset region's %v", got, agent.Drawers) + } + if got := modelIDs(p.PlanVideos()); !slices.Equal(got, agent.Videos) { + t.Fatalf("Agent Plan videos: %v, want preset region's %v", got, agent.Videos) + } + p.atRegionOf(pr, pr.Regions[2]) + if got := p.planModels(nil); len(got) != 0 { + t.Fatalf("pay as you go preset models: %+v", got) } // an entry imported from another app at an Ark endpoint is known as Ark im, _ := imported("Ark", "k", endpoints{chat: "https://ark.cn-beijing.volces.com/api/plan/v3"}, nil) @@ -84,7 +121,7 @@ func TestVolcengineModelLists(t *testing.T) { if err := catalog.SaveLive(p.ID, p.Chat, listed); err != nil { t.Fatal(err) } - want := pr.Models + want := r.Models if r.ID == "api" { want = []string{"doubao-seed-2-0-pro-260215"} }