feat: add context record count configuration to chat

#773
This commit is contained in:
ulleo
2026-01-26 17:21:56 +08:00
committed by ulleo
parent a3ad51e9b7
commit 5cdfc07169
6 changed files with 115 additions and 44 deletions
+2
View File
@@ -13,6 +13,8 @@
"memo": "Memo update rules: Match table name and field name. If a match is found, update the table memo and field memo; otherwise, leave the memo unchanged.",
"parameter_configuration": "Parameter Config",
"question_count_settings": "Question Count Settings",
"context_record_count": "Context Record Count",
"context_record_count_hint": "Number of user question rounds",
"model_thinking_process": "Expand Model Thinking Process",
"rows_of_data": "Limit 1000 Rows of Data",
"third_party_platform_settings": "Third-Party Platform Settings",
+2
View File
@@ -13,6 +13,8 @@
"memo": "메모 업데이트 규칙: 테이블 이름과 필드 이름이 일치하는지 확인합니다. 일치하는 항목이 있으면 테이블 메모와 필드 메모를 업데이트하고, 그렇지 않으면 메모를 변경하지 않고 그대로 둡니다.",
"parameter_configuration": "매개변수 구성",
"question_count_settings": "질문 수 설정",
"context_record_count": "컨텍스트 기록 수",
"context_record_count_hint": "사용자 질문 라운드 수",
"model_thinking_process": "모델 사고 프로세스 확장",
"rows_of_data": "데이터 1,000행 제한",
"third_party_platform_settings": "타사 플랫폼 설정",
+2
View File
@@ -13,6 +13,8 @@
"memo": "备注更新规则:根据表名和字段名匹配,如果匹配则更新表备注和字段备注;如果匹配不上,备注保持不变。",
"parameter_configuration": "参数配置",
"question_count_settings": "问数设置",
"context_record_count": "上下文记录数",
"context_record_count_hint": "用户提问轮数",
"model_thinking_process": "展开模型思考过程",
"rows_of_data": "限制 1000 行数据",
"third_party_platform_settings": "第三方平台设置",
+64 -34
View File
@@ -31,6 +31,13 @@ const loadData = () => {
})
}
const onContextRecordCountChange = (count: number) => {
if (count < 0) {
state.parameterForm['chat.context_record_count'] = 0
}
state.parameterForm['chat.context_record_count'] = Math.floor(count)
}
const beforeChange = (): Promise<boolean> => {
return new Promise((resolve) => {
if (!state.parameterForm['chat.rows_of_data']) {
@@ -88,41 +95,66 @@ onMounted(() => {
<div class="card-title">
{{ t('parameter.question_count_settings') }}
</div>
<div class="card-item">
<div class="label">
{{ t('parameter.model_thinking_process') }}
<el-row>
<div class="card-item">
<div class="label">
{{ t('parameter.model_thinking_process') }}
<el-tooltip effect="dark" :content="t('parameter.closed_by_default')" placement="top">
<el-icon size="16">
<icon_info_outlined_1></icon_info_outlined_1>
</el-icon>
</el-tooltip>
<el-tooltip effect="dark" :content="t('parameter.closed_by_default')" placement="top">
<el-icon size="16">
<icon_info_outlined_1></icon_info_outlined_1>
</el-icon>
</el-tooltip>
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.expand_thinking_block']" />
</div>
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.expand_thinking_block']" />
<div class="card-item" style="margin-left: 16px">
<div class="label">
{{ t('parameter.rows_of_data') }}
<el-tooltip
effect="dark"
:content="t('parameter.excessive_data_volume')"
placement="top"
>
<el-icon size="16">
<icon_info_outlined_1></icon_info_outlined_1>
</el-icon>
</el-tooltip>
</div>
<div class="value">
<el-switch
v-model="state.parameterForm['chat.limit_rows']"
:before-change="beforeChange"
/>
</div>
</div>
</div>
<div class="card-item" style="margin-left: 16px">
<div class="label">
{{ t('parameter.rows_of_data') }}
<el-tooltip
effect="dark"
:content="t('parameter.excessive_data_volume')"
placement="top"
>
<el-icon size="16">
<icon_info_outlined_1></icon_info_outlined_1>
</el-icon>
</el-tooltip>
</el-row>
<el-row>
<div class="card-item">
<div class="label">
{{ t('parameter.context_record_count') }}
<el-tooltip
effect="dark"
:content="t('parameter.context_record_count_hint')"
placement="top"
>
<el-icon size="16">
<icon_info_outlined_1></icon_info_outlined_1>
</el-icon>
</el-tooltip>
</div>
<div class="value">
<el-input-number
v-model.number="state.parameterForm['chat.context_record_count']"
min="0"
step="1"
@change="onContextRecordCountChange"
/>
</div>
</div>
<div class="value">
<el-switch
v-model="state.parameterForm['chat.limit_rows']"
:before-change="beforeChange"
/>
</div>
</div>
</el-row>
</div>
<platform-param />
@@ -152,7 +184,6 @@ onMounted(() => {
}
.title {
font-weight: 500;
font-style: Medium;
font-size: 20px;
line-height: 28px;
margin-bottom: 16px;
@@ -164,12 +195,11 @@ onMounted(() => {
padding: 16px;
border: 1px solid #dee0e3;
display: flex;
flex-wrap: wrap;
flex-direction: column;
margin-top: 16px;
.card-title {
font-weight: 500;
font-style: Medium;
font-size: 16px;
line-height: 24px;
width: 100%;