Fixed the issue with multiple tool calls in Ollama. The index for Ollama's tool calls is located inside the function key. When using multiple tools, the code was unable to retrieve the correct index, instead using a default value of 0 for all tools, which led to errors. Previously, the code worked correctly when only a single tool was called because there was only one required index. fix: #15546 fix: #15350
Fixed
Fixed the issue with multiple tool calls in Ollama
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/15825
**Author:** [@EntropyYue](https://github.com/EntropyYue)
**Created:** 7/17/2025
**Status:** ✅ Merged
**Merged:** 7/18/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/ollama-tool-call`
---
### 📝 Commits (1)
- [`260137f`](https://github.com/open-webui/open-webui/commit/260137fc122295b1fc9371f460db319ea5e3d07a) fix: ollama tool call
### 📊 Changes
**1 file changed** (+5 additions, -6 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/utils/response.py` (+5 -6)
</details>
### 📄 Description
# Changelog Entry
### Description
Fixed the issue with multiple tool calls in Ollama. The `index` for Ollama's tool calls is located inside the `function` key. When using multiple tools, the code was unable to retrieve the correct `index`, instead using a default value of 0 for all tools, which led to errors. Previously, the code worked correctly when only a single tool was called because there was only one required `index`.
fix: #15546
fix: #15350
### Fixed
- Fixed the issue with multiple tool calls in Ollama
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/15825
Author: @EntropyYue
Created: 7/17/2025
Status: ✅ Merged
Merged: 7/18/2025
Merged by: @tjbck
Base:
dev← Head:fix/ollama-tool-call📝 Commits (1)
260137ffix: ollama tool call📊 Changes
1 file changed (+5 additions, -6 deletions)
View changed files
📝
backend/open_webui/utils/response.py(+5 -6)📄 Description
Changelog Entry
Description
Fixed the issue with multiple tool calls in Ollama. The
indexfor Ollama's tool calls is located inside thefunctionkey. When using multiple tools, the code was unable to retrieve the correctindex, instead using a default value of 0 for all tools, which led to errors. Previously, the code worked correctly when only a single tool was called because there was only one requiredindex.fix: #15546
fix: #15350
Fixed
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.