Problem/Motivation

I've been trying to set this up with the CKEditor Tone plugin. After successfully setting up a Chat with AI 1.2.2, when I try using the Tone option in the ckeditor I get this error in the API response:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider::loadCredentials(): Return value must be of type array, null returned in Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider->loadCredentials() (line 466 of modules/contrib/ai_provider_google_vertex/src/Plugin/AiProvider/VertexProvider.php).Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider->getAccessToken() (Line: 184)
Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider->getAuthHeaders() (Line: 241)
Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider->chat(Object, 'gemini_vertext', Array)
ReflectionMethod->invokeArgs(Object, Array) (Line: 269)
Drupal\ai\Plugin\ProviderProxy->wrapperCall(Object, Array) (Line: 133)
Drupal\ai\Plugin\ProviderProxy->__call('chat', Array) (Line: 149)
Drupal\ai_ckeditor\Controller\AiRequest->doRequest(Object, Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Set up chat with a custom Gemini.
Enable AI CKEditor and enable the Tone plugin using a vocabulary that contains a single term.
In a content form, select text, open the AI tone plugin, select a term in the vocabulary, click the "Change the tone" button.

Proposed resolution

Fix the bug.

Remaining tasks

Fix the bug.

User interface changes

Using the CKEditor "Tone" system works.

API changes

TBD

Data model changes

TBD

Comments

damienmckenna created an issue. See original summary.

mxr576’s picture

Version: 1.1.x-dev » 2.x-dev
mxr576’s picture

Issue tags: +Needs backport