Error: The role system, is not supported by Gemini Provider.

Created on 13 August 2024, about 1 month ago
Updated 19 September 2024, 1 day ago

Problem/Motivation

I configured the Gemini provider with a API token I got from AI Studio, but I get an error when I try to test the provider with the AI Chat explorer at /admin/config/ai/explorers/chat-generation

Error:
Drupal\ai\Exception\AiResponseErrorException: The role system, is not supported by Gemini Provider. in Drupal\gemini_provider\Plugin\AiProvider\GeminiProvider->chat() (line 141 of /var/www/html/web/modules/contrib/gemini_provider/src/Plugin/AiProvider/GeminiProvider.php).

Same error appears in the logs if I configure Gemini to be used with CKEditor or content editing tools for example.

I tried with Gemini 1.5 Flash and 1.0 Pro. I think the API key should be correct because there is a response from the API which is not "forbidden" or similar. I can also see some requests in the Google Cloud Console, but I'm not sure those are mine or something else.

Steps to reproduce

Configure a Gemini model to be the provider for any feature which the AI module provides.
Try to use the AI features.
Check Drupal logs for errors.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇮Finland mErilainen

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