mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-31 18:22:49 +00:00
refactor: improve formatting in chat_serializers.py
--bug=1059060 --user=王孝刚 【github#3392】【应用】对话日志使用自定义时间段导出报错 https://www.tapd.cn/57709429/s/1736692
This commit is contained in:
parent
30ddab322f
commit
90ee3c4d21
|
|
@ -222,7 +222,8 @@ class ChatSerializers(serializers.Serializer):
|
|||
reference_paragraph,
|
||||
"\n".join([
|
||||
f"{improve_paragraph_list[index].get('title')}\n{improve_paragraph_list[index].get('content')}"
|
||||
for index in range(len(improve_paragraph_list))]),
|
||||
for index in range(len(improve_paragraph_list))
|
||||
]) if improve_paragraph_list is not None else "",
|
||||
row.get('asker').get('user_name'),
|
||||
row.get('message_tokens') + row.get('answer_tokens'), row.get('run_time'),
|
||||
str(row.get('create_time').astimezone(pytz.timezone(TIME_ZONE)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
|
|
|||
Loading…
Reference in New Issue