Not compatible with AI Assistant/Agents

Created on 21 July 2025, 27 days ago

Problem/Motivation

Setting up a new site using the Drupal CMS build and its AI Recipe, provides an AI Assistant that seems unable to interact with the AI Agents. Altering the models in use with this provider to any setting results in either:

ValueError: The `GenerateContentResponse::text()` quick accessor only works for simple (single-`Part`) text responses. This response is not simple text. Use the `GenerateContentResponse::parts()` accessor or the full `GenerateContentResponse::$candidates[index].content.parts` lookup instead.

or

ValueError: "UNEXPECTED_TOOL_CALL" is not a valid backing value for enum Gemini\Enums\FinishReason in Gemini\Enums\FinishReason::from()

in the logs and the assistant either falling silent or providing the generic "Service error: try again" message.

Steps to reproduce

Set up a new Drupal CMS project.
Once the site is installed, select the AI recipe to install.
Install using the Open AI provider.
Once installation is complete, disable the Open AI Provider and enable this provider, linking a working Gemini key.
Update the default settings form to set models for all available default providers.
Interact with the AI Assistant: it can answer simple queries, but if you ask it to perform an action that requires it to interact with an AI Agent - ("Create a test content type for me" or "Tell me about the content types on this site") it cannot complete the task and errors are (sometimes) logged in the default log.

Proposed resolution

Investigate the issues and resolve: if the issue ios that this only works with specific models, this should be documented in the README. If the agents are completely incompatible with this provider, the code should be updated to ensure the
Core AI module is aware of which default models work and which are unavailable.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom MrDaleSmith

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

Comments & Activities

Production build 0.71.5 2024