[PR #1405] [MERGED] docs: correct the filter function page against filter.py, middleware.py and the admin UI #1370

Closed
opened 2026-10-18 14:19:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/docs/pull/1405
Author: @silentoplayz
Created: 9/18/2026
Status: ✅ Merged
Merged: 9/18/2026
Merged by: @Classic298

Base: main ← Head: docs/filter-page


📝 Commits (1)

  • c1644c6 docs: correct the filter function page against filter.py, middleware.py and the admin UI

📊 Changes

1 file changed (+38 additions, -39 deletions)

View changed files

📝 docs/features/extensibility/plugin/functions/filter.mdx (+38 -39)

📄 Description

Summary

I compared the Filter Function page with utils/filter.py, utils/middleware.py, utils/chat.py, utils/plugin.py and the admin function menu on dev.

  • file_handler is read from the Filter instance, not the module. The page said the opposite and told authors a module-level assignment is required, which is the form that is ignored. The example, the warning and the caveat are corrected.
  • The exception behavior was described backwards. The page now says what a raise does from each hook: inlet and the first request abort the turn, a later request hop ends the tool loop, stream drops one event in the WebUI but ends a direct API stream, and outlet is ignored except through /api/chat/completed.
  • The "stable versus dev" split for outlet() on API calls is stale. Inline outlet for API callers shipped in v0.10.0. The table and the note now describe one behavior.
  • The /api/chat/completed example omitted id and marked chat_id and session_id optional. The endpoint rejects a body without id and reads both keys.
  • __metadata__ correlation between inlet() and outlet() does not hold through /api/chat/completed, which builds a fresh metadata dict.
  • variables, regeneration_prompt and params are popped before inlet, not after. The workspace model's System Prompt is added after request() returns.
  • __features__ is only injected on the first request() of a turn. outlet() never receives __chat_id__, __message_id__ or __oauth_token__. __event_emitter__ is None in stream() and outlet() for API callers, not merely inert.
  • The reserved-argument table gains __event_call__, __message_id__, __oauth_token__, __id__ and __body__, and __user__ is the full user record.
  • UI corrections: there is no Filter Management section and no globe icon. The ⋮ menu has a Global switch, and the integrations menu has a switch but no status badge.

None.

Checklist

  • I have reviewed the relevant documentation and matched the existing style.
  • This PR meets Open WebUI's contribution standards: it is accurate, relevant to users, narrowly scoped, maintainable, and not promotional content, advertising, lead generation, SEO placement, or a request to list a product, service, provider, integration, gateway, tool, or company primarily for visibility.
  • I understand that PRs that do not meet these standards may be closed without review and will not be merged. Repeated, low-quality, off-topic, promotional, or intentionally misleading submissions may result in the contributor being blocked from future participation in Open WebUI repositories.

Notes for reviewers

Every statement traces to a line on dev, chiefly process_filter_functions and get_filter_params in utils/filter.py, the inlet, outlet, stream and tool-loop call sites in utils/middleware.py, chat_completed in utils/chat.py, the system prompt application in routers/openai.py, and FunctionMenu.svelte. The v0.10.0 date comes from the CHANGELOG entry for the outlet hook on API requests.


🔄 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/docs/pull/1405 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 9/18/2026 **Status:** ✅ Merged **Merged:** 9/18/2026 **Merged by:** [@Classic298](https://github.com/Classic298) **Base:** `main` ← **Head:** `docs/filter-page` --- ### 📝 Commits (1) - [`c1644c6`](https://github.com/open-webui/docs/commit/c1644c6bf5206e62c622607d8e40e5a299264039) docs: correct the filter function page against filter.py, middleware.py and the admin UI ### 📊 Changes **1 file changed** (+38 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `docs/features/extensibility/plugin/functions/filter.mdx` (+38 -39) </details> ### 📄 Description ## Summary I compared the Filter Function page with `utils/filter.py`, `utils/middleware.py`, `utils/chat.py`, `utils/plugin.py` and the admin function menu on `dev`. - `file_handler` is read from the `Filter` instance, not the module. The page said the opposite and told authors a module-level assignment is required, which is the form that is ignored. The example, the warning and the caveat are corrected. - The exception behavior was described backwards. The page now says what a raise does from each hook: `inlet` and the first `request` abort the turn, a later `request` hop ends the tool loop, `stream` drops one event in the WebUI but ends a direct API stream, and `outlet` is ignored except through `/api/chat/completed`. - The "stable versus dev" split for `outlet()` on API calls is stale. Inline outlet for API callers shipped in v0.10.0. The table and the note now describe one behavior. - The `/api/chat/completed` example omitted `id` and marked `chat_id` and `session_id` optional. The endpoint rejects a body without `id` and reads both keys. - `__metadata__` correlation between `inlet()` and `outlet()` does not hold through `/api/chat/completed`, which builds a fresh metadata dict. - `variables`, `regeneration_prompt` and `params` are popped before `inlet`, not after. The workspace model's System Prompt is added after `request()` returns. - `__features__` is only injected on the first `request()` of a turn. `outlet()` never receives `__chat_id__`, `__message_id__` or `__oauth_token__`. `__event_emitter__` is `None` in `stream()` and `outlet()` for API callers, not merely inert. - The reserved-argument table gains `__event_call__`, `__message_id__`, `__oauth_token__`, `__id__` and `__body__`, and `__user__` is the full user record. - UI corrections: there is no Filter Management section and no globe icon. The ⋮ menu has a Global switch, and the integrations menu has a switch but no status badge. ## Related issue or discussion None. ## Checklist - [x] I have reviewed the relevant documentation and matched the existing style. - [x] This PR meets Open WebUI's contribution standards: it is accurate, relevant to users, narrowly scoped, maintainable, and not promotional content, advertising, lead generation, SEO placement, or a request to list a product, service, provider, integration, gateway, tool, or company primarily for visibility. - [x] I understand that PRs that do not meet these standards may be closed without review and will not be merged. Repeated, low-quality, off-topic, promotional, or intentionally misleading submissions may result in the contributor being blocked from future participation in Open WebUI repositories. ## Notes for reviewers Every statement traces to a line on `dev`, chiefly `process_filter_functions` and `get_filter_params` in `utils/filter.py`, the inlet, outlet, stream and tool-loop call sites in `utils/middleware.py`, `chat_completed` in `utils/chat.py`, the system prompt application in `routers/openai.py`, and `FunctionMenu.svelte`. The v0.10.0 date comes from the CHANGELOG entry for the outlet hook on API requests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 14:19:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/docs#1370
No description provided.