mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #18050] [CLOSED] feat(callback): add asynchronous callback system #40284
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18050
Author: @mitchou10
Created: 10/4/2025
Status: ❌ Closed
Base:
dev← Head:feat/route-callback📝 Commits (1)
f1aa79cfeat: implement CallbackRoute for enhanced request handling across routers📊 Changes
6 files changed (+134 additions, -4 deletions)
View changed files
📝
backend/open_webui/routers/evaluations.py(+2 -1)📝
backend/open_webui/routers/files.py(+2 -1)📝
backend/open_webui/routers/knowledge.py(+2 -1)📝
backend/open_webui/routers/notes.py(+2 -1)➕
backend/open_webui/test/util/test_callback.py(+70 -0)➕
backend/open_webui/utils/callback.py(+56 -0)📄 Description
Pull Request Checklist
Discussions 18017
Before submitting, make sure you've checked the following:
Changelog Entry
Description
Introduce an asynchronous callback system for selected API routes.
This allows Open WebUI to notify an external service whenever a response is produced by specific endpoints.
Added
open_webui/utils/callback.pycontaining:CallbackPayload(Pydantic model)send_callback()async helperCallbackRouteclass for automatic callback dispatchtest/utils/test_callback.pyunit tests for callback behaviorCallbackRouteinto the following route modules:knowledgenotesfilesfeedbackChanged
CallbackRoutefor automatic callback handling.CALLBACK_URLCALLBACK_TOKENFixed
payload.model_dump().Security
Additional Information
This feature enables external systems (e.g., monitoring dashboards, automation tools) to receive live response data from the Open WebUI API for synchronization or analytics purposes.
Unit tests validate correct async behavior and ensure no external calls occur when environment variables are missing.
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.
CONTRIBUTING
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.