feat: implement tier-a4 tts voice output replies

This commit is contained in:
William Valentin
2026-02-18 10:22:28 -08:00
parent 3eb07875f1
commit a71aa5992d
11 changed files with 482 additions and 4 deletions
+43
View File
@@ -660,6 +660,49 @@ describe('configSchema — audio talk mode', () => {
});
});
describe('configSchema — tts', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('defaults tts fields', () => {
const result = configSchema.parse(minimalConfig);
expect(result.tts.enabled).toBe(false);
expect(result.tts.enabled_channels).toEqual([]);
expect(result.tts.provider).toBeUndefined();
});
it('accepts custom tts provider settings', () => {
const result = configSchema.parse({
...minimalConfig,
tts: {
enabled: true,
enabled_channels: ['telegram', 'discord'],
provider: {
type: 'custom',
endpoint: 'https://example.com/v1/audio/speech',
api_key: 'sk-test',
model: 'gpt-4o-mini-tts',
voice: 'nova',
format: 'wav',
},
},
});
expect(result.tts.enabled).toBe(true);
expect(result.tts.enabled_channels).toEqual(['telegram', 'discord']);
expect(result.tts.provider).toMatchObject({
type: 'custom',
endpoint: 'https://example.com/v1/audio/speech',
api_key: 'sk-test',
model: 'gpt-4o-mini-tts',
voice: 'nova',
format: 'wav',
});
});
});
describe('configSchema — mattermost', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },