mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-17 23:52:29 +00:00
When Ollama/Gemma returns finish_reason=tool_calls in a non-streaming response, OWU was passing the response through unchanged — the tool was never called and oracle-mcp only ever saw ListToolsRequest. Root cause: the tool-execution loop lives entirely in streaming_chat_response_handler, which is skipped for non-streaming JSON responses. non_streaming_chat_response_handler only checked for choices[0].message.content and silently dropped tool_calls. Fix: - Add _execute_tool_calls_non_streaming() helper that extracts tool calls from a non-streaming LLM response, resolves each tool from metadata['tools'], executes it (MCP call_tool or builtin callable), and feeds the results back for a second LLM turn. - Call it from non_streaming_chat_response_handler whenever function_calling==native and tool_calls are present in the response. - Also normalize Ollama-prefixed tool names (e.g. "oracle:oracle_vault_ask" → "oracle_vault_ask") at execution time in both the streaming and non-streaming paths so the tools_dict lookup succeeds. Tested: oracle-mcp now shows CallToolRequest after Gemma emits a tool_call, and Gemma's final answer is grounded in vault data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| data | ||
| open_webui | ||
| .dockerignore | ||
| .gitignore | ||
| dev.sh | ||
| requirements-min.txt | ||
| requirements.txt | ||
| start.sh | ||
| start_windows.bat | ||