mirror of
https://github.com/open-webui/open-webui
synced 2025-01-16 07:48:32 +00:00
refac
This commit is contained in:
parent
c3e8cd03b2
commit
4c989808d6
@ -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 New Issue
Block a user