Skip to content

Commit

Permalink
feat: 对话用户问题调整为10万字符 1Panel-dev#628 (1Panel-dev#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohuzhang1 authored Jun 13, 2024
1 parent 0c25a66 commit 3f38f14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 3f38f14

Please sign in to comment.