feat: lots of speech stuff
This commit is contained in:
@@ -50,6 +50,13 @@ const ERROR_SUMMARIES: { test: (msg: string) => boolean; summarize: (msg: string
|
||||
test: msg => /neither voice_tools_openai_key nor openai_api_key is set/i.test(msg),
|
||||
summarize: () => 'OpenAI TTS needs VOICE_TOOLS_OPENAI_KEY or OPENAI_API_KEY.'
|
||||
},
|
||||
{
|
||||
test: msg => /ELEVENLABS_API_KEY not set/i.test(msg) || /ElevenLabs STT API error \(HTTP 401\)/i.test(msg),
|
||||
summarize: msg =>
|
||||
/ELEVENLABS_API_KEY not set/i.test(msg)
|
||||
? 'ElevenLabs STT needs ELEVENLABS_API_KEY.'
|
||||
: 'ElevenLabs rejected the API key (401).'
|
||||
},
|
||||
{
|
||||
test: msg => /method not allowed/i.test(msg),
|
||||
summarize: () => 'The desktop backend does not support that audio endpoint yet. Restart Hermes Desktop.'
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { atom } from 'nanostores'
|
||||
|
||||
export type VoicePlaybackSource = 'read-aloud' | 'voice-conversation'
|
||||
export type VoicePlaybackStatus = 'idle' | 'preparing' | 'speaking'
|
||||
|
||||
export interface VoicePlaybackState {
|
||||
messageId: string | null
|
||||
sequence: number
|
||||
source: VoicePlaybackSource | null
|
||||
status: VoicePlaybackStatus
|
||||
}
|
||||
|
||||
export const $voicePlayback = atom<VoicePlaybackState>({
|
||||
messageId: null,
|
||||
sequence: 0,
|
||||
source: null,
|
||||
status: 'idle'
|
||||
})
|
||||
|
||||
export function setVoicePlaybackState(next: VoicePlaybackState) {
|
||||
$voicePlayback.set(next)
|
||||
}
|
||||
Reference in New Issue
Block a user