fix: gate image tool and deepgram audio payload
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user