This commit is contained in:
Timothy Jaeryang Baek 2024-12-19 11:07:02 -08:00
parent c3e8cd03b2
commit 4c989808d6

View File

@ -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,
{