增加2.5模型调用

This commit is contained in:
andy committed 2026-09-23 15:10:13 +08:00
1 parent 3f29ba716a
commit be655b6569
32 files changed
+1075 -56

No files matched your search

+31
View File
@@ -169,6 +169,37 @@ describe("task management and public API helpers", () => {
});
});
it.each(["gpt-image-2.5-flare", "gpt-image-2.5-sunburst"])("passes %s through public jobs and billing identity", async (model) => {
process.env.IMAGE_GENERATE_ENGINE = "evolink";
process.env.EVOLINK_API_KEY = "test-key";
const result = await createPublicGenerationJob({
client: { id: "agent-a", key: "secret-a" },
request: new Request("http://local.test/api/v1/jobs"),
origin: "http://local.test",
body: { capability: "image.generate", prompt: "商品海报", model }
});
expect(result.job.provider).toBe("evolink");
expect(result.job.reqKey).toBe(model);
expect(result.job.requestPayload.providerPayload).toMatchObject({ model, quality: "medium", n: 1, resolution: "1K" });
});
it("rejects a model for a non-EvoLink engine and invalid Image 2.5 quality through the public API", async () => {
process.env.EVOLINK_API_KEY = "test-key";
const common = {
client: { id: "agent-a", key: "secret-a" },
request: new Request("http://local.test/api/v1/jobs"),
origin: "http://local.test"
};
await expect(createPublicGenerationJob({
...common,
body: { capability: "image.generate", engine: "jimeng", prompt: "海报", model: "gpt-image-2.5-flare" }
})).rejects.toThrow("Unsupported image model for the selected engine.");
await expect(createPublicGenerationJob({
...common,
body: { capability: "image.generate", engine: "evolink", prompt: "海报", model: "gpt-image-2.5-flare", quality: 3 }
})).rejects.toThrow("Unsupported EvoLink image quality.");
});
it("allows image jobs to override the default generation engine", async () => {
process.env.IMAGE_GENERATE_ENGINE = "evolink";
process.env.EVOLINK_API_KEY = "test-key";