Text to Speech fails if default provider used

Created on 12 December 2024, 7 days ago

Problem/Motivation

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.

Proposed resolution

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.

🐛 Bug report
Status

Active

Version

1.0

Component

AI Automators

Created by

🇬🇧United Kingdom MrDaleSmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024