Skip to content

feat: 增加在应用里通过日志绑定问题的时候,问题可以修改 #292 #527

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
May 24, 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
8 changes: 6 additions & 2 deletions apps/application/serializers/chat_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ class ImproveSerializer(serializers.Serializer):
error_messages=ErrMessage.char("段落标题"))
content = serializers.CharField(required=True, error_messages=ErrMessage.char("段落内容"))

problem_text = serializers.CharField(required=False, allow_null=True, allow_blank=True,
error_messages=ErrMessage.char("问题"))

class ParagraphModel(serializers.ModelSerializer):
class Meta:
model = Paragraph
Expand Down Expand Up @@ -496,8 +499,9 @@ def improve(self, instance: Dict, with_valid=True):
content=instance.get("content"),
dataset_id=dataset_id,
title=instance.get("title") if 'title' in instance else '')

problem = Problem(id=uuid.uuid1(), content=chat_record.problem_text, dataset_id=dataset_id)
problem_text = instance.get('problem_text') if instance.get(
'problem_text') is not None else chat_record.problem_text
problem = Problem(id=uuid.uuid1(), content=problem_text, dataset_id=dataset_id)
problem_paragraph_mapping = ProblemParagraphMapping(id=uuid.uuid1(), dataset_id=dataset_id,
document_id=document_id,
problem_id=problem.id,
Expand Down
5 changes: 3 additions & 2 deletions ui/src/views/log/component/EditContentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@submit.prevent
>
<el-form-item label="关联问题">
<span>{{ form.problem_text }}</span>
<el-input v-model="form.problem_text" placeholder="关联问题"> </el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input
Expand Down Expand Up @@ -172,7 +172,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (valid) {
const obj = {
title: form.value.title,
content: form.value.content
content: form.value.content,
problem_text: form.value.problem_text
}
logApi
.putChatRecordLog(
Expand Down
Loading