feat: optimize generate name length (#924)

This commit is contained in:
takatost 2023-08-19 23:34:38 +08:00 committed by GitHub
parent 95b179fb39
commit 8d6d1c442b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,10 @@ def handle(sender, **kwargs):
# generate conversation name
try:
name = LLMGenerator.generate_conversation_name(app_model.tenant_id, message.query, message.answer)
if len(name) > 75:
name = name[:75] + '...'
conversation.name = name
except:
conversation.name = 'New Chat'