Skip to content

feat: 对话用户问题调整为10万字符 #628 #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/application/serializers/chat_message_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def to_pipeline_manage_params(self, problem_text: str, post_response_handler: Po
'client_type': client_type}

def append_chat_record(self, chat_record: ChatRecord, client_id=None):
chat_record.problem_text = chat_record.problem_text[0:1024] if chat_record.problem_text is not None else ""
# 存入缓存中
self.chat_record_list.append(chat_record)
if self.application.id is not None:
Expand Down Expand Up @@ -138,7 +139,7 @@ def handler(self,

class ChatMessageSerializer(serializers.Serializer):
chat_id = serializers.UUIDField(required=True, error_messages=ErrMessage.char("对话id"))
message = serializers.CharField(required=True, error_messages=ErrMessage.char("用户问题"), max_length=1024)
message = serializers.CharField(required=True, error_messages=ErrMessage.char("用户问题"))
stream = serializers.BooleanField(required=True, error_messages=ErrMessage.char("是否流式回答"))
re_chat = serializers.BooleanField(required=True, error_messages=ErrMessage.char("是否重新回答"))
application_id = serializers.UUIDField(required=False, allow_null=True, error_messages=ErrMessage.uuid("应用id"))
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/log/component/EditContentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const open = (data: any) => {
getDataset()
form.value.chat_id = data.chat_id
form.value.record_id = data.id
form.value.problem_text = data.problem_text
form.value.problem_text = data.problem_text ? data.problem_text.substring(0, 256) : ''
form.value.content = data.answer_text
formRef.value?.clearValidate()
dialogVisible.value = true
Expand Down
Loading