Send OpenAI custom voices as an object

Merged
LA
11d ago
+10-2

OpenAI expects a custom voice as an object, "voice": {"id": "voice_..."}, while built-in voices stay plain strings. OpenAiGateway::generateAudio() always sends the voice as a string, so ->voice('voice_...') is rejected with a 400 that lists the built-in voices. Provider options can't work around it, since the gateway's voice is merged after them.

Voices that start with voice_ are now sent as ['id' => $voice]. Built-in voices and the default-male / default-female aliases are sent the same as before.

Fixes #1211