llamaIndex - 💡(How to fix) Fix [Bug]: GoogleGenAI [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

The line below in llama_index/llms/google_genai/base.py shows error when using the model "gemma-4-26b-a4b-it-maas"

Fix Action

Fixed

Code Example

ROLES_FROM_GEMINI: dict[str, MessageRole] = {
    ## Gemini has user, model and function roles.
    "user": MessageRole.USER,
    "model": MessageRole.ASSISTANT,
    "function": MessageRole.TOOL,
    'assistant': MessageRole.ASSISTANT # this role has to be added 
}

---
RAW_BUFFERClick to expand / collapse

Bug Description

In the following library

from llama_index.llms.google_genai import GoogleGenAI The line below in llama_index/llms/google_genai/base.py shows error when using the model "gemma-4-26b-a4b-it-maas" model_meta = client.models.get(model=model)

In addition, you need to add more roles in llama_index/llms/google_genai/utils.py for this specific model

ROLES_FROM_GEMINI: dict[str, MessageRole] = {
    ## Gemini has user, model and function roles.
    "user": MessageRole.USER,
    "model": MessageRole.ASSISTANT,
    "function": MessageRole.TOOL,
    'assistant': MessageRole.ASSISTANT # this role has to be added 
}

Version

llama-index-llms-google-genai==0.9.5

Steps to Reproduce

Set the model to "gemma-4-26b-a4b-it-maas"

Relevant Logs/Tracebacks

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING