Add TTS support with OpenAI-compatible endpoint configuration

- Add TTS settings schema and configuration UI with validation
- Create backend TTS proxy with 24hr file-based caching
- Add frontend useTTS hook with Cache API caching
- Add TTS playback button on assistant messages (step-finish)
- Include test button to verify TTS configuration
This commit is contained in:
Chris Scott committed 2025-11-28 19:52:35 -05:00
1 parent 283348b64f
commit fb91b4d3a3
12 files changed
+859 -5

No files matched your search

+20
View File
@@ -6,6 +6,15 @@ export const CustomCommandSchema = z.object({
promptTemplate: z.string(),
});
export const TTSConfigSchema = z.object({
enabled: z.boolean(),
endpoint: z.string(),
apiKey: z.string(),
voice: z.string(),
model: z.string(),
speed: z.number().min(0.25).max(4.0),
});
export const CustomAgentSchema = z.object({
name: z.string(),
description: z.string(),
@@ -35,8 +44,18 @@ export const UserPreferencesSchema = z.object({
customCommands: z.array(CustomCommandSchema),
customAgents: z.array(CustomAgentSchema),
gitToken: z.string().optional(),
tts: TTSConfigSchema.optional(),
});
export const DEFAULT_TTS_CONFIG = {
enabled: false,
endpoint: "https://api.openai.com/v1/audio/speech",
apiKey: "",
voice: "alloy",
model: "tts-1",
speed: 1.0,
};
export const DEFAULT_USER_PREFERENCES = {
theme: "dark" as const,
mode: "build" as const,
@@ -47,6 +66,7 @@ export const DEFAULT_USER_PREFERENCES = {
customCommands: [],
customAgents: [],
gitToken: undefined,
tts: DEFAULT_TTS_CONFIG,
};
export const SettingsResponseSchema = z.object({