fix: gate image tool and deepgram audio payload

This commit is contained in:
Peter Steinberger
2026-01-17 09:33:53 +00:00
parent d66bc65ca6
commit b6ea5895b6
9 changed files with 139 additions and 31 deletions

View File

@@ -31,21 +31,17 @@ async function fetchSampleBuffer(url: string, timeoutMs: number): Promise<Buffer
}
describeLive("deepgram live", () => {
it(
"transcribes sample audio",
async () => {
const buffer = await fetchSampleBuffer(SAMPLE_URL, 15000);
const result = await transcribeDeepgramAudio({
buffer,
fileName: "sample.wav",
mime: "audio/wav",
apiKey: DEEPGRAM_KEY,
model: DEEPGRAM_MODEL,
baseUrl: DEEPGRAM_BASE_URL,
timeoutMs: 20000,
});
expect(result.text.trim().length).toBeGreaterThan(0);
},
30000,
);
it("transcribes sample audio", async () => {
const buffer = await fetchSampleBuffer(SAMPLE_URL, 15000);
const result = await transcribeDeepgramAudio({
buffer,
fileName: "sample.wav",
mime: "audio/wav",
apiKey: DEEPGRAM_KEY,
model: DEEPGRAM_MODEL,
baseUrl: DEEPGRAM_BASE_URL,
timeoutMs: 20000,
});
expect(result.text.trim().length).toBeGreaterThan(0);
}, 30000);
});

View File

@@ -84,6 +84,6 @@ describe("transcribeDeepgramAudio", () => {
expect(headers.get("authorization")).toBe("Token test-key");
expect(headers.get("x-custom")).toBe("1");
expect(headers.get("content-type")).toBe("audio/wav");
expect(Buffer.isBuffer(seenInit?.body)).toBe(true);
expect(seenInit?.body).toBeInstanceOf(Uint8Array);
});
});