mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: enhance chat record processing and update translations for user-related fields
This commit is contained in:
parent
1374ed4171
commit
2d734d0aaa
|
|
@ -129,7 +129,8 @@ class ApplicationChatQuerySerializers(serializers.Serializer):
|
|||
if with_valid:
|
||||
self.is_valid(raise_exception=True)
|
||||
return native_search(self.get_query_set(), select_string=get_file_content(
|
||||
os.path.join(PROJECT_DIR, "apps", "application", 'sql', ('list_application_chat_ee.sql' if ['PE', 'EE'].__contains__(
|
||||
os.path.join(PROJECT_DIR, "apps", "application", 'sql',
|
||||
('list_application_chat_ee.sql' if ['PE', 'EE'].__contains__(
|
||||
edition) else 'list_application_chat.sql'))),
|
||||
with_table_name=False)
|
||||
|
||||
|
|
@ -166,6 +167,7 @@ class ApplicationChatQuerySerializers(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') or 0) + (row.get('answer_tokens') or 0), row.get('run_time'),
|
||||
str(row.get('create_time').astimezone(pytz.timezone(TIME_ZONE)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
if row.get('create_time') is not None else None)]
|
||||
|
|
@ -194,7 +196,7 @@ class ApplicationChatQuerySerializers(serializers.Serializer):
|
|||
gettext('answer'), gettext('User feedback'),
|
||||
gettext('Reference segment number'),
|
||||
gettext('Section title + content'),
|
||||
gettext('Annotation'), gettext('Consuming tokens'),
|
||||
gettext('Annotation'), gettext('USER'), gettext('Consuming tokens'),
|
||||
gettext('Time consumed (s)'),
|
||||
gettext('Question Time')]
|
||||
for col_idx, header in enumerate(headers, 1):
|
||||
|
|
|
|||
|
|
@ -8489,4 +8489,7 @@ msgid "API KEY"
|
|||
msgstr "API KEY"
|
||||
|
||||
msgid "Download"
|
||||
msgstr ""
|
||||
|
||||
msgid "USER"
|
||||
msgstr ""
|
||||
|
|
@ -332,7 +332,7 @@ msgstr "排除的向量 ID 列表"
|
|||
#: apps/application/serializers/application.py:84
|
||||
#: apps/application/serializers/application_chat.py:185
|
||||
msgid "Reference segment number"
|
||||
msgstr "引用段落数量"
|
||||
msgstr "引用分段数"
|
||||
|
||||
#: apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py:42
|
||||
msgid "Similarity"
|
||||
|
|
@ -1106,7 +1106,7 @@ msgstr "对话 ID"
|
|||
#: apps/application/serializers/application_chat.py:182
|
||||
#: apps/application/serializers/application_version.py:23
|
||||
msgid "summary"
|
||||
msgstr "总结"
|
||||
msgstr "摘要"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:35
|
||||
msgid "Chat User ID"
|
||||
|
|
@ -1173,7 +1173,7 @@ msgstr "用户反馈"
|
|||
|
||||
#: apps/application/serializers/application_chat.py:186
|
||||
msgid "Section title + content"
|
||||
msgstr "章节标题 + 内容"
|
||||
msgstr "分段标题 + 内容"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:187
|
||||
#: apps/application/views/application_chat_record.py:139
|
||||
|
|
@ -1181,7 +1181,7 @@ msgstr "章节标题 + 内容"
|
|||
#: apps/application/views/application_chat_record.py:141
|
||||
#: apps/common/constants/permission_constants.py:248
|
||||
msgid "Annotation"
|
||||
msgstr "注释"
|
||||
msgstr "标注"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:187
|
||||
msgid "Consuming tokens"
|
||||
|
|
@ -1189,7 +1189,7 @@ msgstr "消耗的令牌"
|
|||
|
||||
#: apps/application/serializers/application_chat.py:188
|
||||
msgid "Time consumed (s)"
|
||||
msgstr ""
|
||||
msgstr "耗时 (s)"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:189
|
||||
msgid "Question Time"
|
||||
|
|
@ -8616,3 +8616,6 @@ msgstr "API KEY"
|
|||
|
||||
msgid "Download"
|
||||
msgstr "下载"
|
||||
|
||||
msgid "USER"
|
||||
msgstr "用户"
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ msgstr "排除的向量 ID 列表"
|
|||
#: apps/application/serializers/application.py:84
|
||||
#: apps/application/serializers/application_chat.py:185
|
||||
msgid "Reference segment number"
|
||||
msgstr "引用段落數量"
|
||||
msgstr "引用分段數"
|
||||
|
||||
#: apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py:42
|
||||
msgid "Similarity"
|
||||
|
|
@ -1106,7 +1106,7 @@ msgstr "對話 ID"
|
|||
#: apps/application/serializers/application_chat.py:182
|
||||
#: apps/application/serializers/application_version.py:23
|
||||
msgid "summary"
|
||||
msgstr "總結"
|
||||
msgstr "摘要"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:35
|
||||
msgid "Chat User ID"
|
||||
|
|
@ -1173,7 +1173,7 @@ msgstr "用戶反饋"
|
|||
|
||||
#: apps/application/serializers/application_chat.py:186
|
||||
msgid "Section title + content"
|
||||
msgstr "章節標題 + 內容"
|
||||
msgstr "分段標題 + 內容"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:187
|
||||
#: apps/application/views/application_chat_record.py:139
|
||||
|
|
@ -1181,7 +1181,7 @@ msgstr "章節標題 + 內容"
|
|||
#: apps/application/views/application_chat_record.py:141
|
||||
#: apps/common/constants/permission_constants.py:248
|
||||
msgid "Annotation"
|
||||
msgstr "注釋"
|
||||
msgstr "标注"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:187
|
||||
msgid "Consuming tokens"
|
||||
|
|
@ -1189,7 +1189,7 @@ msgstr "消耗的令牌"
|
|||
|
||||
#: apps/application/serializers/application_chat.py:188
|
||||
msgid "Time consumed (s)"
|
||||
msgstr ""
|
||||
msgstr "耗时 (s)"
|
||||
|
||||
#: apps/application/serializers/application_chat.py:189
|
||||
msgid "Question Time"
|
||||
|
|
@ -8615,4 +8615,7 @@ msgid "API KEY"
|
|||
msgstr "API KEY"
|
||||
|
||||
msgid "Download"
|
||||
msgstr "下載"
|
||||
msgstr "下載"
|
||||
|
||||
msgid "USER"
|
||||
msgstr "用户"
|
||||
Loading…
Reference in New Issue