danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, OpenAI, Assistants API, Azure, Groq, GPT-4 Vision, Mistral, OpenRouter, Vertex AI, Gemini, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
16.81k stars 2.81k forks source link

[Bug]: Autoplay TTS cycles through the voices for OpenAI when voices array is set (voice array throws an error) #2842

Closed AIndoria closed 3 months ago

AIndoria commented 3 months ago

What happened?

TTS cycles through the voice array (external : openAI) rather than sticking to one voice selected in user settings when "Autoplay latest message" is enabled.

That happens after the tts is set to

tts:
  openai:
    apiKey: '${TTS_API_KEY}'
    model: 'tts-1'
    voices: ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']

Note voices instead of voice as mentioned in docs. using voice by itself gives the error:

error: Invalid custom config file at /app/librechat.yaml [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "tts", "openai", "voices" ], "message": "Required" } ]


Edit: One more issue I noticed (do I open a new one for this?) : When autoplay is DISABLED, the "stop button" on TTS doesn't appear - When the LLM starts vocalizing, the button remains as a speaker icon. It only tends to appear when autoplay is enabled.


Steps to Reproduce

  1. Select a voice (say, Onyx) in user settings.
  2. Enable "Autoplay Latest Message."
  3. After each playback, the voices cycle through the voices array. That is, a new voice is selected for each response.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Screenshots

No response

Code of Conduct

danny-avila commented 3 months ago

TTS cycles through the voice array (external : openAI) rather than sticking to one voice selected in user settings when "Autoplay latest message" is enabled.

I'll look into it, I think I know why

Edit: One more issue I noticed (do I open a new one for this?) : When autoplay is DISABLED, the "stop button" on TTS doesn't appear - When the LLM starts vocalizing, the button remains as a speaker icon. It only tends to appear when autoplay is enabled.

I can't reproduce this, can you send a video on the latest commit?

EDIT: I can reproduce it now, triaged and resolving this now

danny-avila commented 3 months ago
tts:
  openai:
    apiKey: '${TTS_API_KEY}'
    model: 'tts-1'
    voices: ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']

On second thought, this is my exact config and I'm not having an issue, have you updated correctly?

EDIT:

Note voices instead of voice as mentioned in docs. using voice by itself gives the error:

The docs are wrong, it should be voices

AIndoria commented 3 months ago

Papa bless, thank you.

On second thought, this is my exact config and I'm not having an issue, have you updated correctly?

do you still need this? I updated via docker correctly.

danny-avila commented 3 months ago

Resolved these issues!