[PR #17898] [CLOSED] FEAT: Support sequential tool chaining in Default Function Calling Mode. #63450

Closed
opened 2026-05-06 08:13:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/17898
Author: @rgaricano
Created: 9/29/2025
Status: Closed

Base: devHead: dev-MultiTool_Default_Function_Calling


📝 Commits (7)

  • b4f438f FEAT: Support sequential tool chaining in Default Function Calling Mode.
  • ebb7612 Update env.py - Support sequential tool chaining in Default Function Calling Mode.
  • 147644d Update config.py - Support sequential tool chaining in Default Function Calling Mode.
  • 20d44b1 Update middleware.py - Format
  • 03c7e5b Update env.py - Fixed Format
  • d0c7751 Update middleware.py - Fix Format
  • 5e2c205 Update middleware.py - Fix Format

📊 Changes

3 files changed (+239 additions, -199 deletions)

View changed files

📝 backend/open_webui/config.py (+21 -22)
📝 backend/open_webui/env.py (+8 -0)
📝 backend/open_webui/utils/middleware.py (+210 -177)

📄 Description

FEAT: Support Sequential Tool chaining in Default Function Calling Mode.

  • Modificated middleware for support sequential tool calls.

  • Added a retry counter for default mode tool calls.

  • Implemented a loop that continues processing until no more tool calls are needed.

  • Allow the LLM to make additional tool calls based on previous results.

  • Added env var CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES (default=5) to set the max number of iterations of tool calls, to prevent infinite or too long loop.

  • Modified Tools Prompt for instruction the LLM on how to use sequential tools..
    Recommended add the new prompt in adminSettings/Interface/Tools Function Calling Prompt for update this default prompt in database.

Tested:
openwebui_openstreetmap0


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/17898 **Author:** [@rgaricano](https://github.com/rgaricano) **Created:** 9/29/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev-MultiTool_Default_Function_Calling` --- ### 📝 Commits (7) - [`b4f438f`](https://github.com/open-webui/open-webui/commit/b4f438fd0ad13abbada5bed302f6ca3da8e525ab) FEAT: Support sequential tool chaining in Default Function Calling Mode. - [`ebb7612`](https://github.com/open-webui/open-webui/commit/ebb7612eac18fb769d2ef598d6a860969abe73bb) Update env.py - Support sequential tool chaining in Default Function Calling Mode. - [`147644d`](https://github.com/open-webui/open-webui/commit/147644d378688198cf2499d4a9b341515fa97c56) Update config.py - Support sequential tool chaining in Default Function Calling Mode. - [`20d44b1`](https://github.com/open-webui/open-webui/commit/20d44b1c6441eafe0a83df36af119af7565fd8d1) Update middleware.py - Format - [`03c7e5b`](https://github.com/open-webui/open-webui/commit/03c7e5b86c6e8b57c9037dd7f5ab4b9e57f66eae) Update env.py - Fixed Format - [`d0c7751`](https://github.com/open-webui/open-webui/commit/d0c775183c378dc42cef05b29d1d91d319ba0e1b) Update middleware.py - Fix Format - [`5e2c205`](https://github.com/open-webui/open-webui/commit/5e2c205150eabe9f5cd91f7d63d44840f9cd758d) Update middleware.py - Fix Format ### 📊 Changes **3 files changed** (+239 additions, -199 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+21 -22) 📝 `backend/open_webui/env.py` (+8 -0) 📝 `backend/open_webui/utils/middleware.py` (+210 -177) </details> ### 📄 Description ### FEAT: Support Sequential Tool chaining in Default Function Calling Mode. - Modificated middleware for support sequential tool calls. - Added a retry counter for default mode tool calls. - Implemented a loop that continues processing until no more tool calls are needed. - Allow the LLM to make additional tool calls based on previous results. - Added env var CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES (default=5) to set the max number of iterations of tool calls, to prevent infinite or too long loop. - Modified Tools Prompt for instruction the LLM on how to use sequential tools.. Recommended add the new prompt in adminSettings/Interface/Tools Function Calling Prompt for update this default prompt in database. Tested: ![openwebui_openstreetmap0](https://github.com/user-attachments/assets/81116266-20e9-4938-8cb7-3dfe4699a1e3) ____ ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/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>
GiteaMirror added the pull-request label 2026-05-06 08:13:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#63450