feat: switch audio and storage providers to qwen3 tts and minio

This commit is contained in:
Codex
2026-02-18 13:58:23 +00:00
parent 31e8e07319
commit 445e5725b3
6 changed files with 273 additions and 258 deletions

View File

@@ -9,31 +9,38 @@ test("uploadAudio sends put command", async () => {
const adapter = createStorageAdapter({
bucket: "b1",
client: {
async send(command) {
sent.push(command.input);
async putObject(bucket, key, body, size, metadata) {
sent.push({ bucket, key, body, size, metadata });
},
async presignedGetObject() {},
},
signedUrlFactory: async () => "https://signed.example",
});
const payload = Buffer.from("abc");
const res = await adapter.uploadAudio({
key: "audio/1.mp3",
body: Buffer.from("abc"),
body: payload,
});
assert.equal(res.bucket, "b1");
assert.equal(sent.length, 1);
assert.equal(sent[0].Bucket, "b1");
assert.equal(sent[0].Key, "audio/1.mp3");
assert.equal(sent[0].bucket, "b1");
assert.equal(sent[0].key, "audio/1.mp3");
assert.equal(sent[0].size, payload.length);
assert.equal(sent[0].metadata["Content-Type"], "audio/mpeg");
});
test("getSignedDownloadUrl uses provided signer", async () => {
test("getSignedDownloadUrl uses minio presigner with ttl", async () => {
const adapter = createStorageAdapter({
bucket: "b1",
client: { async send() {} },
signedUrlFactory: async (_client, command, options) => `signed:${command.input.Key}:${options.expiresIn}`,
client: {
async putObject() {},
async presignedGetObject(bucket, key, expiresIn) {
return `signed:${bucket}:${key}:${expiresIn}`;
},
},
});
const url = await adapter.getSignedDownloadUrl("audio/2.mp3", 120);
assert.equal(url, "signed:audio/2.mp3:120");
assert.equal(url, "signed:b1:audio/2.mp3:120");
});