[PR #20380] [CLOSED] feat: native function calling for builtin tools: web, files #25589

Closed
opened 2026-04-20 06:01:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20380
Author: @jannikstdl
Created: 1/5/2026
Status: Closed

Base: devHead: feat-native-fc-web-file


📝 Commits (7)

  • 2d08583 feat: native fuction calling for builtin internal knowledge file seatch
  • a0ed58e feat: show sources and use citations for native web and file tool calls
  • 5010b5a feat: native function calling for builtin internal knowledge file search
  • 75ac9ea feat: show sources and use citations for native web and file tool calls
  • c4501bc Merge branch 'dev' into feat-native-fc-web-file
  • 1f74670 resolved conflicts
  • d1bb203 chore: lock sync

📊 Changes

3 files changed (+371 additions, -34 deletions)

View changed files

📝 backend/open_webui/tools/builtin.py (+162 -0)
📝 backend/open_webui/utils/middleware.py (+201 -34)
📝 backend/open_webui/utils/tools.py (+8 -0)

📄 Description

Added native function calling support for knowledge bases with citations

Changes

  • Added query_knowledge built-in tool that searches model-configured knowledge bases when native FC is enabled
  • Fixed citations and UI display for native FC tools (web_search, query_knowledge) - results now show in WebSearchResults UI and model cites sources automatically
  • Updated tool descriptions to prioritize knowledge bases over web search
  • Filtered knowledge base metadata to only include essential fields (name, page, total_pages, creationdate)

Behavior

  • When native FC is enabled, knowledge bases are not auto-injected -> model decides when to query them
  • Tool results are converted to sources and emitted as events for UI display
  • Sources are injected into RAG template so model can cite them
  • Model checks local knowledge bases first before searching the web
  • Manual file/KB attachments continue to work as before

Screenshots or Videos

image image

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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/20380 **Author:** [@jannikstdl](https://github.com/jannikstdl) **Created:** 1/5/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat-native-fc-web-file` --- ### 📝 Commits (7) - [`2d08583`](https://github.com/open-webui/open-webui/commit/2d085839b5f201a01e6f4c9cb712cc9117d60462) feat: native fuction calling for builtin internal knowledge file seatch - [`a0ed58e`](https://github.com/open-webui/open-webui/commit/a0ed58e98c05b4834f2749507c3d76d935c26335) feat: show sources and use citations for native web and file tool calls - [`5010b5a`](https://github.com/open-webui/open-webui/commit/5010b5a9cb6c843925759ea36b6a3728ff2945e8) feat: native function calling for builtin internal knowledge file search - [`75ac9ea`](https://github.com/open-webui/open-webui/commit/75ac9ea3b17c33d9aa7aa1f61d8e5079477934c7) feat: show sources and use citations for native web and file tool calls - [`c4501bc`](https://github.com/open-webui/open-webui/commit/c4501bc3d171b1c46213ff063c2eaca635a865b7) Merge branch 'dev' into feat-native-fc-web-file - [`1f74670`](https://github.com/open-webui/open-webui/commit/1f746709a7b9a22a8368603213c45093743dea34) resolved conflicts - [`d1bb203`](https://github.com/open-webui/open-webui/commit/d1bb2036601f1043f789ccb2ddb72dbf0c667916) chore: lock sync ### 📊 Changes **3 files changed** (+371 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/tools/builtin.py` (+162 -0) 📝 `backend/open_webui/utils/middleware.py` (+201 -34) 📝 `backend/open_webui/utils/tools.py` (+8 -0) </details> ### 📄 Description # Added native function calling support for knowledge bases with citations ## Changes - Added `query_knowledge` built-in tool that searches model-configured knowledge bases when native FC is enabled - Fixed citations and UI display for native FC tools (`web_search`, `query_knowledge`) - results now show in WebSearchResults UI and model cites sources automatically - Updated tool descriptions to prioritize knowledge bases over web search - Filtered knowledge base metadata to only include essential fields (name, page, total_pages, creationdate) ## Behavior - When native FC is enabled, knowledge bases are not auto-injected -> model decides when to query them - Tool results are converted to sources and emitted as events for UI display - Sources are injected into RAG template so model can cite them - Model checks local knowledge bases first before searching the web - Manual file/KB attachments continue to work as before ### Screenshots or Videos <img width="2282" height="1406" alt="image" src="https://github.com/user-attachments/assets/27716e0a-794c-452f-9049-90c1131a8bc5" /> <img width="2286" height="1486" alt="image" src="https://github.com/user-attachments/assets/e272bc8d-3700-4afe-a4e8-da63b5ed0a42" /> ### 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. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-04-20 06:01:02 -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#25589