mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Missing fields in exported logs
--bug=1054500 --user=王孝刚 【应用】对话日志导出,没有携带用户信息 https://www.tapd.cn/57709429/s/1681984
This commit is contained in:
parent
2681d02728
commit
7ca0a7bd02
|
|
@ -216,6 +216,7 @@ class ChatSerializers(serializers.Serializer):
|
|||
"\n".join([
|
||||
f"{improve_paragraph_list[index].get('title')}\n{improve_paragraph_list[index].get('content')}"
|
||||
for index in range(len(improve_paragraph_list))]),
|
||||
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')
|
||||
)]
|
||||
|
|
@ -242,7 +243,8 @@ class ChatSerializers(serializers.Serializer):
|
|||
gettext('answer'), gettext('User feedback'),
|
||||
gettext('Reference segment number'),
|
||||
gettext('Section title + content'),
|
||||
gettext('Annotation'), gettext('Consuming tokens'), gettext('Time consumed (s)'),
|
||||
gettext('Annotation'), gettext('USER'), gettext('Consuming tokens'),
|
||||
gettext('Time consumed (s)'),
|
||||
gettext('Question Time')]
|
||||
for col_idx, header in enumerate(headers, 1):
|
||||
cell = worksheet.cell(row=1, column=col_idx)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ SELECT
|
|||
application_chat_record_temp."index" as "index",
|
||||
application_chat_record_temp.improve_paragraph_list as improve_paragraph_list,
|
||||
application_chat_record_temp.vote_status as vote_status,
|
||||
application_chat_record_temp.create_time as create_time
|
||||
application_chat_record_temp.create_time as create_time,
|
||||
to_json(application_chat.asker) as asker
|
||||
FROM
|
||||
application_chat application_chat
|
||||
LEFT JOIN (
|
||||
|
|
|
|||
Loading…
Reference in New Issue