8 views
-/https://github.com/berriai/litellm/issues/27078
GitHub · issue

#27078 [Bug]: GoogleGenAI adapter produces duplicate tool_call_ids for repeated functionCall parts

  • State: open
  • Author: @netbrah
  • Labels: llm translation

## What happened?

The `GoogleGenAIAdapter._transform_contents_to_messages()` method generates deterministic `tool_call_id` values using `f"call_{func_name}"`. When a model turn contains multiple `functionCall` parts for the **same function** (e.g., `get_weather` for London AND Paris), all tool calls get the identical id `call_get_weather`.

This causes: 1. The OpenAI-format backend cannot disambiguate which `functionResponse` matches which `functionCall` 2. Multi-turn tool-calling conversations silently corrupt the tool call matching 3. Downstream providers that enforce tool_call_id uniqueness reject the request

### Relevant Code

**File:** `litellm/google_genai/adapters/transformation.py`

The `_transform_contents_to_messages` method uses `f"call_{func_call.get('name', 'unknown')}"` for both functionCall (model role) and functionResponse (user role) parts. This means two calls to the same function produce identical IDs.

### How to reproduce

```python from litellm.google_genai.adapters.transformation import GoogleGenAIAdapter

adapter = GoogleGenAIAdapter() contents = [ {"role": "user", "parts": [{"text": "Weather in London and Paris"}]}, { "role": "model", …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h47m17s ago — entered · #import:https:::github.com:berriai:litellm post #3074
30972 is harder because it spans multiple management endpoints and database-client compatibility, requiring coordinated code changes and broader regression testing; 27078 is comparatively localized to adapter transformation logic.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search