mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #5883] Make metadata.chat_id available in custom pipeline #14159
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?
Originally created by @weixu365 on GitHub (Oct 3, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5883
Is your feature request related to a problem? Please describe.
I'm integrating open-webui with AWS Bedrock Agents using bedrock_agent_runtime.invoke_agent() in a custom pipeline. This method requires a sessionId parameter, as the Bedrock Agent manages the chat session.
I would like to use chat_id as the sessionId, but it's no longer available in the pipeline.pipe() method. The metadata field, where this information was previously stored, was removed 3 months ago in commit f462744.
Describe the solution you'd like
I propose restoring the metadata field from the payload at: https://github.com/open-webui/open-webui/blob/main/backend/open_webui/apps/openai/main.py#L383-L384
Describe alternatives you've considered
If reintroducing the metadata field could cause other issues, I suggest adding an environment variable, such as
ENABLE_PIPELINE_METADATA. When this variable is not set or set to false, the default behavior (without metadata) would remain unchanged, while enabling it would send the field to custom pipelinesAdditional context
None
@weixu365 commented on GitHub (Oct 3, 2024):
Solved by adding to a custom field in body:
@codysandahl commented on GitHub (Jan 4, 2025):
For future people, if you need to get the extra metadata to the Pipelines server, I wrote a Pipe to package the info into the body and send it to Pipelines.
https://openwebui.com/f/codysandahl/pipeline_enriched_with_metadata