feat: implement tier-a4 tts voice output replies
This commit is contained in:
@@ -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] },
|
||||
|
||||
Reference in New Issue
Block a user