Skip to content

Conversation

@petenelson
Copy link
Contributor

While working with a fresh installation of ClassifAI, I added the API key for OpenAI Text to Speech and saved it, then tried generating text-to-speech for a post, but it was failing with their API returning the following error:

"[{'type': 'enum', 'loc': ('body', 'voice'), 'msg': "Input should be 'nova', 'shimmer', 'echo', 'onyx', 'fable', 'alloy', 'ash', 'sage' or 'coral'", 'input': 'voice', 'ctx': {'expected': "'nova', 'shimmer', 'echo', 'onyx', 'fable', 'alloy', 'ash', 'sage' or 'coral'"}}]"

After some debugging, I found that that the default_value for the voice selection was set to voice, and it reflected this in the classifai_feature_text_to_speech_generation option:

'openai_text_to_speech' =>
array (
  'api_key' => 'redacted',
  'authenticated' => true,
  'tts_model' => 'tts-1',
  'voice' => 'voice',
  'format' => 'mp3',
  'speed' => '1',
),

After changing the voice value to something else, saving it, then setting it to Alloy and saving it again, the the correct value showed up for voice:

'openai_text_to_speech' =>
array (
  'api_key' => 'redacted',
  'authenticated' => true,
  'tts_model' => 'tts-1',
  'voice' => 'alloy',
  'format' => 'mp3',
  'speed' => '1',
),

And generating text-to-speech for the post was working correctly. This PR sets a valid value for the default voice.

@petenelson petenelson requested review from a team, dkotter and jeffpaul as code owners December 23, 2025 16:08
@github-actions github-actions bot added this to the 3.8.0 milestone Dec 23, 2025
@github-actions github-actions bot added the needs:feedback This requires reporter feedback to better understand the request. label Dec 23, 2025
@github-actions
Copy link

@petenelson thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:feedback This requires reporter feedback to better understand the request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant