mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-15 04:18:18 +00:00
feat: add {{MODEL_ID}} placeholder for custom connection headers (#32426)
Custom headers on connections and tool servers could pass the chat, message, user and task to downstream services, but not which model the request was for. Chat requests can now use {{MODEL_ID}}, which holds the ID of the model handling the request; for a workspace model that is the workspace model's own ID. In a multi-model chat each model's request carries its own ID, so downstream services can route by model or log usage per model.
Fixes #30006
This commit is contained in:
parent
fb3d92a6ef
commit
bae22752d3
1 changed files with 1 additions and 0 deletions
|
|
@ -144,6 +144,7 @@ def parse_custom_headers(
|
|||
'{{FILE_NAME}}': metadata.get('file_name', '') or '',
|
||||
'{{FILE_CONTENT_TYPE}}': metadata.get('file_content_type', '') or '',
|
||||
'{{TASK}}': metadata.get('task', '') or '',
|
||||
'{{MODEL_ID}}': metadata.get('model_id', '') or '',
|
||||
'{{USER_ID}}': (user.id if user else '') or '',
|
||||
'{{USER_NAME}}': (user.name.strip() if user else '') or '',
|
||||
'{{USER_EMAIL}}': (user.email.strip() if user else '') or '',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue