mirror of
https://github.com/open-webui/open-webui
synced 2025-02-26 07:09:07 +00:00
refac
This commit is contained in:
parent
556c75e876
commit
06a692282b
@ -617,16 +617,15 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||||||
is None
|
is None
|
||||||
):
|
):
|
||||||
webhook_url = Users.get_user_webhook_url_by_id(user.id)
|
webhook_url = Users.get_user_webhook_url_by_id(user.id)
|
||||||
webui_url = f"{request.headers.get('x-forwarded-proto', request.url.scheme)}://{request.headers.get('x-forwarded-host', f'{request.client.host}:{request.url.port}')}"
|
|
||||||
if webhook_url:
|
if webhook_url:
|
||||||
post_webhook(
|
post_webhook(
|
||||||
webhook_url,
|
webhook_url,
|
||||||
f"{title} - {webui_url}/c/{metadata['chat_id']}\n\n{content}",
|
f"{title} - {WEBUI_URL}/c/{metadata['chat_id']}\n\n{content}",
|
||||||
{
|
{
|
||||||
"action": "chat",
|
"action": "chat",
|
||||||
"message": content,
|
"message": content,
|
||||||
"title": title,
|
"title": title,
|
||||||
"url": f"{webui_url}/c/{metadata['chat_id']}",
|
"url": f"{WEBUI_URL}/c/{metadata['chat_id']}",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user