





















@@ -68,7 +68,7 @@ describe("together video generation provider", () => {
68686969expect(postJsonRequestMock).toHaveBeenCalledOnce();
7070const request = requireFirstPostJsonRequest("Together request");
71-expect(request.url).toBe("https://api.together.xyz/v1/videos");
71+expect(request.url).toBe("https://api.together.xyz/v2/videos");
7272const body = requireRecord(request.body, "Together request body");
7373expect(body.model).toBe("Wan-AI/Wan2.2-T2V-A14B");
7474expect(body.prompt).toBe("A bicycle weaving through a rainy neon street");
@@ -84,4 +84,47 @@ describe("together video generation provider", () => {
8484videoUrl: "https://example.com/together.mp4",
8585});
8686});
87+88+it("uses the video API endpoint when the shared Together text base URL is configured", async () => {
89+postJsonRequestMock.mockResolvedValue({
90+response: {
91+json: async () => ({
92+id: "video_123",
93+}),
94+},
95+release: vi.fn(async () => {}),
96+});
97+fetchWithTimeoutMock
98+.mockResolvedValueOnce({
99+json: async () => ({
100+id: "video_123",
101+status: "completed",
102+outputs: { video_url: "https://example.com/together.mp4" },
103+}),
104+})
105+.mockResolvedValueOnce({
106+headers: new Headers({ "content-type": "video/mp4" }),
107+arrayBuffer: async () => Buffer.from("mp4-bytes"),
108+});
109+110+const provider = buildTogetherVideoGenerationProvider();
111+await provider.generateVideo({
112+provider: "together",
113+model: "Wan-AI/Wan2.2-T2V-A14B",
114+prompt: "A bicycle weaving through a rainy neon street",
115+cfg: {
116+models: {
117+providers: {
118+together: {
119+baseUrl: "https://api.together.xyz/v1",
120+models: [],
121+},
122+},
123+},
124+},
125+});
126+127+const request = requireFirstPostJsonRequest("Together request");
128+expect(request.url).toBe("https://api.together.xyz/v2/videos");
129+});
87130});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。