mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
refac
This commit is contained in:
parent
c3e8cd03b2
commit
4c989808d6
1 changed files with 62 additions and 53 deletions
|
|
@ -601,7 +601,11 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||
if message:
|
||||
messages = get_message_list(message_map, message.get("id"))
|
||||
|
||||
if TASKS.TITLE_GENERATION in tasks:
|
||||
if tasks:
|
||||
if (
|
||||
TASKS.TITLE_GENERATION in tasks
|
||||
and tasks[TASKS.TITLE_GENERATION]
|
||||
):
|
||||
res = await generate_title(
|
||||
request,
|
||||
{
|
||||
|
|
@ -619,7 +623,9 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||
.get("content", message.get("content", "New Chat"))
|
||||
)
|
||||
|
||||
Chats.update_chat_title_by_id(metadata["chat_id"], title)
|
||||
Chats.update_chat_title_by_id(
|
||||
metadata["chat_id"], title
|
||||
)
|
||||
|
||||
await event_emitter(
|
||||
{
|
||||
|
|
@ -628,7 +634,10 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||
}
|
||||
)
|
||||
|
||||
if TASKS.TAGS_GENERATION in tasks:
|
||||
if (
|
||||
TASKS.TAGS_GENERATION in tasks
|
||||
and tasks[TASKS.TAGS_GENERATION]
|
||||
):
|
||||
res = await generate_chat_tags(
|
||||
request,
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue