- Issue created by @MrDaleSmith
- Merge request !331Pass array of automator configuration by reference so model can be identified... → (Merged) created by MrDaleSmith
If an audio field has an automator set up on it that uses the default configuration - specifically AI Provider is set to Default Text to Speech Model in the hidden Advanced Settings tab - audio generation fails with the error:
[warning] Undefined array key "ai_model" TextToSpeech.php:61
[warning] A general error happened why trying to interpolate, message Model ID is missing in your request.
The code in Drupal\ai_automators\PluginBaseClasses\TextToSpeech::generate() is passed a $automatorConfig array that has:
$automatorConfig['ai_provider'] = 'default'
The code correctly identifies the model if $automatorConfig['model']
is not set from the ai_provider value. The model is added to the $automatorConfig but this is not then passed back to the Drupal\ai_automators\PluginBaseClasses\TextToSpeech::generate()
method. That method then assumes $automatorConfig['model']
exist and tries to pass it to the call to generate audio, causing the error.
When $automatorConfig['model']
is set, the updated array should be passed back up the chain so the setting can be used elsewhere in code.
Active
1.0
AI Automators