增加2.5模型调用
This commit is contained in:
1 parent
3f29ba716a
commit
be655b6569
32 files changed
+1075
-56
No files matched your search
@@ -822,6 +822,27 @@ func TestEvoLinkPayloadIncludesQualityAndSize(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEvoLinkImage25PayloadUsesSelectedModelAndOneK(t *testing.T) {
|
||||
client := roundTripFunc(func(request *http.Request) (*http.Response, error) {
|
||||
var body map[string]any
|
||||
if err := json.NewDecoder(request.Body).Decode(&body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
images, ok := body["image_urls"].([]any)
|
||||
if request.URL.Path != "/v1/images/generations" || body["model"] != "gpt-image-2.5-flare" || body["quality"] != "medium" || body["n"] != float64(1) || body["resolution"] != "1K" || body["size"] != "848x1200" || !ok || len(images) != 1 {
|
||||
t.Fatalf("payload=%#v", body)
|
||||
}
|
||||
return &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(`{"id":"task-25","status":"queued"}`)), Header: http.Header{}}, nil
|
||||
})
|
||||
_, err := NewEvoLink(Config{BaseURL: "https://e.test", APIKey: "secret", Model: "gpt-image-2"}, client).Submit(context.Background(), Request{
|
||||
Capability: "image.generate", Model: "gpt-image-2.5-flare", Prompt: "draw", InputURLs: []string{"https://in.test/ref.png"},
|
||||
Settings: map[string]any{"quality": "medium", "width": 848, "height": 1200, "imageCount": float64(1)},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSeedreamPayloadAndSynchronousResponse(t *testing.T) {
|
||||
client := roundTripFunc(func(request *http.Request) (*http.Response, error) {
|
||||
if request.URL.Path != "/api/v3/images/generations" || request.Header.Get("Authorization") != "Bearer secret" {
|
||||
|
||||
Reference in new issue
Block a user