mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
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:
1 parent
283348b64f
commit
fb91b4d3a3
12 files changed
+859
-5
No files matched your search
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user