Before submitting
Affected area
pipelines/google
Bug summary
Native tool calling fails sequentially in google_gemini.py due to introspection errors (__signature__), SDK duplicate declaration errors, and ultimately silent hangs during execution.
Current behavior
When enabling function_calling: "native", the pipeline fails through a cascade of bugs:
- Crash during configuration (
AttributeError: 'function' object has no attribute '__signature__').
- If patched, the Gemini SDK throws a
400 Bad Request: Duplicate function declaration found: tool_function because tools often share the same internal __name__.
- If both above are patched, when the model actually decides to use a tool, the streaming request stops/hangs without returning the
function_call payload to the Open WebUI frontend. The chat abruptly stops.
Expected behavior
The pipeline should safely introspect tool signatures (falling back if missing), ensure unique tool names are passed to the Gemini SDK, and correctly intercept and stream back function_call responses so Open WebUI can execute the native tools.
Steps to reproduce
- Install Open WebUI and the Google Gemini Pipeline.
- Attach a custom tool or built-in tool to a chat.
- Submit a prompt that explicitly requires the tool to be invoked.
- Observe the
AttributeError trace in the backend.
- Patch line 2585 to use
getattr(tool, "__signature__", "").
- Submit again, observe the
Duplicate function declaration 400 error.
- Patch the tool name setting before appending to
tools list.
- Submit again, observe the chat silently stop/hang right when the tool execution is supposed to be returned.
Relevant logs, errors, or screenshots
**Issue 1 Log:**
File "<string>", line 2585, in _configure_generation
AttributeError: 'function' object has no attribute '__signature__'
**Issue 2 Log:**
"error": {
"code": 400,
"message": "Duplicate function declaration found: tool_function",
"status": "INVALID_ARGUMENT"
}
Environment details
- Deployment method: Docker
- Open WebUI version: 0.9.2 and 0.9.5
- Repository commit or release: Google Gemini Pipeline v1.15.2
- Provider / model: Google / Gemini 3.1 Flash/Pro
Additional context
The silent failure in step 8 is likely located in the _handle_streaming_response method. The Gemini SDK's streaming iterator is probably yielding a function call chunk that the current async for chunk in response: loop either drops, misinterprets, or fails to yield back to Open WebUI in the expected JSON payload format for native tool execution.
Before submitting
mainbranch.Affected area
pipelines/google
Bug summary
Native tool calling fails sequentially in
google_gemini.pydue to introspection errors (__signature__), SDK duplicate declaration errors, and ultimately silent hangs during execution.Current behavior
When enabling
function_calling: "native", the pipeline fails through a cascade of bugs:AttributeError: 'function' object has no attribute '__signature__').400 Bad Request: Duplicate function declaration found: tool_functionbecause tools often share the same internal__name__.function_callpayload to the Open WebUI frontend. The chat abruptly stops.Expected behavior
The pipeline should safely introspect tool signatures (falling back if missing), ensure unique tool names are passed to the Gemini SDK, and correctly intercept and stream back
function_callresponses so Open WebUI can execute the native tools.Steps to reproduce
AttributeErrortrace in the backend.getattr(tool, "__signature__", "").Duplicate function declaration400 error.toolslist.Relevant logs, errors, or screenshots
Environment details
Additional context
The silent failure in step 8 is likely located in the
_handle_streaming_responsemethod. The Gemini SDK's streaming iterator is probably yielding a function call chunk that the currentasync for chunk in response:loop either drops, misinterprets, or fails to yield back to Open WebUI in the expected JSON payload format for native tool execution.